RE: Primitive types and Prelude shenanigans

2001-02-28 Thread Simon Peyton-Jones
| Why not just let | | if x then y else z | | be syntactic sugar for | | Prelude.ifThenElse x y z The burden of my original message was that a) this is reasonable, but b) it would have to become the *defined behaviour* As you say, the "defined behaviour" would have to cover guards as

Re: Primitive types and Prelude shenanigans

2001-02-27 Thread Dylan Thurston
On Fri, Feb 16, 2001 at 05:13:10PM +, Marcin 'Qrczak' Kowalczyk wrote: Fri, 16 Feb 2001 04:14:24 -0800, Simon Peyton-Jones [EMAIL PROTECTED] pisze: Here I think the right thing is to say that desugaring for boolean constructs uses a function 'if' assumed to have type if ::

Re: Primitive types and Prelude shenanigans

2001-02-21 Thread Fergus Henderson
On 21-Feb-2001, Marcin 'Qrczak' Kowalczyk [EMAIL PROTECTED] wrote: Wed, 21 Feb 2001 12:55:37 +1100, Fergus Henderson [EMAIL PROTECTED] pisze: The documentation in the Haskell report does not say what `fromInteger' should do for `Int', but the Hugs behaviour definitely seems preferable,

Re: Primitive types and Prelude shenanigans

2001-02-16 Thread William Lee Irwin III
William Lee Irwin III [EMAIL PROTECTED] pisze: literal "0" gets mapped to zero :: AdditiveMonoid t = t literal "1" gets mapped to one :: MultiplicativeMonoid t = t literal "5" gets mapped to (fromPositiveInteger 5) literal "-9" gets mapped to (fromNonZeroInteger -9) On

Re: Primitive types and Prelude shenanigans

2001-02-16 Thread Marcin 'Qrczak' Kowalczyk
Fri, 16 Feb 2001 04:14:24 -0800, Simon Peyton-Jones [EMAIL PROTECTED] pisze: [Incidentally, if this is nhc's behaviour, it's not H98. The Report (tries to) stress that you get the "fromInt from the actual standard Prelude" regardless of what is in scope. That's why I'm not going to make it

Re: Primitive types and Prelude shenanigans

2001-02-16 Thread Marcin 'Qrczak' Kowalczyk
Thu, 15 Feb 2001 20:56:20 -0800, William Lee Irwin III [EMAIL PROTECTED] pisze: literal "5" gets mapped to (fromPositiveInteger 5) literal "-9" gets mapped to (fromNonZeroInteger -9) Note that when a discussed generic Prelude replacement framework is done, and ghc's rules are

Re: Primitive types and Prelude shenanigans

2001-02-16 Thread William Lee Irwin III
William Lee Irwin III [EMAIL PROTECTED] pisze: literal "5" gets mapped to (fromPositiveInteger 5) literal "-9" gets mapped to (fromNonZeroInteger -9) On Fri, Feb 16, 2001 at 05:42:17PM +, Marcin 'Qrczak' Kowalczyk wrote: Note that when a discussed generic Prelude replacement

Re: Primitive types and Prelude shenanigans

2001-02-15 Thread William Lee Irwin III
On Wed, Feb 14, 2001 at 02:19:39PM -0800, Simon Peyton-Jones wrote: The most immediate and painful stumbling block in Haskell 98 is that numeric literals, like 3, turn into (Prelude.fromInt 3), where "Prelude.fromInt" really means "the fromInt from the standard Prelude" regardless of whether

Re: Primitive types and Prelude shenanigans

2001-02-15 Thread Fergus Henderson
On 15-Feb-2001, William Lee Irwin III [EMAIL PROTECTED] wrote: Some reasonable assumptions: I disagree about the reasonableness of many of your assumptions ;-) (1) lists are largely untouchable I want to be able to write a Prelude that has lists as a strict data type, rather than a

RE: Primitive types and Prelude shenanigans

2001-02-14 Thread Simon Peyton-Jones
| On Mon, Feb 12, 2001 at 02:38:25PM -0800, William Lee Irwin III wrote: | I had in mind looking within the compiler, actually. Where in the | compiler? It's a big program, it might take me a while to do an | uninformed search. I've peeked around a little bit and not gotten | anywhere. | |