transformers-0.5.5.0: Concrete functor and monad transformers

Copyright (c) Ross Paterson 2017 BSD-style (see the file LICENSE) R.Paterson@city.ac.uk experimental portable Safe Haskell98

Description

Selection monad transformer, modelling search algorithms.

Synopsis

# The Select monad

type Select r = SelectT r Identity Source #

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.

• runSelect (mapSelect f m) = f . runSelect m

# The SelectT monad transformer

newtype SelectT r m a Source #

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

Constructors

 SelectT ((a -> m r) -> m a)
Instances

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

Deprecated name for selectToContT.