User loginNavigation |
Multiple overloads of the bind operatorHi! Let's say it makes a lot of sense in my domain to define the types WriteReference and ReadOnlyReference. I wish to create a monad that manipulates references, so my first idea was to define
It looks ugly but it does its job, even though I fear it won't play nice with Haskell syntactic sugar for monads. Does it make more sense to define Reference as a class, and then to define WriteReference and ReadOnlyReference as instances of this class, so that we can write something like:
Can anyone help me understand why I should favor one approach over the other? Thanks By giuseppemag at 2010-03-08 11:28 | LtU Forum | previous forum topic | next forum topic | other blogs | 4934 reads
|
Browse archives
Active forum topics |
Recent comments
4 weeks 4 days ago
44 weeks 5 days ago
44 weeks 6 days ago
44 weeks 6 days ago
1 year 14 weeks ago
1 year 19 weeks ago
1 year 20 weeks ago
1 year 20 weeks ago
1 year 23 weeks ago
1 year 28 weeks ago