HORIZON HASKELLDocslts/ghc-10.0.x2b276322026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 2b27632 · 2026-10-31

Moduletransformers-0.6.3.0Haskell2010

Control.Monad.Trans.Select

Selection monad transformer, modelling search algorithms.

Contents
  1. The Select monad
  2. The SelectT monad transformer
  3. Monad transformation
Synopsis

The Select monad

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

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