[Haskell-cafe] Monad instance for Data.Set

Ganesh Sittampalam ganesh at earth.li
Tue Mar 25 18:10:50 EDT 2008


On Tue, 25 Mar 2008, Ryan Ingram wrote:

> I was experimenting with Prompt today and found that you can get a
> "restricted monad" style of behavior out of a regular monad using Prompt:

I recently developed a similar trick: 
http://hsenag.livejournal.com/11803.html

It uses the regular MonadPlus rather than a custom mplus/mzero, and should 
work for any restricted monad. Your "mrestrict" is "Embed . unEmbed" in my 
code (and should be given a shorter name, like "reEmbed"). Of course, 
mplus and mzero can't optimise, since they don't have an Ord constraint.

Cheers,

Ganesh


More information about the Haskell-Cafe mailing list