[Haskell-cafe] Still stacking monad transformers

wren ng thornton wren at freegeek.org
Sun Oct 12 16:54:09 EDT 2008


David Menendez wrote:
> On Sun, Oct 12, 2008 at 1:08 PM, Andrew Coppin
> <andrewcoppin at btinternet.com> wrote:
>> I am becoming extremely frustrated now. The task I want to perform is
>> simple, yet I simply cannot make Haskell do what I want.
>>
>> I've given up hope of ever getting my program to handle infinite result sets.
> 
> Did you miss this message?
> 
> <http://article.gmane.org/gmane.comp.lang.haskell.cafe/45952/>

And if you don't like that one, there's also LogicT 
<http://hackage.haskell.org/cgi-bin/hackage-scripts/package/logict>. The 
function you're looking for is called Control.Monad.Logic.interleave. I 
know LogicT and fair disjunction were brought up earlier, though I seem 
to have mislaid the post.

In case you don't like the efficient Logic or LogicT implementations of 
MonadLogic, defining your own only requires that you can define msplit 
:: m a -> m (Maybe (a, m a)) which pulls the first content out of your 
monad without forcing the rest of it.


-- 
Live well,
~wren


More information about the Haskell-Cafe mailing list