P. 1
Haskel Tutorial

Haskel Tutorial

|Views: 132|Likes:
Publicado pordevilvsevil

More info:

Published by: devilvsevil on Oct 23, 2008
Direitos Autorais:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

09/07/2012

pdf

text

original

In addition to overloading operators like ==, Haskell has overloaded numeric constants
(i.e., 1, 2, 3, etc.). This was done so that when you type in a number like 5, the
compiler is free to say 5 is an integer or floating point number as it sees fit. It defines
the Num class to contain all of these numbers and certain minimal operations over
them (addition, for instance). The basic numeric types (Int, Double) are defined to be
instances of Num.

We have only skimmed the surface of the power (and complexity) of type classes
here. There will be much more discussion of them in Section 8.4, but we need some
more background before we can get there. Before we do that, we need to talk a little
more about functions.

You're Reading a Free Preview

Descarregar
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->