[Haskell-cafe] Re: Search monad
apfelmus at quantentunnel.de
Tue Mar 20 11:34:33 EDT 2007
Edsko de Vries wrote:
> I have a structure containing Xs in various places, like so
> data X
> data Structure = Structure .. [X] .. [X] ..
> And I defined mapStructure
> mapStructure :: (X -> X) -> (Structure -> Structure)
> I then wanted to use mapStructure to define queries as well as
> transformations on structures. I generalized mapStructure to
> mapStructure :: Monad m => (X -> m X) -> (Structure -> m Structure)
I guess you want an applicative functor. See also
and the accompanying papers.
More information about the Haskell-Cafe