[Haskell] Re: sizeFM type
Simon Peyton-Jones
simonpj at microsoft.com
Tue Apr 27 09:28:32 EDT 2004
Could we move this debate to Haskell-café?
Simon
| -----Original Message-----
| From: haskell-bounces at haskell.org [mailto:haskell-bounces at haskell.org] On Behalf Of Serge D.
| Mechveliani
| Sent: 27 April 2004 05:49
| To: Ketil Malde
| Cc: haskell at haskell.org
| Subject: Re: [Haskell] Re: sizeFM type
|
| On Mon, Apr 26, 2004 at 10:09:18PM +0200, Ketil Malde wrote:
| > "Serge D. Mechveliani" <mechvel at botik.ru> writes:
| >
| > > Alexander is right.
| > >
| > > Also as Integer has more sense than Int,
| > > I would suggest for the future standard Haskell library to have
| > > Integer as default. For example:
| > > length :: [a] -> Integer
| > > smallLength :: [a] -> Int
| >
| > Hmm...isn't it possible to use a class here? Perhaps even Num?
| >
| > class Num a where ....
| > :
| > length :: [b] -> a
| > :
| >
|
| I think, for many functions, like length, it is most natural to
| return Integer only.
| And it is also natural for many instances (domains) D to provide
| maps like toInteger, fromInteger.
| Just follow mathematics.
|
| Example: length xs :: (Rational, Rational)
| looks unnatural,
| but fromInteger (length xs) :: (Rational, Rational)
| looks natural.
|
| -----------------
| Serge Mechveliani
| mechvel at botik.ru
|
|
| _______________________________________________
| Haskell mailing list
| Haskell at haskell.org
| http://www.haskell.org/mailman/listinfo/haskell
More information about the Haskell
mailing list