pointedalternative-0.1.0.0: Alternative done right

Safe HaskellSafe
LanguageHaskell2010

Control.Alternative.Pointed

Synopsis

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:

  • someLazy v = (:) <$> v <*> manyLazy v@
  • manyLazy v = someLazy v <|> pure []@

Minimal complete definition

coerceToNonempty, embed

Methods

someLazy :: f a -> f (NonEmpty a) Source #

As many as possible, but not none.

manyLazy :: f a -> g [a] Source #

As many as possible.

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 #