Doubts...

Pedro L. P. Dias pedrolpd@uol.com.br
Fri, 26 Jul 2002 22:50:58 -0300


This is a multi-part message in MIME format.

------=_NextPart_000_0047_01C234F6.E8479640
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Dear Professor:

My name is Carlos Alexandre Grimaldi.  I'm engineering student at =
Federal University of Rio de Janeiro, Brazil.  I began my studies in =
Haskell, and I have some doubts which I report here.
I'm very gratefully if you could help me.
I'm following a book I downloaded from Internet: "A Gentle Introduction =
to Haskell, Version 98".  Following this, I face some problems:

- "inc :: Integer -> Integer" don't work

- "inc n =3D n+1" don't work too;

- "data Bool =3D False | True" also...;

- "data Color =3D Red | Green | Blue | Indigo | Violet" also fails.

I thought that this commands and definitions must be inside a program, =
and don't at prompt "prelude>".  So, I opened other book, also =
downloaded from Internet: "The Hugs 98 User Manual", and I tryed:

"module Fact where
fact :: Integer -> Integer
fact n =3D product [1..n]"

thinking that would be created a file "Fact", in which the definitions =
for "fact" would work.  But this also yield an error...  So, I ask you:

- is necessary the creation of a file where that definitions could work?

- is this file a ".hs"?

- how can I create a file like this?  Which command or editor?

- or, if I wrong, why that examples don't work?

Thank you very much for your help.
Best regards,
Carlos A. Grimaldi.

------=_NextPart_000_0047_01C234F6.E8479640
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV>
<DIV>
<DIV>Dear Professor:</DIV>
<DIV>&nbsp;</DIV>
<DIV>My name is Carlos Alexandre Grimaldi.&nbsp; I'm engineering student =
at=20
Federal University of Rio de Janeiro, Brazil.&nbsp; I began my studies =
in=20
Haskell, and I have some doubts which I report here.</DIV>
<DIV>I'm very gratefully if you could help me.</DIV>
<DIV>I'm following a book I downloaded from Internet: "A Gentle =
Introduction to=20
Haskell, Version 98".&nbsp; Following this, I face some problems:</DIV>
<DIV>&nbsp;</DIV>
<DIV>- "inc :: Integer -&gt; Integer" don't work</DIV>
<DIV>&nbsp;</DIV>
<DIV>- "inc n =3D n+1" don't work too;</DIV>
<DIV>&nbsp;</DIV>
<DIV>- "data Bool =3D False | True" also...;</DIV>
<DIV>&nbsp;</DIV>
<DIV>- "data Color =3D Red | Green | Blue | Indigo | Violet" also =
fails.</DIV>
<DIV>&nbsp;</DIV>
<DIV>I thought that this commands and definitions must be inside a =
program, and=20
don't at prompt "prelude&gt;".&nbsp; So, I opened other book, also =
downloaded=20
from Internet: "The Hugs 98 User Manual", and I tryed:</DIV>
<DIV>&nbsp;</DIV>
<DIV>"module Fact where</DIV>
<DIV>fact :: Integer -&gt; Integer</DIV>
<DIV>fact n =3D product [1..n]"</DIV>
<DIV>&nbsp;</DIV>
<DIV>thinking that would be created a file "Fact", in which the =
definitions for=20
"fact" would work.&nbsp; But this also yield an error...&nbsp; So, I ask =

you:</DIV>
<DIV>&nbsp;</DIV>
<DIV>- is necessary the creation of a file where that definitions could=20
work?</DIV>
<DIV>&nbsp;</DIV>
<DIV>- is this file a ".hs"?</DIV>
<DIV>&nbsp;</DIV>
<DIV>- how can I create a file like this?&nbsp; Which command or =
editor?</DIV>
<DIV>&nbsp;</DIV>
<DIV>- or, if I wrong, why that examples don't work?</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thank you very much for your help.</DIV>
<DIV>Best regards,</DIV>
<DIV>Carlos A. Grimaldi.</DIV></DIV></DIV></BODY></HTML>

------=_NextPart_000_0047_01C234F6.E8479640--