Commits

camlspotter committed 2474968 Merge

added flip and flipf

Comments (0)

Files changed (3)

 - Added String.is_space_or_tab and String.is_newline_or_return
 - Added Sys.with_chdir
 - Added Result.at_Error
+- Added Base.flipf and Base.filp
 * Largely rewritten Xunix's command/shell execution.
 * Added Shell for the shell command like functions
 * Added labels to At functions.
 
 let (|-) res f = f res; res
 
+let flip f x y = f y x
 let (~~) g ~f = g f
+let flipf = (~~)
 val (|-) : 'a -> ('a -> 'b) -> 'a
 (** "tee". [v |-- f] is [v] but [f v] is run before [v] is returned *)
 
+val flip : ('a -> 'b -> 'c) -> 'b -> 'a -> 'c
+(** [flip] of Haskell *)
+
 val (~~) : ('a -> 'b) -> f:'a -> 'b
+val flipf : ('a -> 'b) -> f:'a -> 'b
 (** Super [flip] of Haskell. The first argument is labeled and becomes commutative. *)
 
 (** {6 Imperative operations } *)