~ubuntu-branches/ubuntu/vivid/typerep/vivid

« back to all changes in this revision

Viewing changes to extended/lib/tagged_generic.mli

  • Committer: Package Import Robot
  • Author(s): Hilko Bengen
  • Date: 2014-09-24 23:51:02 UTC
  • Revision ID: package-import@ubuntu.com-20140924235102-0qeq851f02otnnxp
Tags: upstream-111.17.00
ImportĀ upstreamĀ versionĀ 111.17.00

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
open Typerep_lib.Std
 
2
 
 
3
module type S = sig
 
4
  type 'a t
 
5
  val of_typestruct : Type_struct.t -> [ `generic of Tagged.t t ]
 
6
end
 
7
 
 
8
module Make_input(Input:sig type t end)
 
9
  (X:Type_generic.Computation with type 'a t = Input.t -> 'a)
 
10
  : S with type 'a t = Input.t -> 'a
 
11
 
 
12
module Make_output(Output:sig type t end)
 
13
  (X:Type_generic.Computation with type 'a t = 'a -> Output.t)
 
14
  : S with type 'a t = 'a -> Output.t
 
15
 
 
16
module Make_reader
 
17
  (Builder:sig type 'a t val make : ('a -> Tagged.t) -> 'a t -> Tagged.t t end)
 
18
  (X:Type_generic.Computation with type 'a t = 'a Builder.t)
 
19
  : S with type 'a t = 'a X.t
 
20
 
 
21
module Make_writer
 
22
  (Builder:sig type 'a t val make : (Tagged.t -> 'a) -> 'a t -> Tagged.t t end)
 
23
  (X:Type_generic.Computation with type 'a t = 'a Builder.t)
 
24
  : S with type 'a t = 'a X.t
 
25
 
 
26
(* Advanced utilisation of [Make] *)
 
27
 
 
28
module type Adapter = sig
 
29
 
 
30
  type 'a t
 
31
  type 'a adapter = 'a t -> Tagged.t t
 
32
 
 
33
  val int        : int adapter
 
34
  val int32      : int32 adapter
 
35
  val int64      : int64 adapter
 
36
  val nativeint  : nativeint adapter
 
37
  val char       : char adapter
 
38
  val bool       : bool adapter
 
39
  val string     : string adapter
 
40
  val float      : float adapter
 
41
  val unit       : unit adapter
 
42
 
 
43
  val option : Tagged.t option adapter
 
44
  val list   : Tagged.t list adapter
 
45
  val array  : Tagged.t array adapter
 
46
  val ref_   : Tagged.t ref adapter
 
47
  val lazy_t : Tagged.t lazy_t adapter
 
48
 
 
49
  val tuple2 : (Tagged.t * Tagged.t) adapter
 
50
  val tuple3 : (Tagged.t * Tagged.t * Tagged.t) adapter
 
51
  val tuple4 : (Tagged.t * Tagged.t * Tagged.t * Tagged.t) adapter
 
52
  val tuple5 : (Tagged.t * Tagged.t * Tagged.t * Tagged.t * Tagged.t) adapter
 
53
end
 
54
 
 
55
module Make_advanced
 
56
  (A:Adapter)
 
57
  (X:Type_generic.Computation with type 'a t = 'a A.t)
 
58
  : S with type 'a t = 'a X.t
 
59
 
 
60
module Input_adapter(Input:sig type t end) : Adapter with type 'a t = Input.t -> 'a
 
61
module Output_adapter(Output:sig type t end) : Adapter with type 'a t = 'a -> Output.t
 
62
module Reader_adapter(Builder:sig
 
63
  type 'a t
 
64
  val make : ('a -> Tagged.t) -> 'a t -> Tagged.t t
 
65
end) : Adapter with type 'a t = 'a Builder.t
 
66
module Writer_adapter(Builder:sig
 
67
  type 'a t
 
68
  val make : (Tagged.t -> 'a) -> 'a t -> Tagged.t t
 
69
end) : Adapter with type 'a t = 'a Builder.t