Commits

Anonymous committed 17a9cff

+ (Array|List|Amall_types).Functor, + Array.Build

Comments (0)

Files changed (3)

 module Test = (IO_Lwt : IO_Type)
 ;
 *)
+
+
+module type FUNCTOR
+ =
+  sig
+    type t 'a;
+    value fmap : ('a -> 'b) -> t 'a -> t 'b;
+  end
+;
     ;
 
 
+    open Amall_types;
+
+    module Functor : FUNCTOR
+     =
+      struct
+        type t 'a = array 'a;
+        value fmap = Array.map;
+      end
+    ;
+
+    module Build
+     :
+      sig
+        type t 'a;
+        value create : unit -> t 'a;
+        value add : 'a -> t 'a -> unit;
+        value get : t 'a -> array 'a;
+      end
+     =
+      struct
+        open ExtQueue;
+        type t 'a = Queue.t 'a;
+        value create = Queue.create;
+        value add = Queue.push;
+        value get = Queue.copy_to_array;
+      end
+    ;
+
   end
 ;
       ]
     ;
 
+
+    open Amall_types;
+
+    module Functor : FUNCTOR
+     =
+      struct
+        type t 'a = list 'a;
+        value fmap = List.map;
+      end
+    ;
+
   end
 ;