Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
- class Alternative f => PointedAlternative f g | f -> g, g -> f where
- someLazy :: PointedAlternative f g => f a -> f (NonEmpty a)
- manyLazy :: PointedAlternative f g => f a -> g [a]
- ascertain :: PointedAlternative f g => a -> f a -> g a
- ascertainA :: PointedAlternative f g => g a -> f a -> g a
- (<|!>) :: PointedAlternative f g => f a -> g a -> g a
- (<!|>) :: PointedAlternative f g => g a -> f a -> g a
- desperately :: PointedAlternative f g => f a -> g a
Documentation
class Alternative f => PointedAlternative f g | f -> g, g -> f where Source #
An alternative functor and something without its empty.
coerceToNonempty .
embed == id
@coerceToNonempty empty == _|_
someLazy
and manyLazy
should be the greatest lower bound of the maximally defined fixpoints of the following equations:
coerceToNonempty, embed
someLazy :: f a -> f (NonEmpty a) Source #
As many as possible, but not none.
manyLazy :: f a -> g [a] Source #
As many as possible.
PointedAlternative [] NonEmpty Source # | |
PointedAlternative Maybe Identity Source # | |
(Functor m, Monad m) => PointedAlternative (MaybeT m) (IdentityT * m) Source # | |
(PointedAlternative f g, MonadPlus f) => PointedAlternative (StateT s f) (StateT s g) Source # | |
someLazy :: PointedAlternative f g => f a -> f (NonEmpty a) Source #
As many as possible, but not none.
manyLazy :: PointedAlternative f g => f a -> g [a] Source #
As many as possible.
ascertain :: PointedAlternative f g => a -> f a -> g a Source #
ascertainA :: PointedAlternative f g => g a -> f a -> g a Source #
(<|!>) :: PointedAlternative f g => f a -> g a -> g a Source #
(<!|>) :: PointedAlternative f g => g a -> f a -> g a Source #
desperately :: PointedAlternative f g => f a -> g a Source #