WinHugs - how to declare a variable and function

I downloaded WinHugs 2 hours ago and still cannot figure out how to declare simple things. I'm trying to follow the book "7 languages for 7 weeks," but things like let x = 10and double x = x * 2give syntax errors.

+5
source share
2 answers

I am not 100% sure what you are trying to do, this does not work. You cannot declare bindings in a WinHugs session, you can evaluate only complete expressions. This way you can do things like let x = 10 in x * x + x, but you cannot say let x = 10in an interactive session. In other words, you cannot make a stick declaration.

, .hs WinHugs GHCi ( , - WinHugs ). GHCi, Haskell Platform.

+11

winhugs

double x = x * 2

:

double x = x * 2 10

ghc ghci,

double x = x * 2

double 10

, ghci: https://downloads.haskell.org/~ghc/7.2.2/docs/html/users_guide/interactive-evaluation.html

, cygwin - ghci, , .

+1

All Articles