camlspotter avatar camlspotter committed f44cf0c

moved phantom to spotlib

Comments (0)

Files changed (9)

 OCAMLPPFLAGS= -syntax camlp4o -package monad
 
 FILES[] =
-   phantom_intf
-   phantom
    ltype_intf
    ltype
    lvalue_intf
   end
 
   val func : string -> 'a typ -> 'b Ltype.Base.WithString.ts -> ('b vs -> 'a v m) -> ('b -> 'a) pointer v m
+    (** [func name return_type arg_types f] defines a function of a name [name] whose type is
+        [arg_types] -> [return_type]. Its function body is defined by [f].
+    *)
+
   val return_void : void v m 
     (** for functions returning void *)
+
   val if_then_else : bool v m -> 'a v m -> 'a v m -> 'a v m
 
   val exec : unit m -> unit
 
 module Base = struct
   (** phantom *)
-  include Phantom.Make(struct type t = lltype end)
+  include Spotlib.Spot.Phantom.Make(struct type t = lltype end)
   type 'a typ = 'a t 
   type 'a typs = 'a ts
   
 
   module type Tagged = sig
     type tag
-    include Phantom_intf.S with type elt = tag * Llvm.lltype
+    include Spotlib.Spot.Phantom_intf.S with type elt = tag * Llvm.lltype
     val tags : 'a ts -> tag list
     val types : 'a ts -> 'a typs
     val combine : tag list -> 'a typs -> 'a ts
     let base_of_list = of_list
 
     type tag = Tag.t
-    include Phantom.Make(struct 
+    include Spotlib.Spot.Phantom.Make(struct 
       type t = tag * lltype
     end)
   
 module type S0 = sig
   (** phantom *)
-  include Phantom_intf.S with type elt = Llvm.lltype
+  include Spotlib.Spot.Phantom_intf.S with type elt = Llvm.lltype
   type 'a typ = 'a t
   type 'a typs = 'a ts
   
 
   module type Tagged = sig
     type tag
-    include Phantom_intf.S with type elt = tag * Llvm.lltype
+    include Spotlib.Spot.Phantom_intf.S with type elt = tag * Llvm.lltype
     val tags : 'a ts -> tag list
     val types : 'a ts -> 'a typs
     val combine : tag list -> 'a typs -> 'a ts
 
 module Base = struct
   (** phantom *)
-  include Phantom.Make(struct type t = llvalue end)
+  include Spotlib.Spot.Phantom.Make(struct type t = llvalue end)
   type 'a v = 'a t
   type 'a vs = 'a ts
   
 
 module type S0 = sig
   (** phantom *)
-  include Phantom_intf.S with type elt = Llvm.llvalue
+  include Spotlib.Spot.Phantom_intf.S with type elt = Llvm.llvalue
   type 'a v = 'a t
   type 'a vs = 'a ts
 

phantom.ml

-type unknown = Phantom_intf.unknown
-
-module Make(M : sig type t end) = struct
-
-  type unknown = Phantom_intf.unknown
-  let unknown = Phantom_intf.Unknown.unknown
-
-  type elt = M.t
-  type 'a t = elt
-  type 'a ts = elt list 
-
-  let of_list v = v
-  let of_array = Array.to_list
-  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 length = List.length 
-
-  let (!<) x = x
-  let (!>) x = x
-  let (!?) x = x
-  let unsafe x = x
-  let unsafe_list x = x
-  let magic x = x
-
-  let c0 = []
-  let c1 t = [t]
-  let c2 t1 t2 = [t1; t2]
-  let c3 t1 t2 t3 = [t1; t2; t3]
-  let c4 t1 t2 t3 t4 = [t1; t2; t3; t4]
-  let c5 t1 t2 t3 t4 t5 = [t1; t2; t3; t4; t5]
-  let c6 t1 t2 t3 t4 t5 t6 = [t1; t2; t3; t4; t5; t6]
-  let c7 t1 t2 t3 t4 t5 t6 t7 = [t1; t2; t3; t4; t5; t6; t7]
-  let c8 t1 t2 t3 t4 t5 t6 t7 t8 = [t1; t2; t3; t4; t5; t6; t7; t8]
-  let c9 t1 t2 t3 t4 t5 t6 t7 t8 t9 = [t1; t2; t3; t4; t5; t6; t7; t8; t9]
-  let c10 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 = [t1; t2; t3; t4; t5; t6; t7; t8; t9; t10]
-  
-  let d1 = function [t] -> t | _ -> assert false
-  let d2 = function [t1; t2] -> (t1, t2) | _ -> assert false
-  let d3 = function [t1; t2; t3] -> (t1, t2, t3) | _ -> assert false
-  let d4 = function [t1; t2; t3; t4] -> (t1, t2, t3, t4) | _ -> assert false
-  let d5 = function [t1; t2; t3; t4; t5] -> (t1, t2, t3, t4, t5) | _ -> assert false
-  let d6 = function [t1; t2; t3; t4; t5; t6] -> (t1, t2, t3, t4, t5, t6) | _ -> assert false
-  let d7 = function [t1; t2; t3; t4; t5; t6; t7] -> (t1, t2, t3, t4, t5, t6, t7) | _ -> assert false
-  let d8 = function [t1; t2; t3; t4; t5; t6; t7; t8] -> (t1, t2, t3, t4, t5, t6, t7, t8) | _ -> assert false
-  let d9 = function [t1; t2; t3; t4; t5; t6; t7; t8; t9] -> (t1, t2, t3, t4, t5, t6, t7, t8, t9) | _ -> assert false
-  let d10 = function [t1; t2; t3; t4; t5; t6; t7; t8; t9; t10] -> (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10) | _ -> assert false
-
-end

phantom.mli

-type unknown = Phantom_intf.unknown
-    (** abstract type for the tag for "unknown phantom" *)
-
-module Make(M : sig type t end) : Phantom_intf.S 
-  with type elt = M.t 
-  and  type 'a t = M.t
-

phantom_intf.ml

-(* a stupid way to avoid recursion in type definition syntax *)
-module Unknown : sig 
-  type unknown
-  val unknown : unknown
-end = struct
-  type unknown = unit 
-  let unknown = ()
-end
-
-type unknown = Unknown.unknown
-
-module type S = sig
-  type elt
-  type 'a t
-  type 'a ts
-
-  type unknown = Unknown.unknown 
-  val unknown : unknown
-
-  val of_list : 'a t list -> 'a ts
-  val of_array : 'a t array -> 'a ts
-  val to_list : 'a ts -> elt list
-  val to_unknown_list : 'a ts -> unknown t list
-  val to_array : 'a ts -> elt array
-  val to_unknown_array : 'a ts -> unknown t array
-  val length : 'a ts -> int
-
-  val (!<) : 'a t -> elt
-  val (!>) : elt -> unknown t
-  val (!?) : 'a t -> unknown t
-  val unsafe : elt -> 'a t
-  val unsafe_list : elt list -> 'a ts
-  val magic : 'a t -> 'b t
-
-  (* This encoding is correct only if the parameter cannot be the unit or a tuple *)
-  val c0 : unit ts
-  val c1 : 'a1 t -> 'a1 ts
-  val c2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) ts
-  val c3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) ts
-  val c4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) ts
-  val c5 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> 'a5 t -> ('a1 * 'a2 * 'a3 * 'a4 * 'a5) ts
-  val c6 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> 'a5 t -> 'a6 t -> ('a1 * 'a2 * 'a3 * 'a4 * 'a5 * 'a6) ts
-  val c7 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> 'a5 t -> 'a6 t -> 'a7 t -> ('a1 * 'a2 * 'a3 * 'a4 * 'a5 * 'a6 * 'a7) ts
-  val c8 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> 'a5 t -> 'a6 t -> 'a7 t -> 'a8 t -> ('a1 * 'a2 * 'a3 * 'a4 * 'a5 * 'a6 * 'a7 * 'a8) ts
-  val c9 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> 'a5 t -> 'a6 t -> 'a7 t -> 'a8 t -> 'a9 t -> ('a1 * 'a2 * 'a3 * 'a4 * 'a5 * 'a6 * 'a7 * 'a8 * 'a9) ts
-  val c10 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> 'a5 t -> 'a6 t -> 'a7 t -> 'a8 t -> 'a9 t -> 'a10 t -> ('a1 * 'a2 * 'a3 * 'a4 * 'a5 * 'a6 * 'a7 * 'a8 * 'a9 * 'a10) ts
-  
-  val d1 : 'a1 ts -> 'a1 t
-  val d2 : ('a1 * 'a2) ts -> 'a1 t * 'a2 t
-  val d3 : ('a1 * 'a2 * 'a3) ts -> 'a1 t * 'a2 t * 'a3 t
-  val d4 : ('a1 * 'a2 * 'a3 * 'a4) ts -> 'a1 t * 'a2 t * 'a3 t * 'a4 t
-  val d5 : ('a1 * 'a2 * 'a3 * 'a4 * 'a5) ts -> 'a1 t * 'a2 t * 'a3 t * 'a4 t * 'a5 t
-  val d6 : ('a1 * 'a2 * 'a3 * 'a4 * 'a5 * 'a6) ts -> 'a1 t * 'a2 t * 'a3 t * 'a4 t * 'a5 t * 'a6 t
-  val d7 : ('a1 * 'a2 * 'a3 * 'a4 * 'a5 * 'a6 * 'a7) ts -> 'a1 t * 'a2 t * 'a3 t * 'a4 t * 'a5 t * 'a6 t * 'a7 t
-  val d8 : ('a1 * 'a2 * 'a3 * 'a4 * 'a5 * 'a6 * 'a7 * 'a8) ts -> 'a1 t * 'a2 t * 'a3 t * 'a4 t * 'a5 t * 'a6 t * 'a7 t * 'a8 t
-  val d9 : ('a1 * 'a2 * 'a3 * 'a4 * 'a5 * 'a6 * 'a7 * 'a8 * 'a9) ts -> 'a1 t * 'a2 t * 'a3 t * 'a4 t * 'a5 t * 'a6 t * 'a7 t * 'a8 t * 'a9 t
-  val d10 : ('a1 * 'a2 * 'a3 * 'a4 * 'a5 * 'a6 * 'a7 * 'a8 * 'a9 * 'a10) ts -> 'a1 t * 'a2 t * 'a3 t * 'a4 t * 'a5 t * 'a6 t * 'a7 t * 'a8 t * 'a9 t * 'a10 t
-end
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.