HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduletransformers-0.6.1.1Haskell2010

Control.Monad.Trans.Select

Selection monad transformer, modelling search algorithms.

  • 2 types
  • 6 values

The Select monad

4 declarations
valueselect :: ((a -> r) -> a) -> Select r a
#

Constructor for computations in the selection monad.

valuerunSelect :: Select r a -> (a -> r) -> a
#

Runs a Select computation with a function for evaluating answers to select a particular answer. (The inverse of select.)

The SelectT monad transformer

3 declarations
newtypenewtype SelectT r (m :: Type -> Type) a
#

Selection monad transformer.

SelectT is not a functor on the category of monads, and many operations cannot be lifted through it.

Constructors

Instances10MonadTrans, Monad, Functor, MonadFail, Applicative, Alternative, …
valuerunSelectT :: SelectT r m a -> (a -> m r) -> m a
#

Runs a SelectT computation with a function for evaluating answers to select a particular answer. (The inverse of select.)

valuemapSelectT :: (m a -> m a) -> SelectT r m a -> SelectT r m a
#

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.

Monad transformation

1 declaration