Use a more idiomatic creator name.
authorSiraaj Khandkar <siraaj@khandkar.net>
Fri, 27 Sep 2013 02:01:19 +0000 (22:01 -0400)
committerSiraaj Khandkar <siraaj@khandkar.net>
Fri, 27 Sep 2013 02:01:19 +0000 (22:01 -0400)
polymorphic-life/001/src/polymorphic_life.ml

index 544136c..b93a79d 100644 (file)
@@ -59,7 +59,7 @@ end
 module type CELL = sig
   type t
 
-  val init : unit -> t
+  val create : unit -> t
 
   val to_string : t -> string
 
@@ -85,7 +85,7 @@ module Conway : CELL = struct
     | D -> " "
     | A -> "o"
 
-  let init () =
+  let create () =
     Random.int 2 |> of_int
 
   let state = to_int
@@ -104,7 +104,7 @@ end
 
 let main rows cols () =
   Random.self_init ();
-  let grid = Matrix.create ~rows ~cols ~data:() |> Matrix.map ~f:Conway.init in
+  let grid = Matrix.create ~rows ~cols ~data:() |> Matrix.map ~f:Conway.create in
   Matrix.print grid ~to_string:Conway.to_string
 
 
This page took 0.025186 seconds and 4 git commands to generate.