Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
- (.*) :: (c -> d) -> (a -> b -> c) -> a -> b -> d
- (.**) :: (d -> e) -> (a -> b -> c -> d) -> a -> b -> c -> e
- (.***) :: (e -> f) -> (a -> b -> c -> d -> e) -> a -> b -> c -> d -> f
- (.****) :: (f -> g) -> (a -> b -> c -> d -> e -> f) -> a -> b -> c -> d -> e -> g
- (-.) :: (a -> b) -> (b -> c) -> a -> c
- (-.*) :: (b -> c) -> (a -> c -> d) -> a -> b -> d
- (-.**) :: (c -> d) -> (a -> b -> d -> e) -> a -> b -> c -> e
- (-.***) :: (d -> e) -> (a -> b -> c -> e -> f) -> a -> b -> c -> d -> f
- (-.****) :: (e -> f) -> (a -> b -> c -> d -> f -> g) -> a -> b -> c -> d -> e -> g
- (-$) :: (a -> b -> c) -> b -> a -> c
- bisequence' :: (Traversable t, Monad m) => t (a -> b -> m c) -> a -> b -> t (m c)
- axe :: (Traversable t, Monad m) => t (a -> m ()) -> a -> m ()
- biaxe :: (Traversable t, Monad m) => t (a -> b -> m ()) -> a -> b -> m ()
- thread :: [a -> a] -> a -> a
- both :: (a -> b) -> (a, a) -> (b, b)
- (<&>) :: Functor f => f a -> (a -> b) -> f b
- (&) :: a -> (a -> b) -> b
- fix :: (a -> a) -> a
- on :: (b -> b -> c) -> (a -> b) -> a -> a -> c
- ap :: Monad m => m (a -> b) -> m a -> m b
- bool :: a -> a -> Bool -> a
Postcomposition
(.*) :: (c -> d) -> (a -> b -> c) -> a -> b -> d infixr 8 Source #
As an example:
λ:> ((*2) .* (+)) 1 3 4 16
Precomposition
(-.****) :: (e -> f) -> (a -> b -> c -> d -> f -> g) -> a -> b -> c -> d -> e -> g infixr 8 Source #
Fancy function application
Monadic helpers
bisequence' :: (Traversable t, Monad m) => t (a -> b -> m c) -> a -> b -> t (m c) Source #
Monadic actions
axe :: (Traversable t, Monad m) => t (a -> m ()) -> a -> m () Source #
biaxe :: (Traversable t, Monad m) => t (a -> b -> m ()) -> a -> b -> m () Source #
Composition with lists of functions
Tuple helpers
Functor helpers
Reexports from base
is the least fixed point of the function fix
ff
,
i.e. the least defined x
such that f x = x
.
Case analysis for the Bool
type.
evaluates to bool
x y px
when p
is False
, and evaluates to y
when p
is True
.
This is equivalent to if p then y else x
; that is, one can
think of it as an if-then-else construct with its arguments
reordered.
Examples
Basic usage:
>>>
bool "foo" "bar" True
"bar">>>
bool "foo" "bar" False
"foo"
Confirm that
and bool
x y pif p then y else x
are
equivalent:
>>>
let p = True; x = "bar"; y = "foo"
>>>
bool x y p == if p then y else x
True>>>
let p = False
>>>
bool x y p == if p then y else x
True
Since: 4.7.0.0