At 10:31 -0300 2002/07/25, Pedro L. P. Dias wrote: I start Hugs, and, at the line command "prelude>", when I digit, for example, "add x y = x + y", an error message appear: "...unexpected '='". Also, when I digit (other example) "inc n = n + 1", the error message is "undefined variable inc",
Dig-it, Hugs is hooked up so that definitions must be in a file. So put
Dear Professor Hans Aberg:
Thank you for your answer!
'Sorry to bother you again...
I found a Hugs manual, "The Hugs 98 User Manual", and it describes "module".
So, I wrote:
module Fact where fact :: Integer -> Integer fact n = product [1..n]
because this is the example showed at page 8 of that manual. But,
unfortunately, another error message appears: "cannot find module 'Fact' ".
I understood, from your e-mail and the manual, that I must create an ".hs"
file with my own definitions; so, how can I do this?
Thank you very much (again!).
Best regards,
Pedro.
----- Original Message -----
From: Hans Aberg
stuff in a file and then load that file.
Hans Aberg
participants (1)
-
Pedro L. P. Dias