1. james woodyatt
  2. oni

Commits

jhwoodyatt  committed 37fde9b

Submit cf-0.1 release.

  • Participants
  • Parent commits 3e3834e
  • Branches default

Comments (0)

Files changed (4)

File cf/cf_cmonad.ml

View file
 (*---------------------------------------------------------------------------*
   IMPLEMENTATION  cf_cmonad.ml
 
-  Copyright (c) 2002, James H. Woodyatt
+  Copyright (c) 2002-2004, James H. Woodyatt
   All rights reserved.
 
   Redistribution and use in source and binary forms, with or without
 let cont f g = f (g ())
 let eval m x = m (fun () -> x)
 
-open Op
-
-let accumulate =
-    let rec loop stack seq =
-        match Lazy.force seq with
-        | Cf_seq.P (hd, tl) -> hd >>= fun x -> loop (x :: stack) tl
-        | Cf_seq.Z -> return (List.rev stack)
-    in
-    fun s -> loop [] s
-
-let rec sequence s =
-    match Lazy.force s with
-    | Cf_seq.P (hd, tl) -> hd >>= fun _ -> sequence tl
-    | Cf_seq.Z -> return ()
-
 (*--- End of File [ cf_cmonad.ml ] ---*)

File cf/cf_cmonad.mli

View file
 (*---------------------------------------------------------------------------*
   INTERFACE  cf_cmonad.mli
 
-  Copyright (c) 2002, James H. Woodyatt
+  Copyright (c) 2002-2004, James H. Woodyatt
   All rights reserved.
 
   Redistribution and use in source and binary forms, with or without
 *)
 val eval: ('x, unit) t -> 'x -> 'x
 
-(** Use [accumulate seq] to produce a monad that evaluates a sequence of monads
-    [seq], gathers all their intermediate results and returns them all in a
-    list (in the same order as the sequence).
-*)
-val accumulate: ('x, 'a) t Cf_seq.t -> ('x, 'a list) t
-
-(** Use [sequence seq] to produce a monad that evaluates a sequence of monads
-    [seq] and discards all the intermediate results.
-*)
-val sequence: ('x, 'a) t Cf_seq.t -> ('x, unit) t
-
 (*--- End of File [ cf_cmonad.mli ] ---*)

File cf/cf_common_p.c

View file
 /*---------------------------------------------------------------------------*
   C MODULE  cf_common_p.c
 
-  Copyright (c) 2002, James H. Woodyatt
+  Copyright (c) 2002-2004, James H. Woodyatt
   All rights reserved.
 
   Redistribution and use in source and binary forms, with or without

File cf/cf_common_p.h

View file
 /*---------------------------------------------------------------------------*
   C HEADER  cf_common_p.h
 
-  Copyright (c) 2002, James H. Woodyatt
+  Copyright (c) 2002-2004, James H. Woodyatt
   All rights reserved.
 
   Redistribution and use in source and binary forms, with or without