[Haskell-cafe] Re: Adding Ord constraint to instance Monad Set?

2004-04-01 Thread John Hughes


| Constraints on datatype declarations are a misfeature of Haskell, and
| have no useful effect.
| 
| Is this the final conclusion?

Yes, it is, I believe.  Constraints on data type declarations are a
mis-feature.  I tried to get them removed, but there was some argument
that they could be made useful (see John Hughes's paper Restricted data
types in Haskell, Haskell workshop 1999), and they stayed. 

Simon

 

Made useful in a way that would solve the problem in this thread, I 
might add. The paper is at

	http://www.cs.chalmers.se/~rjmh/Papers/restricted-datatypes.ps

for the curious.

John

___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Adding Ord constraint to instance Monad Set?

2004-04-01 Thread S. Alexander Jacobson
On Wed, 31 Mar 2004, Tomasz Zielonka wrote:
 You can try to define a different version of Monad using multiparameter
 type classes, something like:

 class M m a b where
   (=) :: m a - (a - m b) - m b

I don't think this works.  GHC can't deduce
context for ().  I don't understand why, but
I've tried a variety of permutations of
constraint declarations (m b needs to be a Monad
as well...).

-Alex-

_
S. Alexander Jacobson  mailto:[EMAIL PROTECTED]
tel:917-770-6565   http://alexjacobson.com
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe