HORIZON HASKELLDocslts/ghc-10.0.xaa25b892026-10-10Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · aa25b89 · 2026-10-10

Moduletransformers-0.6.3.0Haskell2010

Control.Monad.Trans.Select

Selection monad transformer, modelling search algorithms.

  • 2 types
  • 5 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

2 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.

SelectT r m is strict if and only if m is.

Constructors

  • SelectT
    • runSelectT :: (a -> m r) -> m a

      Runs a SelectT computation with a function for evaluating answers to select a particular answer.

Instances10MonadTrans, Monad, Functor, MonadFail, Applicative, Alternative, …
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