[Haskell-cafe] Replacing [a] with (Set c a) in Monad instance.

Daniel McAllansmith dm.maillists at gmail.com
Tue Jan 30 23:58:37 EST 2007

On Wednesday 31 January 2007 22:36, Robert Dockins wrote:
> On Tuesday 30 January 2007 20:06, Bryan Donlan wrote:
> If you instead want to replace your list with one of the Edison sequence
> implementations, that should be possible.  However, I'm not really sure
> that it's going to buy you a lot.  From a quick glance, it looks like the
> regular list type is going to be the best datastructure for the
> computational pattern of this monad, as long as your computations are
> sufficiently lazy.

Currently some external code is not lazy so the stack gets blown.  My 
knee-jerk reaction was to try and reduce the state space by exploiting 
symmetries.  I'll try sticking with the list and making things more lazy, and 
hopefully still be able to collapse the symmetric cases.

> > However, Roberto Zunino
> > came up with a clever way to bypass this problem with GADTS:
> > http://article.gmane.org/gmane.comp.lang.haskell.cafe/18118
> >
> > You may be able to apply this to your situation, using various Edison
> > collections depending on which typeclasses your monad argument
> > implements.

Thanks for the links, I'll have a look at them if I have no luck with 
increasing the laziness.


More information about the Haskell-Cafe mailing list