camlspotter avatar camlspotter committed 29c32a0

bug fix

Comments (0)

Files changed (2)

 
 let rec fold_left f st t = lazy (match t with
   | lazy Null -> !!st
-  | lazy (Cons (v, t)) -> !! (fold_left f (f v st) t))
+  | lazy (Cons (v, t)) -> !!(fold_left f (f st v) t))
 
-let rev t = fold_left (^:) null t
+let rev t = fold_left (fun st x -> x ^: st) null t
 
 let intersparse a t = lazy (match t with
   | lazy Null -> Null
 
 val length : 'a t -> int
 val map : ('a -> 'b) -> 'a t -> 'b t
-val fold_left : ('a -> 'b Lazy.t -> 'b Lazy.t) -> 'b Lazy.t -> 'a t -> 'b Lazy.t
+val fold_left : ('a lazy_t -> 'b -> 'a lazy_t) -> 'a lazy_t -> 'b t -> 'a lazy_t
 val fold_left1 : ('a lazy_t -> 'a lazy_t -> 'a lazy_t) -> 'a lazy_t t -> 'a lazy_t
 val fold_right : ('a -> 'b lazy_t -> 'b lazy_t) -> 'a t -> 'b lazy_t -> 'b lazy_t
 val fold_left' : ('a -> 'b -> 'b) -> 'b -> 'a t -> 'b
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.