Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Fcf.Data.Function
Description
Simple combinators for functions.
Documentation
data ((c :: a) & (d :: a -> Exp b)) (e :: b) infixl 1 Source #
Reverse function application, argument first.
Example
>>>
:kind! Eval ('(True, Nothing) & Fst)
Eval ('(True, Nothing) & Fst) :: Bool = True
data On (d :: b -> b -> Exp c) (e :: a -> Exp b) (f :: a) (g :: a) (h :: c) Source #
Lift a binary function to the domain of a projection.
Example
>>>
:kind! Eval (((&&) `On` Fst) '(True, Nothing) '(False, Just '()))
Eval (((&&) `On` Fst) '(True, Nothing) '(False, Just '())) :: Bool = False
data Bicomap (f :: a -> Exp c) (g :: b -> Exp d) (h :: c -> d -> Exp e) (i :: a) (j :: b) (k :: e) Source #
Pre-compose a binary function with a function for each argument.
Example
>>>
:kind! Eval (Bicomap Fst Pure (||) '(False, Nothing) True)
Eval (Bicomap Fst Pure (||) '(False, Nothing) True) :: Bool = True