If you also read the rest of that thread, you'll see that with a recent
GHC HEAD, you should be able to avoid the need for the Teq witness.
http://www.cs.chalmers.se/~rjmh/Papers/restricted-datatypes.ps
here is solution which doesn't require GADT and HEAD, but it does
require changing of
Hi,
I'm pondering, is it possible to define a Set monad analogous to the
List monad?
My thinking is as follows:
* fmap f x would apply f to each element in a set x
* return x would create a singleton set {x}
* join x, where x is a set of sets: x = {x1, x2, ... xn},
would form
Ronald Guida:
I'm pondering, is it possible to define a Set monad analogous to the
List monad?
[snip]
This leads me think of a different solution: What if I could define a
Set monad that's smart enough to know, for any type a, whether or
not (Eq a) holds, and degenerate to a blind list if