Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Simple combinators for functions.
Documentation
data (&) :: a -> (a -> Exp b) -> Exp b infixl 1 Source #
Reverse function application, argument first.
Example
>>>
:kind! Eval ('( 'True, 'Nothing) & Fst)
Eval ('( 'True, 'Nothing) & Fst) :: Bool = 'True
data On :: (b -> b -> Exp c) -> (a -> Exp b) -> a -> a -> Exp 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 :: (a -> Exp c) -> (b -> Exp d) -> (c -> d -> Exp e) -> a -> b -> Exp 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