> >>>>> "Fergus" == Fergus Henderson <[EMAIL PROTECTED]> writes:
>
> Fergus> Basically there is no way to do this in Haskell. About the
> Fergus> best you can do is to create your own `EqMonad' class, which is
> Fergus> like `Monad' except that it has an `Eq a' constraint on the
> Fergus> type variable. Then use `EqMonad' instead of `Monad'. You
> Fergus> can't use the `do' syntax, and you can't reuse the library
> Fergus> routines that work on Monads.
>
> Ok, thanks, I can redo the do. But this does strike me as a flaw in the
> language. What would the ramifications be for an accomodation as such? Surely
> not so drastic as the dependent type thingy.
John Hughes <http://www.cs.chalmers.se/~rjmh> has presented a paper
'Restricted Datatypes in Haskell' on this subject for the '99 Haskell
Workshop. The full proceedings can be found at
<http://www.cs.uu.nl/~erik/Publications/1999-28.pdf>
(the paper itself might be at Chalmers, but the site seems to be
down...)
Hope this helps,
Jan de Wit