| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Control.Monad.Prospect
Synopsis
- prospect :: (Functor f, Generic1 f, GExplore f (Rep1 f)) => Free f a -> (Maybe a, [f ()])
- survey :: Functor f => (forall b. f (Free f b) -> Free f b) -> Free f a -> (Maybe a, [f ()])
- explore :: forall f a. (Generic1 f, GExplore f (Rep1 f)) => f a -> a
- guess :: a
- given :: Alternative f => (a -> f b) -> a -> f b
- verify :: Alternative f => a -> f a
- ensure :: (Alternative f, NFData a) => a -> f a
- proceed :: (Alternative f, NFData a) => (a -> f b) -> a -> f b
- data Guess = Guess
Prospecting of free monads
prospect :: (Functor f, Generic1 f, GExplore f (Rep1 f)) => Free f a -> (Maybe a, [f ()]) Source #
Perform a best-effort analysis of a free monad by automatically
exploreing it.
Arguments
| :: Functor f | |
| => (forall b. f (Free f b) -> Free f b) | The following function. Consider using |
| -> Free f a | |
| -> (Maybe a, [f ()]) |
Perform a best-effort analysis of a free monad.
Guesswork
given :: Alternative f => (a -> f b) -> a -> f b Source #
verify :: Alternative f => a -> f a Source #
proceed :: (Alternative f, NFData a) => (a -> f b) -> a -> f b Source #
Like given, but much stricter.
The underlying machinery of guess.
Constructors
| Guess |
Instances
| Eq Guess Source # | |
| Show Guess Source # | |
| Exception Guess Source # | |
Defined in Control.Monad.Prospect Methods toException :: Guess -> SomeException # fromException :: SomeException -> Maybe Guess # displayException :: Guess -> String # | |