camlspotter avatar camlspotter committed ba97da3

added some more functions from ocamlspot

Comments (0)

Files changed (14)

    option
    xlist
    hashSet
-   xformat
    xhashtbl
    xstring
    xlazy
+   xformat
+   xfilename
    phantom
    weaktbl
    spot
 MyOCamlPackage($(LIB), $(LIBFILES), $(EMPTY), $(EMPTY))
 
 PHANTOM_GEN[] =
+   monad_intf
+   monad
    xlist
+   xlazy
    xformat
    gen_phantom
 
+(* This is an autogenerated file. Do not edit. *)
+
+type ('phantom, 'content) t = 'content
+
+module Open = struct
+  type unknown
+  let unknown : unknown = Obj.magic 0
+  let (!<) x = x
+  let (!>) x = x
+  let (!?) x = x
+end
+include Open
+let unsafe x = x
+let magic x = x
+
+let map f x = f x
+let combine x y = (x,y)
+
+type ('phantom, 'content) ts = 'content list
+
+let c0  = []
+let c1 t0 = [t0]
+let c2 t0 t1 = [t0; t1]
+let c3 t0 t1 t2 = [t0; t1; t2]
+let c4 t0 t1 t2 t3 = [t0; t1; t2; t3]
+let c5 t0 t1 t2 t3 t4 = [t0; t1; t2; t3; t4]
+let c6 t0 t1 t2 t3 t4 t5 = [t0; t1; t2; t3; t4; t5]
+let c7 t0 t1 t2 t3 t4 t5 t6 = [t0; t1; t2; t3; t4; t5; t6]
+let c8 t0 t1 t2 t3 t4 t5 t6 t7 = [t0; t1; t2; t3; t4; t5; t6; t7]
+let c9 t0 t1 t2 t3 t4 t5 t6 t7 t8 = [t0; t1; t2; t3; t4; t5; t6; t7; t8]
+let c10 t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 = [t0; t1; t2; t3; t4; t5; t6; t7; t8; t9]
+
+let d0 = function [] -> () | _ -> assert false
+let d1 = function [t0] -> (t0) | _ -> assert false
+let d2 = function [t0; t1] -> (t0, t1) | _ -> assert false
+let d3 = function [t0; t1; t2] -> (t0, t1, t2) | _ -> assert false
+let d4 = function [t0; t1; t2; t3] -> (t0, t1, t2, t3) | _ -> assert false
+let d5 = function [t0; t1; t2; t3; t4] -> (t0, t1, t2, t3, t4) | _ -> assert false
+let d6 = function [t0; t1; t2; t3; t4; t5] -> (t0, t1, t2, t3, t4, t5) | _ -> assert false
+let d7 = function [t0; t1; t2; t3; t4; t5; t6] -> (t0, t1, t2, t3, t4, t5, t6) | _ -> assert false
+let d8 = function [t0; t1; t2; t3; t4; t5; t6; t7] -> (t0, t1, t2, t3, t4, t5, t6, t7) | _ -> assert false
+let d9 = function [t0; t1; t2; t3; t4; t5; t6; t7; t8] -> (t0, t1, t2, t3, t4, t5, t6, t7, t8) | _ -> assert false
+let d10 = function [t0; t1; t2; t3; t4; t5; t6; t7; t8; t9] -> (t0, t1, t2, t3, t4, t5, t6, t7, t8, t9) | _ -> assert false
+
+let get0 l = List.nth l 0
+let get1 l = List.nth l 1
+let get2 l = List.nth l 2
+let get3 l = List.nth l 3
+let get4 l = List.nth l 4
+let get5 l = List.nth l 5
+let get6 l = List.nth l 6
+let get7 l = List.nth l 7
+let get8 l = List.nth l 8
+let get9 l = List.nth l 9
+let get10 l = List.nth l 10
+
+type tpl0 = unit
+type 'a0 tpl1 = ('a0 * unit)
+type ('a0,'a1) tpl2 = ('a0 * ('a1 * unit))
+type ('a0,'a1,'a2) tpl3 = ('a0 * ('a1 * ('a2 * unit)))
+type ('a0,'a1,'a2,'a3) tpl4 = ('a0 * ('a1 * ('a2 * ('a3 * unit))))
+type ('a0,'a1,'a2,'a3,'a4) tpl5 = ('a0 * ('a1 * ('a2 * ('a3 * ('a4 * unit)))))
+type ('a0,'a1,'a2,'a3,'a4,'a5) tpl6 = ('a0 * ('a1 * ('a2 * ('a3 * ('a4 * ('a5 * unit))))))
+type ('a0,'a1,'a2,'a3,'a4,'a5,'a6) tpl7 = ('a0 * ('a1 * ('a2 * ('a3 * ('a4 * ('a5 * ('a6 * unit)))))))
+type ('a0,'a1,'a2,'a3,'a4,'a5,'a6,'a7) tpl8 = ('a0 * ('a1 * ('a2 * ('a3 * ('a4 * ('a5 * ('a6 * ('a7 * unit))))))))
+type ('a0,'a1,'a2,'a3,'a4,'a5,'a6,'a7,'a8) tpl9 = ('a0 * ('a1 * ('a2 * ('a3 * ('a4 * ('a5 * ('a6 * ('a7 * ('a8 * unit)))))))))
+type ('a0,'a1,'a2,'a3,'a4,'a5,'a6,'a7,'a8,'a9) tpl10 = ('a0 * ('a1 * ('a2 * ('a3 * ('a4 * ('a5 * ('a6 * ('a7 * ('a8 * ('a9 * unit))))))))))
+
+let uncurry0 f _tpl = f ()
+let uncurry1 f tpl = f (get0 tpl : ('a0,'c) t)
+let uncurry2 f tpl = f (get0 tpl : ('a0,'c) t) (get1 tpl : ('a1,'c) t)
+let uncurry3 f tpl = f (get0 tpl : ('a0,'c) t) (get1 tpl : ('a1,'c) t) (get2 tpl : ('a2,'c) t)
+let uncurry4 f tpl = f (get0 tpl : ('a0,'c) t) (get1 tpl : ('a1,'c) t) (get2 tpl : ('a2,'c) t) (get3 tpl : ('a3,'c) t)
+let uncurry5 f tpl = f (get0 tpl : ('a0,'c) t) (get1 tpl : ('a1,'c) t) (get2 tpl : ('a2,'c) t) (get3 tpl : ('a3,'c) t) (get4 tpl : ('a4,'c) t)
+let uncurry6 f tpl = f (get0 tpl : ('a0,'c) t) (get1 tpl : ('a1,'c) t) (get2 tpl : ('a2,'c) t) (get3 tpl : ('a3,'c) t) (get4 tpl : ('a4,'c) t) (get5 tpl : ('a5,'c) t)
+let uncurry7 f tpl = f (get0 tpl : ('a0,'c) t) (get1 tpl : ('a1,'c) t) (get2 tpl : ('a2,'c) t) (get3 tpl : ('a3,'c) t) (get4 tpl : ('a4,'c) t) (get5 tpl : ('a5,'c) t) (get6 tpl : ('a6,'c) t)
+let uncurry8 f tpl = f (get0 tpl : ('a0,'c) t) (get1 tpl : ('a1,'c) t) (get2 tpl : ('a2,'c) t) (get3 tpl : ('a3,'c) t) (get4 tpl : ('a4,'c) t) (get5 tpl : ('a5,'c) t) (get6 tpl : ('a6,'c) t) (get7 tpl : ('a7,'c) t)
+let uncurry9 f tpl = f (get0 tpl : ('a0,'c) t) (get1 tpl : ('a1,'c) t) (get2 tpl : ('a2,'c) t) (get3 tpl : ('a3,'c) t) (get4 tpl : ('a4,'c) t) (get5 tpl : ('a5,'c) t) (get6 tpl : ('a6,'c) t) (get7 tpl : ('a7,'c) t) (get8 tpl : ('a8,'c) t)
+let uncurry10 f tpl = f (get0 tpl : ('a0,'c) t) (get1 tpl : ('a1,'c) t) (get2 tpl : ('a2,'c) t) (get3 tpl : ('a3,'c) t) (get4 tpl : ('a4,'c) t) (get5 tpl : ('a5,'c) t) (get6 tpl : ('a6,'c) t) (get7 tpl : ('a7,'c) t) (get8 tpl : ('a8,'c) t) (get9 tpl : ('a9,'c) t)
+
+let curry0 f () = f c0
+let curry1 f (v0 : ('a0,'c) t) = f (c1 v0)
+let curry2 f (v0 : ('a0,'c) t) (v1 : ('a1,'c) t) = f (c2 v0 v1)
+let curry3 f (v0 : ('a0,'c) t) (v1 : ('a1,'c) t) (v2 : ('a2,'c) t) = f (c3 v0 v1 v2)
+let curry4 f (v0 : ('a0,'c) t) (v1 : ('a1,'c) t) (v2 : ('a2,'c) t) (v3 : ('a3,'c) t) = f (c4 v0 v1 v2 v3)
+let curry5 f (v0 : ('a0,'c) t) (v1 : ('a1,'c) t) (v2 : ('a2,'c) t) (v3 : ('a3,'c) t) (v4 : ('a4,'c) t) = f (c5 v0 v1 v2 v3 v4)
+let curry6 f (v0 : ('a0,'c) t) (v1 : ('a1,'c) t) (v2 : ('a2,'c) t) (v3 : ('a3,'c) t) (v4 : ('a4,'c) t) (v5 : ('a5,'c) t) = f (c6 v0 v1 v2 v3 v4 v5)
+let curry7 f (v0 : ('a0,'c) t) (v1 : ('a1,'c) t) (v2 : ('a2,'c) t) (v3 : ('a3,'c) t) (v4 : ('a4,'c) t) (v5 : ('a5,'c) t) (v6 : ('a6,'c) t) = f (c7 v0 v1 v2 v3 v4 v5 v6)
+let curry8 f (v0 : ('a0,'c) t) (v1 : ('a1,'c) t) (v2 : ('a2,'c) t) (v3 : ('a3,'c) t) (v4 : ('a4,'c) t) (v5 : ('a5,'c) t) (v6 : ('a6,'c) t) (v7 : ('a7,'c) t) = f (c8 v0 v1 v2 v3 v4 v5 v6 v7)
+let curry9 f (v0 : ('a0,'c) t) (v1 : ('a1,'c) t) (v2 : ('a2,'c) t) (v3 : ('a3,'c) t) (v4 : ('a4,'c) t) (v5 : ('a5,'c) t) (v6 : ('a6,'c) t) (v7 : ('a7,'c) t) (v8 : ('a8,'c) t) = f (c9 v0 v1 v2 v3 v4 v5 v6 v7 v8)
+let curry10 f (v0 : ('a0,'c) t) (v1 : ('a1,'c) t) (v2 : ('a2,'c) t) (v3 : ('a3,'c) t) (v4 : ('a4,'c) t) (v5 : ('a5,'c) t) (v6 : ('a6,'c) t) (v7 : ('a7,'c) t) (v8 : ('a8,'c) t) (v9 : ('a9,'c) t) = f (c10 v0 v1 v2 v3 v4 v5 v6 v7 v8 v9)
+
+module List = struct
+  let unsafe_list x = x
+  let to_list v = v
+  let to_unknown_list v = v
+  let to_array = Array.of_list
+  let to_unknown_array = Array.of_list
+  let of_unknown_list v = v
+  let of_unknown_array = Array.to_list
+  let unsafe_of_list v = v
+  let unsafe_of_array = Array.to_list
+  
+  let length = List.length 
+  let map = List.map
+  let combine = List.combine
+
+  type ('phantom, 'content) t = ('phantom, 'content) ts
+end
+
+(* This is an autogenerated file. Do not edit. *)
+
+(**
+   Opening this module like Spotlib.Spot.Phantom is NOT recommended. 
+   Instead, open Spotlib.Spot.Phantom.Open. Using a module alias is also helpful:
+   
+   module P = Spotlib.Spot.Phantom
+   open P.Open
+*)
+type ('phantom, 'cont) t
+
+(* Rather than open Phantom, I recommend to open Phantom.Open *)
+module Open : sig
+  type unknown 
+  val unknown : unknown
+  val (!<) : ('a, 'cont) t -> 'cont
+  (** Forget the phantom *)
+  val (!>) : 'cont -> (unknown, 'cont) t
+  (** Safe lift up with the unknown phantom *)
+  val (!?) : ('a, 'cont) t -> (unknown, 'cont) t
+  (** Forget the phantom *)
+end
+type unknown = Open.unknown
+val unknown : Open.unknown
+val (!<) : ('a, 'cont) t -> 'cont
+val (!>) : 'cont -> (unknown, 'cont) t
+val (!?) : ('a, 'cont) t -> (unknown, 'cont) t
+
+val unsafe : 'cont -> ('unsafe, 'cont) t
+(** [unsafe v] lifts up [v] of [elt] to one with any phantom. Use with care. *)
+val magic : ('a, 'cont) t -> ('unsafe, 'cont) t
+(** [magic v] changes the phantom ov [v]. Use with care. *)
+
+val map : ('cont -> 'cont2) -> ('a, 'cont) t -> ('a, 'cont2) t
+val combine : 'tag -> ('a, 'cont) t -> ('a, 'tag * 'cont) t
+
+type ('phantom, 'cont) ts
+(** phantom heterogeneous 'cont list *)
+
+module List : sig
+  val unsafe_list : 'cont list -> ('unsafe, 'cont) ts
+  (** [unsafe_list ls] lifts up [ls] of [elt list] to a list with any phantom. Use with care. *)
+  val to_list : ('a, 'cont) ts -> 'cont list
+  val to_unknown_list : ('a, 'cont) ts -> (unknown, 'cont) t list
+  val to_array : ('a, 'cont) ts -> 'cont array
+  val to_unknown_array : ('a, 'cont) ts -> (unknown, 'cont) t array
+  val of_unknown_list : (unknown, 'cont) t list -> (unknown, 'cont) ts
+  val of_unknown_array : (unknown, 'cont) t array -> (unknown, 'cont) ts
+  val unsafe_of_list : 'cont list -> ('unsafe, 'cont) ts
+  val unsafe_of_array : 'cont array -> ('unsafe, 'cont) ts
+  
+  val length : ('a, 'cont) ts -> int
+  val map : ('cont -> 'cont2) -> ('a, 'cont) ts -> ('a, 'cont2) ts
+  val combine : 'tag list -> ('a, 'cont) ts -> ('a, ('tag * 'cont)) ts
+
+  type ('phantom, 'cont) t = ('phantom, 'cont) ts
+end
+
+(* This encoding is correct only if the parameter cannot be the unit or a tuple *)
+type tpl0 = unit
+type 'a0 tpl1 = ('a0 * unit)
+type ('a0,'a1) tpl2 = ('a0 * ('a1 * unit))
+type ('a0,'a1,'a2) tpl3 = ('a0 * ('a1 * ('a2 * unit)))
+type ('a0,'a1,'a2,'a3) tpl4 = ('a0 * ('a1 * ('a2 * ('a3 * unit))))
+type ('a0,'a1,'a2,'a3,'a4) tpl5 = ('a0 * ('a1 * ('a2 * ('a3 * ('a4 * unit)))))
+type ('a0,'a1,'a2,'a3,'a4,'a5) tpl6 = ('a0 * ('a1 * ('a2 * ('a3 * ('a4 * ('a5 * unit))))))
+type ('a0,'a1,'a2,'a3,'a4,'a5,'a6) tpl7 = ('a0 * ('a1 * ('a2 * ('a3 * ('a4 * ('a5 * ('a6 * unit)))))))
+type ('a0,'a1,'a2,'a3,'a4,'a5,'a6,'a7) tpl8 = ('a0 * ('a1 * ('a2 * ('a3 * ('a4 * ('a5 * ('a6 * ('a7 * unit))))))))
+type ('a0,'a1,'a2,'a3,'a4,'a5,'a6,'a7,'a8) tpl9 = ('a0 * ('a1 * ('a2 * ('a3 * ('a4 * ('a5 * ('a6 * ('a7 * ('a8 * unit)))))))))
+type ('a0,'a1,'a2,'a3,'a4,'a5,'a6,'a7,'a8,'a9) tpl10 = ('a0 * ('a1 * ('a2 * ('a3 * ('a4 * ('a5 * ('a6 * ('a7 * ('a8 * ('a9 * unit))))))))))
+
+val c0 : (tpl0,'c) ts
+val c1 : ('a0,'c) t -> ('a0 tpl1,'c) ts
+val c2 : ('a0,'c) t -> ('a1,'c) t -> (('a0,'a1) tpl2,'c) ts
+val c3 : ('a0,'c) t -> ('a1,'c) t -> ('a2,'c) t -> (('a0,'a1,'a2) tpl3,'c) ts
+val c4 : ('a0,'c) t -> ('a1,'c) t -> ('a2,'c) t -> ('a3,'c) t -> (('a0,'a1,'a2,'a3) tpl4,'c) ts
+val c5 : ('a0,'c) t -> ('a1,'c) t -> ('a2,'c) t -> ('a3,'c) t -> ('a4,'c) t -> (('a0,'a1,'a2,'a3,'a4) tpl5,'c) ts
+val c6 : ('a0,'c) t -> ('a1,'c) t -> ('a2,'c) t -> ('a3,'c) t -> ('a4,'c) t -> ('a5,'c) t -> (('a0,'a1,'a2,'a3,'a4,'a5) tpl6,'c) ts
+val c7 : ('a0,'c) t -> ('a1,'c) t -> ('a2,'c) t -> ('a3,'c) t -> ('a4,'c) t -> ('a5,'c) t -> ('a6,'c) t -> (('a0,'a1,'a2,'a3,'a4,'a5,'a6) tpl7,'c) ts
+val c8 : ('a0,'c) t -> ('a1,'c) t -> ('a2,'c) t -> ('a3,'c) t -> ('a4,'c) t -> ('a5,'c) t -> ('a6,'c) t -> ('a7,'c) t -> (('a0,'a1,'a2,'a3,'a4,'a5,'a6,'a7) tpl8,'c) ts
+val c9 : ('a0,'c) t -> ('a1,'c) t -> ('a2,'c) t -> ('a3,'c) t -> ('a4,'c) t -> ('a5,'c) t -> ('a6,'c) t -> ('a7,'c) t -> ('a8,'c) t -> (('a0,'a1,'a2,'a3,'a4,'a5,'a6,'a7,'a8) tpl9,'c) ts
+val c10 : ('a0,'c) t -> ('a1,'c) t -> ('a2,'c) t -> ('a3,'c) t -> ('a4,'c) t -> ('a5,'c) t -> ('a6,'c) t -> ('a7,'c) t -> ('a8,'c) t -> ('a9,'c) t -> (('a0,'a1,'a2,'a3,'a4,'a5,'a6,'a7,'a8,'a9) tpl10,'c) ts
+
+val d1 : ('a0 tpl1,'c) ts -> ('a0,'c) t
+val d2 : (('a0,'a1) tpl2,'c) ts -> ('a0,'c) t * ('a1,'c) t
+val d3 : (('a0,'a1,'a2) tpl3,'c) ts -> ('a0,'c) t * ('a1,'c) t * ('a2,'c) t
+val d4 : (('a0,'a1,'a2,'a3) tpl4,'c) ts -> ('a0,'c) t * ('a1,'c) t * ('a2,'c) t * ('a3,'c) t
+val d5 : (('a0,'a1,'a2,'a3,'a4) tpl5,'c) ts -> ('a0,'c) t * ('a1,'c) t * ('a2,'c) t * ('a3,'c) t * ('a4,'c) t
+val d6 : (('a0,'a1,'a2,'a3,'a4,'a5) tpl6,'c) ts -> ('a0,'c) t * ('a1,'c) t * ('a2,'c) t * ('a3,'c) t * ('a4,'c) t * ('a5,'c) t
+val d7 : (('a0,'a1,'a2,'a3,'a4,'a5,'a6) tpl7,'c) ts -> ('a0,'c) t * ('a1,'c) t * ('a2,'c) t * ('a3,'c) t * ('a4,'c) t * ('a5,'c) t * ('a6,'c) t
+val d8 : (('a0,'a1,'a2,'a3,'a4,'a5,'a6,'a7) tpl8,'c) ts -> ('a0,'c) t * ('a1,'c) t * ('a2,'c) t * ('a3,'c) t * ('a4,'c) t * ('a5,'c) t * ('a6,'c) t * ('a7,'c) t
+val d9 : (('a0,'a1,'a2,'a3,'a4,'a5,'a6,'a7,'a8) tpl9,'c) ts -> ('a0,'c) t * ('a1,'c) t * ('a2,'c) t * ('a3,'c) t * ('a4,'c) t * ('a5,'c) t * ('a6,'c) t * ('a7,'c) t * ('a8,'c) t
+val d10 : (('a0,'a1,'a2,'a3,'a4,'a5,'a6,'a7,'a8,'a9) tpl10,'c) ts -> ('a0,'c) t * ('a1,'c) t * ('a2,'c) t * ('a3,'c) t * ('a4,'c) t * ('a5,'c) t * ('a6,'c) t * ('a7,'c) t * ('a8,'c) t * ('a9,'c) t
+
+val get0 : (('a0 * _),'c) ts -> ('a0,'c) t
+val get1 : (('a0 * ('a1 * _)),'c) ts -> ('a1,'c) t
+val get2 : (('a0 * ('a1 * ('a2 * _))),'c) ts -> ('a2,'c) t
+val get3 : (('a0 * ('a1 * ('a2 * ('a3 * _)))),'c) ts -> ('a3,'c) t
+val get4 : (('a0 * ('a1 * ('a2 * ('a3 * ('a4 * _))))),'c) ts -> ('a4,'c) t
+val get5 : (('a0 * ('a1 * ('a2 * ('a3 * ('a4 * ('a5 * _)))))),'c) ts -> ('a5,'c) t
+val get6 : (('a0 * ('a1 * ('a2 * ('a3 * ('a4 * ('a5 * ('a6 * _))))))),'c) ts -> ('a6,'c) t
+val get7 : (('a0 * ('a1 * ('a2 * ('a3 * ('a4 * ('a5 * ('a6 * ('a7 * _)))))))),'c) ts -> ('a7,'c) t
+val get8 : (('a0 * ('a1 * ('a2 * ('a3 * ('a4 * ('a5 * ('a6 * ('a7 * ('a8 * _))))))))),'c) ts -> ('a8,'c) t
+val get9 : (('a0 * ('a1 * ('a2 * ('a3 * ('a4 * ('a5 * ('a6 * ('a7 * ('a8 * ('a9 * _)))))))))),'c) ts -> ('a9,'c) t
+
+val uncurry0 : (unit -> 'z) -> ((tpl0, 'c) ts -> 'z)
+val uncurry1 : (('a0,'c) t -> 'z) -> (('a0 tpl1, 'c) ts -> 'z)
+val uncurry2 : (('a0,'c) t -> ('a1,'c) t -> 'z) -> ((('a0,'a1) tpl2, 'c) ts -> 'z)
+val uncurry3 : (('a0,'c) t -> ('a1,'c) t -> ('a2,'c) t -> 'z) -> ((('a0,'a1,'a2) tpl3, 'c) ts -> 'z)
+val uncurry4 : (('a0,'c) t -> ('a1,'c) t -> ('a2,'c) t -> ('a3,'c) t -> 'z) -> ((('a0,'a1,'a2,'a3) tpl4, 'c) ts -> 'z)
+val uncurry5 : (('a0,'c) t -> ('a1,'c) t -> ('a2,'c) t -> ('a3,'c) t -> ('a4,'c) t -> 'z) -> ((('a0,'a1,'a2,'a3,'a4) tpl5, 'c) ts -> 'z)
+val uncurry6 : (('a0,'c) t -> ('a1,'c) t -> ('a2,'c) t -> ('a3,'c) t -> ('a4,'c) t -> ('a5,'c) t -> 'z) -> ((('a0,'a1,'a2,'a3,'a4,'a5) tpl6, 'c) ts -> 'z)
+val uncurry7 : (('a0,'c) t -> ('a1,'c) t -> ('a2,'c) t -> ('a3,'c) t -> ('a4,'c) t -> ('a5,'c) t -> ('a6,'c) t -> 'z) -> ((('a0,'a1,'a2,'a3,'a4,'a5,'a6) tpl7, 'c) ts -> 'z)
+val uncurry8 : (('a0,'c) t -> ('a1,'c) t -> ('a2,'c) t -> ('a3,'c) t -> ('a4,'c) t -> ('a5,'c) t -> ('a6,'c) t -> ('a7,'c) t -> 'z) -> ((('a0,'a1,'a2,'a3,'a4,'a5,'a6,'a7) tpl8, 'c) ts -> 'z)
+val uncurry9 : (('a0,'c) t -> ('a1,'c) t -> ('a2,'c) t -> ('a3,'c) t -> ('a4,'c) t -> ('a5,'c) t -> ('a6,'c) t -> ('a7,'c) t -> ('a8,'c) t -> 'z) -> ((('a0,'a1,'a2,'a3,'a4,'a5,'a6,'a7,'a8) tpl9, 'c) ts -> 'z)
+val uncurry10 : (('a0,'c) t -> ('a1,'c) t -> ('a2,'c) t -> ('a3,'c) t -> ('a4,'c) t -> ('a5,'c) t -> ('a6,'c) t -> ('a7,'c) t -> ('a8,'c) t -> ('a9,'c) t -> 'z) -> ((('a0,'a1,'a2,'a3,'a4,'a5,'a6,'a7,'a8,'a9) tpl10, 'c) ts -> 'z)
+
+val curry0 : ((tpl0,'c) ts -> 'z) -> unit -> 'z
+val curry1 : (('a0 tpl1,'c) ts -> 'z) -> (('a0,'c) t -> 'z)
+val curry2 : ((('a0,'a1) tpl2,'c) ts -> 'z) -> (('a0,'c) t -> ('a1,'c) t -> 'z)
+val curry3 : ((('a0,'a1,'a2) tpl3,'c) ts -> 'z) -> (('a0,'c) t -> ('a1,'c) t -> ('a2,'c) t -> 'z)
+val curry4 : ((('a0,'a1,'a2,'a3) tpl4,'c) ts -> 'z) -> (('a0,'c) t -> ('a1,'c) t -> ('a2,'c) t -> ('a3,'c) t -> 'z)
+val curry5 : ((('a0,'a1,'a2,'a3,'a4) tpl5,'c) ts -> 'z) -> (('a0,'c) t -> ('a1,'c) t -> ('a2,'c) t -> ('a3,'c) t -> ('a4,'c) t -> 'z)
+val curry6 : ((('a0,'a1,'a2,'a3,'a4,'a5) tpl6,'c) ts -> 'z) -> (('a0,'c) t -> ('a1,'c) t -> ('a2,'c) t -> ('a3,'c) t -> ('a4,'c) t -> ('a5,'c) t -> 'z)
+val curry7 : ((('a0,'a1,'a2,'a3,'a4,'a5,'a6) tpl7,'c) ts -> 'z) -> (('a0,'c) t -> ('a1,'c) t -> ('a2,'c) t -> ('a3,'c) t -> ('a4,'c) t -> ('a5,'c) t -> ('a6,'c) t -> 'z)
+val curry8 : ((('a0,'a1,'a2,'a3,'a4,'a5,'a6,'a7) tpl8,'c) ts -> 'z) -> (('a0,'c) t -> ('a1,'c) t -> ('a2,'c) t -> ('a3,'c) t -> ('a4,'c) t -> ('a5,'c) t -> ('a6,'c) t -> ('a7,'c) t -> 'z)
+val curry9 : ((('a0,'a1,'a2,'a3,'a4,'a5,'a6,'a7,'a8) tpl9,'c) ts -> 'z) -> (('a0,'c) t -> ('a1,'c) t -> ('a2,'c) t -> ('a3,'c) t -> ('a4,'c) t -> ('a5,'c) t -> ('a6,'c) t -> ('a7,'c) t -> ('a8,'c) t -> 'z)
+val curry10 : ((('a0,'a1,'a2,'a3,'a4,'a5,'a6,'a7,'a8,'a9) tpl10,'c) ts -> 'z) -> (('a0,'c) t -> ('a1,'c) t -> ('a2,'c) t -> ('a3,'c) t -> ('a4,'c) t -> ('a5,'c) t -> ('a6,'c) t -> ('a7,'c) t -> ('a8,'c) t -> ('a9,'c) t -> 'z)
   include Lazy
   include Xlazy
 end
+module Filename = struct
+  include Filename
+  include Xfilename
+end
+open Filename
+
+let split_extension s = 
+  try
+    let body = chop_extension s in
+    body, 
+    String.sub s 
+      (String.length body) 
+      (String.length s - String.length body)
+  with
+  | Invalid_argument _ -> s, ""
+
+module Open = struct
+  let (^/) p1 p2 =
+    if Filename.is_relative p2 then Filename.concat p1 p2 else p2
+end

lib/xfilename.mli

+val split_extension : string -> string * string
+module Open : sig
+  val (^/) : string -> string -> string
+end
+
+
         f x
         sep
         (list sep f) xs
+
+let option f ppf = function
+  | None -> Format.fprintf ppf "None"
+  | Some v -> Format.fprintf ppf "Some(%a)" f v 
+
+let lazy_ p ppf v =
+  if Xlazy.is_val v then p ppf (Xlazy.(!!) v)
+  else Format.fprintf ppf "lazy"
 val stderr : t
 
 val list : (t -> unit) -> (t -> 'a -> unit) -> t -> 'a list -> unit
+val option : (t -> 'a -> unit) -> t -> 'a option -> unit
+val lazy_ : (t -> 'a -> unit) -> t -> 'a Lazy.t -> unit
 end) : Monad_intf.T with type 'a t := 'a Lazy.t)
 
 let (!!) = force
+let eager = Lazy.lazy_from_val
+
+let peek v = if lazy_is_val v then Some (!!v) else None
+      
+let map ~f v = 
+  if lazy_is_val v then eager (f !!v)
+  else lazy (f !!v)
+
+let is_val = lazy_is_val
+open Lazy
 include Monad_intf.T with type 'a t := 'a Lazy.t
 
-val (!!) : 'a lazy_t -> 'a
+val (!!) : 'a t -> 'a
 (** Same as Lazy.force *)
+
+val eager : 'a -> 'a t
+val peek : 'a t -> 'a option
+val is_val : 'a t -> bool
     else from_to (f::st) (f+1) t
   in
   from_to [] f t
+
+let rec find_map_opt f = function
+  | [] -> None
+  | x::xs ->
+      match f x with
+      | Some v -> Some v
+      | None -> find_map_opt f xs
+
+let rec filter_map f lst =
+  List.rev (List.fold_left (fun st x ->
+    match f x with
+    | Some v -> v :: st
+    | None -> st) [] lst)
 
 val from_to : int -> int -> int list
   (** [from_to f t = [f..t]] *)
+
+val find_map_opt : ('a -> 'b option) -> 'a list -> 'b option
+val filter_map : ('a -> 'b option) -> 'a list -> 'b list
+(* run [f] on files in [path] *)
+let folddir ~f ~init path =
+  let dh = opendir path in
+  protect ~f:(fun () ->
+    let rec loop st =
+      try
+        let st' = f st (readdir dh) in
+        loop st'
+      with
+      | End_of_file -> st
+    in
+    loop init)
+    ~finally:(fun () -> closedir dh) ()
+;;
+
+module Inodes = Set.Make(struct
+  type t = int
+  let compare : int -> int -> int = fun x y -> compare x y
+end)
+;;
+
+type path = 
+    { dir : string;
+      base : string;
+      path : string; (* dir / name *)
+      stat : [ `Ok of stats | `Error of exn ];
+      depth : int;
+    }
+
+let path ~depth ~dir base =
+  let path = match Filename.concat dir base with
+    | "./." -> "."
+    | s -> s
+  in
+  { dir = dir;
+    base = base;
+    path = path;
+    depth = depth; 
+    stat = try `Ok (stat path) with e -> `Error e;
+  }
+;;
+
+let kind path =
+  match path.stat with
+  | `Error _exn -> None
+  | `Ok stat -> Some stat.st_kind
+;;
+
+let is_dir path = kind path = Some S_DIR
+
+let inode path = 
+  match path.stat with
+  | `Ok stat -> Some stat.st_ino
+  | `Error _ -> None
+;;
+
+exception Prune
+
+let prune () = raise Prune
+
+let find ~f fnames =
+
+  (* visited cache *)
+  let visited = ref Inodes.empty in
+  let if_not_visited_then path ~f = match inode path with
+    | None -> ()
+    | Some inode ->
+        if Inodes.mem inode !visited then ()
+        else begin
+          visited := Inodes.add inode !visited;
+          f path
+        end
+  in
+
+  let rec find_dir pth =
+    try 
+      f pth;
+      let subdirs =
+        folddir pth.path ~init:[] ~f:(fun dirs -> function
+          | "." | ".." -> dirs
+          | name -> 
+      	let pth = path ~depth:(pth.depth + 1) ~dir:pth.path name in
+      	if try is_dir pth with _ -> false then pth::dirs
+      	else begin find_non_dir pth; dirs end)
+      in
+      List.iter (if_not_visited_then ~f:find_dir) subdirs
+    with
+    | Prune -> ()
+
+  and find_non_dir path = try f path with Prune -> ()
+  in
+
+  List.iter (fun fname ->
+    let path = 
+      path ~depth: 0 ~dir:(Filename.dirname fname) (Filename.basename fname)
+    in
+    if is_dir path then find_dir path
+    else find_non_dir path) fnames
+;;
+type path = 
+    { dir : string;
+      base : string;
+      path : string; (* dir / name *)
+      stat : [ `Ok of stats | `Error of exn ];
+      depth : int;
+    }
+
+val prune : unit -> unit
+(** for [find] *)
+
+val find : f:(path -> unit) -> string list -> unit
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.