Re: [Haskell] Num is such a fat and greedy class

2006-12-11 Thread Andreas Rossberg
S.M.Kahrs wrote: let data Bar = ... in ... If you allow this you need to be very careful about type equality. When is Bar equal to Bar? If it's inside a recursive function, does each invocation get its own Bar? (In SML the answer is yes.) Not really. In SML the answer used to be a clear

Re: [Haskell] Num is such a fat and greedy class

2006-12-11 Thread S.M.Kahrs
> > let data Bar = ... in ... > > > > If you allow this you need to be very careful about type equality. > When is Bar equal to Bar? > If it's inside a recursive function, does each invocation get its > own Bar? (In SML the answer is yes.) Not really. In SML the answer used to be a clear "

Re: [Haskell] Num is such a fat and greedy class

2006-12-11 Thread Andreas Rossberg
Lennart Augustsson wrote: let data Bar = ... in ... If you allow this you need to be very careful about type equality. When is Bar equal to Bar? If it's inside a recursive function, does each invocation get its own Bar? (In SML the answer is yes.) Can you give an example of how this wou

Re: [Haskell] Num is such a fat and greedy class

2006-12-11 Thread Lennart Augustsson
On Dec 11, 2006, at 03:50 , Johannes Waldmann wrote: let data Bar = ... in ... If you allow this you need to be very careful about type equality. When is Bar equal to Bar? If it's inside a recursive function, does each invocation get its own Bar? (In SML the answer is yes.) If you d

Re: [Haskell] Num is such a fat and greedy class

2006-12-11 Thread Johannes Waldmann
>> class Subtraction a b | a -> b where >> (-) :: a -> a -> b > > If you split them up like this, things like quadRoots take an > unwieldly type signature: [...] ultimately this leads to a style of programming where you have a class Has_f for each function symbol f. then the signature of a

Re: [Haskell] Num is such a fat and greedy class

2006-12-09 Thread David House
On 08/12/06, Dan Weston <[EMAIL PROTECTED]> wrote: The following observations are not new, insightful, or gracious, but I Wouldn't the following be more useful/general? class Subtraction a b | a -> b where (-) :: a -> a -> b If you split them up like this, things like quadRoots take an unwie

Re: [Haskell] Num is such a fat and greedy class

2006-12-08 Thread Lennart Augustsson
Oh, come on. It's not that bad. Just start every module with import Prelude() import MyPrelude that's what I do. There's nothing sacred about the Prelude (except a few things used for special syntax). It just happens to be in scope. -- Lennart On Dec 8, 2006, at 15:04 , Dan We

[Haskell] Num is such a fat and greedy class

2006-12-08 Thread Dan Weston
The following observations are not new, insightful, or gracious, but I was lusting after the innocent +,-,* operators for my own evil ends and was mildly curious why... Num is such a fat and greedy class. If you want to marry Cinderella, you have to take her ugly stepsisters too. 1) Groups m