Primitive types and Prelude shenanigans
Simon Peyton-Jones
simonpj@microsoft.com
Tue, 20 Feb 2001 08:33:46 -0800
I don't mind doing this, but can someone first give a brief justification
about why it's a good idea, independent of the discussion that
has taken place on this list? I'd like to add such an explanation
to the code.
Simon
| -----Original Message-----
| From: qrczak@knm.org.pl [mailto:qrczak@knm.org.pl]
| Sent: 16 February 2001 17:42
| To: haskell-cafe@haskell.org
| Subject: Re: Primitive types and Prelude shenanigans
|
|
| Thu, 15 Feb 2001 20:56:20 -0800, William Lee Irwin III
| <wli@holomorphy.com> 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 changed to expand -9 to
| negate (fromInteger 9) instead of fromInteger (-9), then you don't
| need uglification of the fromInteger function to be able to define
| types with only nonnegative numeric values. Just define your negate
| in an appropriate class, different from the fromInteger's class.
|
| --
| __("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
| \__/
| ^^ SYGNATURA ZASTEPCZA
| QRCZAK
|
|
| _______________________________________________
| Haskell-Cafe mailing list
| Haskell-Cafe@haskell.org
| http://www.haskell.org/mailman/listinfo/haskell-cafe
|