[Haskell-cafe] monad constraint + record update

Henning Thielemann schlepptop at henning-thielemann.de
Tue Dec 23 22:50:48 EST 2008

Brent Yorgey schrieb:
> On Mon, Dec 22, 2008 at 06:19:07PM +0100, Peter Padawitz wrote:
>> I'd like to define a monad Set for types in the class Eq. But how can the 
>> arguments of Set be constrained when Set is defined as an instance of 
>> Monad? instance Eq a => Monad Set where ... obviously cannot work.
>> Is there a standard update function for fields in data types, something 
>> that OO programmers do with assignments like obj.attr := value ?
>> Peter
> Note there is already a package on Hackage to do exactly this, rmonad.
> http://hackage.haskell.org/cgi-bin/hackage-scripts/package/rmonad

And also

More information about the Haskell-Cafe mailing list