Commits

camlspotter  committed d4c5be2

introduced (&) for haskells $

  • Participants
  • Parent commits 1ab9b54

Comments (0)

Files changed (2)

     Hashtbl.replace cache v r;
     r
 
-let (^.) f g = fun x -> f (g x)
-let (^$) f x = f x
-let (^$$) g f = g ~f;;
+let (&.) f g = fun x -> f (g x)
+let (^.) = (&.)
+let (&) f x = f x
+let (&~) g f = g ~f;;
+let (^$) = (&)
+let (^$$) = (&~)
 let (|!) e f = f e
 let (|>) e f = f e
 

File lib/base.mli

 val memoize : ('c -> 'd) -> 'c -> 'd
 
 val (^.) : ('b -> 'c) -> ('a -> 'b) -> ('a -> 'c)
+val (&.) : ('b -> 'c) -> ('a -> 'b) -> ('a -> 'c)
   (** funciton composition: Haskell's (.) *)
+
+val (&) : ('a -> 'b) -> 'a -> 'b
 val (^$) : ('a -> 'b) -> 'a -> 'b
+val (&~) : (f:'a -> 'b) -> 'a -> 'b
 val (^$$) : (f:'a -> 'b) -> 'a -> 'b
   (** Haskell's ($) *)
+
 val (|!) : 'a -> ('a -> 'b) -> 'b
 val (|>) : 'a -> ('a -> 'b) -> 'b
   (** F#'s (|>) *)