1. Dmitry Grebeniuk
  2. cadastr

Commits

Dmitry Grebeniuk  committed a9f2c93

+Cdt.FUNCTOR, +(List : FUNCTOR)

  • Participants
  • Parent commits f513aa4
  • Branches default

Comments (0)

Files changed (3)

File src/cd_List.ml

View file
            ]
     ;
 
+
+    (* [List] module's lists are functors, so let [List] match
+       the signature [Cdt.FUNCTOR]: *)
+
+    value fmap = map;
+
   end
 ;

File src/cdt.ml

View file
  : !'a . ~t:(#t 'a) -> 'a -> string
  = fun ~t -> t#topt#show
 ;
+
+
+(***************************************************************)
+
+module type FUNCTOR
+ =
+  sig
+    type t 'a;
+    value fmap : ('a -> 'b) -> (t 'a -> t 'b);
+  end
+;

File test/test.ml

View file
   run_test_tt_main suite
 ;
 
+
+module List_is_a_functor = (List : FUNCTOR);