Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Common algebras that are useful when folding.
Synopsis
- lowerMonoid :: Monoid m => (a -> m) -> XNor a m -> m
- lowerSemigroup :: Semigroup m => (a -> m) -> AndMaybe a m -> m
- lowerMonad :: Monad m => (forall a. f a -> m a) -> FreeF f a (m a) -> m a
- equal :: (Functor f, Foldable f, Eq1 f) => Day f f Bool -> Bool
- height :: Foldable f => f Integer -> Integer
- size :: Foldable f => f Natural -> Natural
- toRight :: Identity b -> Either a b
- while :: (a -> Maybe a) -> a -> Either a a
- fromEither :: Either a a -> a
- never :: a -> Identity a
- le :: Day Maybe Maybe Bool -> Bool
- takeAnother :: Day Maybe ((,) a) b -> XNor a b
- takeAvailable :: Day Maybe (XNor a) b -> XNor a b
- truncate' :: Functor f => Day Maybe f a -> FreeF f () a
- split :: a -> (a, a)
- unarySequence :: (a -> b) -> a -> (a, b)
- binarySequence :: (a -> b -> c) -> (a, b) -> (a, (b, c))
- ternarySequence :: (a -> b -> c -> d) -> (a, b, c) -> (a, (b, c, d))
- lucasSequence' :: Integral i => i -> i -> (i, i) -> (i, (i, i))
Documentation
lowerMonoid :: Monoid m => (a -> m) -> XNor a m -> m Source #
Converts the free monoid (a list) into some other monoid.
lowerSemigroup :: Semigroup m => (a -> m) -> AndMaybe a m -> m Source #
Converts the free semigroup (a non-empty list) into some other semigroup.
lowerMonad :: Monad m => (forall a. f a -> m a) -> FreeF f a (m a) -> m a Source #
height :: Foldable f => f Integer -> Integer Source #
When folded, returns the height of the data structure.
size :: Foldable f => f Natural -> Natural Source #
When folded, returns the number ef nodes in the data structure.
fromEither :: Either a a -> a Source #
Converts a single value into a tuple with the same value on both sides. > x &&& y = (x *** y) . split
sequence generators
unarySequence :: (a -> b) -> a -> (a, b) Source #
binarySequence :: (a -> b -> c) -> (a, b) -> (a, (b, c)) Source #
ternarySequence :: (a -> b -> c -> d) -> (a, b, c) -> (a, (b, c, d)) Source #
lucasSequence' :: Integral i => i -> i -> (i, i) -> (i, (i, i)) Source #