Hal Daume III
Fri, 26 Jul 2002 19:25:17 -0700 (PDT)
In short, these need to be in a file. Take a look at YAHT (yet another
haskell tutorial) which is under development and see if that answers any
of your questions...if not, PLEASE let me know so I can update the
tutorial so it does answer your questions.
The tutorial is available off my web page http://www.isi.edu/~hdaume as a
DVI, PS or PDF.
Hal Daume III
"Computer science is no more about computers | email@example.com
than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume
On Fri, 26 Jul 2002, Pedro L. P. Dias wrote:
> 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 = n+1" don't work too;
> - "data Bool = False | True" also...;
> - "data Color = 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 = 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.