Copyright | (c) Ross Paterson 2017 |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | [email protected] |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell98 |
Selection monad transformer, modelling search algorithms.
type Select r = SelectT r Identity Source
Selection monad.
select :: ((a -> r) -> a) -> Select r a Source
Constructor for computations in the selection monad.
runSelect :: Select r a -> (a -> r) -> a Source
Runs a Select
computation with a function for evaluating answers to select a particular answer. (The inverse of select
.)
mapSelect :: (a -> a) -> Select r a -> Select r a Source
Apply a function to transform the result of a selection computation.
Selection monad transformer.
SelectT
is not a functor on the category of monads, and many operations cannot be lifted through it.
SelectT ((a -> m r) -> m a) |
MonadTrans (SelectT r) | |
Defined in Control.Monad.Trans.Select | |
Monad m => Monad (SelectT r m) | |
Functor m => Functor (SelectT r m) | |
MonadFail m => MonadFail (SelectT r m) | |
Defined in Control.Monad.Trans.Select | |
(Functor m, Monad m) => Applicative (SelectT r m) | |
Defined in Control.Monad.Trans.Select Methodspure :: a -> SelectT r m a Source (<*>) :: SelectT r m (a -> b) -> SelectT r m a -> SelectT r m b Source liftA2 :: (a -> b -> c) -> SelectT r m a -> SelectT r m b -> SelectT r m c Source (*>) :: SelectT r m a -> SelectT r m b -> SelectT r m b Source (<*) :: SelectT r m a -> SelectT r m b -> SelectT r m a Source | |
MonadIO m => MonadIO (SelectT r m) | |
Defined in Control.Monad.Trans.Select | |
(Functor m, MonadPlus m) => Alternative (SelectT r m) | |
MonadPlus m => MonadPlus (SelectT r m) | |
runSelectT :: SelectT r m a -> (a -> m r) -> m a Source
Runs a SelectT
computation with a function for evaluating answers to select a particular answer. (The inverse of select
.)
mapSelectT :: (m a -> m a) -> SelectT r m a -> SelectT r m a Source
Apply a function to transform the result of a selection computation. This has a more restricted type than the map
operations for other monad transformers, because SelectT
does not define a functor in the category of monads.
runSelectT (mapSelectT f m) = f . runSelectT m
selectToContT :: Monad m => SelectT r m a -> ContT r m a Source
Convert a selection computation to a continuation-passing computation.
selectToCont :: Monad m => SelectT r m a -> ContT r m a Source
Deprecated: Use selectToContT instead
Deprecated name for selectToContT
.
© The University of Glasgow and others
Licensed under a BSD-style license (see top of the page).
https://downloads.haskell.org/~ghc/8.8.3/docs/html/libraries/transformers-0.5.6.2/Control-Monad-Trans-Select.html