RE: [Haskell-cafe] RealFloat constraint on Complex type

2008-05-21 Thread Bayley, Alistair
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Richard A. O'Keefe On 21 May 2008, at 9:25 am, Conal Elliott wrote: I think the practice of constraint in type definitions is generally discouraged, Is this true? If so, why? If I have a data type that simply

[Haskell-cafe] RealFloat constraint on Complex type

2008-05-20 Thread Conal Elliott
GHC's (maybe Haskell98's?) Complex type is defined with a RealFloat constraint on type type itself, rather than on some of the instances and functions: data (RealFloat a) = Complex a = !a :+ !a I think the practice of constraint in type definitions is generally discouraged, and I'm

Re: [Haskell-cafe] RealFloat constraint on Complex type

2008-05-20 Thread Richard A. O'Keefe
On 21 May 2008, at 9:25 am, Conal Elliott wrote: I think the practice of constraint in type definitions is generally discouraged, Is this true? If so, why? If I have a data type that simply doesn't make sense unless some of the type variables belong to certain classes, _shouldn't_ that be