Initial packaging
[pkg-ocaml-deriving-ocsigen.git] / lib / deriving_Typeable.mli
blob78a819d6edc2cb753a621d6a5a94debea5e2bbae
1 module TypeRep :
2 sig
3 type t
4 type delayed = unit -> t
5 val compare : t -> t -> int
6 val eq : t -> t -> bool
7 val mkFresh : string -> delayed list -> delayed
8 val mkTuple : delayed list -> delayed
9 val mkPolyv : (string * delayed option) list -> delayed list -> delayed
10 end
12 exception CastFailure of string
14 type dynamic
15 val tagOf : dynamic -> TypeRep.t
17 module type Typeable =
18 sig
19 type a
20 val type_rep : unit -> TypeRep.t
21 val has_type : dynamic -> bool
22 val cast : dynamic -> a option
23 val throwing_cast : dynamic -> a
24 val make_dynamic : a -> dynamic
25 val mk : a -> dynamic
26 end
28 module Defaults (T : (sig
29 type a
30 val type_rep : unit -> TypeRep.t
31 end))
32 : Typeable with type a = T.a
34 module Typeable_list (A : Typeable) : Typeable with type a = A.a list
35 module Typeable_option (A : Typeable) : Typeable with type a = A.a option
36 module Typeable_ref (A : Typeable) : Typeable with type a = A.a ref
38 (*module Primitive_typeable (T : sig type t end): Typeable with type a = T.t *)
40 module Typeable_unit : Typeable with type a = unit
41 module Typeable_int : Typeable with type a = int
42 module Typeable_num : Typeable with type a = Num.num
43 module Typeable_float : Typeable with type a = float
44 module Typeable_bool : Typeable with type a = bool
45 module Typeable_string : Typeable with type a = string
46 module Typeable_char : Typeable with type a = char
47 module Typeable_int32 : Typeable with type a = int32
48 module Typeable_int64 : Typeable with type a = int64
49 module Typeable_nativeint : Typeable with type a = nativeint