Advertisement
Guest User

Untitled

a guest
Oct 1st, 2014
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
OCaml 3.29 KB | None | 0 0
  1. # module StrTbl = Hashtbl.Make( StrKey );;
  2. module StrTbl :
  3.   sig
  4.     type key = StrKey.t
  5.     type 'a t = 'a BatHashtbl.Make(StrKey).t
  6.     val create : int -> 'a t
  7.     val length : 'a t -> int
  8.     val is_empty : 'a t -> bool
  9.     val clear : 'a t -> unit
  10.     val copy : 'a t -> 'a t
  11.     val add : 'a t -> key -> 'a -> unit
  12.     val remove : 'a t -> key -> unit
  13.     val remove_all : 'a t -> key -> unit
  14.     val find : 'a t -> key -> 'a
  15.     val find_all : 'a t -> key -> 'a list
  16.     val find_default : 'a t -> key -> 'a -> 'a
  17.     val find_option : 'a t -> key -> 'a option
  18.     val replace : 'a t -> key -> 'a -> unit
  19.     val mem : 'a t -> key -> bool
  20.     val iter : (key -> 'a -> unit) -> 'a t -> unit
  21.     val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
  22.     val map : (key -> 'b -> 'c) -> 'b t -> 'c t
  23.     val map_inplace : (key -> 'a -> 'a) -> 'a t -> unit
  24.     val filter : ('a -> bool) -> 'a t -> 'a t
  25.     val filter_inplace : ('a -> bool) -> 'a t -> unit
  26.     val filteri : (key -> 'a -> bool) -> 'a t -> 'a t
  27.     val filteri_inplace : (key -> 'a -> bool) -> 'a t -> unit
  28.     val filter_map : (key -> 'a -> 'b option) -> 'a t -> 'b t
  29.     val filter_map_inplace : (key -> 'a -> 'a option) -> 'a t -> unit
  30.     val modify : key -> ('a -> 'a) -> 'a t -> unit
  31.     val modify_def : 'a -> key -> ('a -> 'a) -> 'a t -> unit
  32.     val modify_opt : key -> ('a option -> 'a option) -> 'a t -> unit
  33.     val keys : 'a t -> key BatEnum.t
  34.     val values : 'a t -> 'a BatEnum.t
  35.     val enum : 'a t -> (key * 'a) BatEnum.t
  36.     val of_enum : (key * 'a) BatEnum.t -> 'a t
  37.     val print :
  38.       ?first:string ->
  39.       ?last:string ->
  40.       ?sep:string ->
  41.       ('a BatInnerIO.output -> key -> unit) ->
  42.       ('a BatInnerIO.output -> 'b -> unit) ->
  43.       'a BatInnerIO.output -> 'b t -> unit
  44.     module Exceptionless :
  45.       sig
  46.         val find : 'a t -> key -> 'a option
  47.         val modify :
  48.           key -> ('a -> 'a) -> 'a t -> (unit, exn) BatPervasives.result
  49.       end
  50.     module Infix :
  51.       sig
  52.         val ( --> ) : 'a t -> key -> 'a
  53.         val ( <-- ) : 'a t -> key * 'a -> unit
  54.       end
  55.     module Labels :
  56.       sig
  57.         val add : 'a t -> key:key -> data:'a -> unit
  58.         val replace : 'a t -> key:key -> data:'a -> unit
  59.         val iter : f:(key:key -> data:'a -> unit) -> 'a t -> unit
  60.         val map : f:(key:key -> data:'a -> 'b) -> 'a t -> 'b t
  61.         val map_inplace : f:(key:key -> data:'a -> 'a) -> 'a t -> unit
  62.         val filter : f:('a -> bool) -> 'a t -> 'a t
  63.         val filter_inplace : f:('a -> bool) -> 'a t -> unit
  64.         val filteri : f:(key:key -> data:'a -> bool) -> 'a t -> 'a t
  65.         val filteri_inplace : f:(key:key -> data:'a -> bool) -> 'a t -> unit
  66.         val filter_map : f:(key:key -> data:'a -> 'b option) -> 'a t -> 'b t
  67.         val filter_map_inplace :
  68.           f:(key:key -> data:'a -> 'a option) -> 'a t -> unit
  69.         val fold :
  70.           f:(key:key -> data:'a -> 'b -> 'b) -> 'a t -> init:'b -> 'b
  71.         val modify : key:key -> f:('a -> 'a) -> 'a t -> unit
  72.         val modify_def :
  73.           default:'a -> key:key -> f:('a -> 'a) -> 'a t -> unit
  74.         val modify_opt :
  75.           key:key -> f:('a option -> 'a option) -> 'a t -> unit
  76.       end
  77.   end
  78. # StrTbl.S
  79. ;;
  80.   Characters 0-8:
  81.   StrTbl.S
  82.   ^^^^^^^^
  83. Error: Unbound constructor StrTbl.S
  84. #
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement