Commits

camlspotter committed 718bb51

comments

Comments (0)

Files changed (2)

-(** Stream module extention for memoization *)
+(** Stream module extention for memoization 
+
+    This module is very preliminary.
+*)
 
 (** Extend(Base) extends Base with memoization over each stream element.
     Typical usage is:
 *)
 
 type memo_result = (Obj.t, exn) Result.t
-    
+(** Type unsafe representation of generic memoization table *)
+
 module Extend(Base : sig
   include Stream_intf.S
-  module Memo : Hashtbl.S
+  module Memo : Hashtbl.S (** Memo is hashtable *)    
   val memo : t -> memo_result Memo.t
+  (** Memo table must be attached to each stream position, and it must be retrievable. *)    
 end) : sig
   open Base
   val memoize : Memo.key -> (t -> 'a) -> t -> 'a
+  (** [memoize key f] creates memoized version of function [f] with [key]. 
+      Function identification is not by the pointer equality of functions, but keys.
+  *)
 end
-(** Positionless string stream (not char stream), used for Sbuffer *)
+(** Positionless string stream (not char stream), used for Sbuffer 
+
+    It is to implement Sbuffer, and not for casual use.
+*)
 
 include Stream_intf.S
   with type elem = string