-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChapter2.hs
More file actions
29 lines (25 loc) · 743 Bytes
/
Copy pathChapter2.hs
File metadata and controls
29 lines (25 loc) · 743 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
------------------------------------------------------------------------------
-- Haskell: The Craft of Functional Programming
-- Simon Thompson
-- (c) Addison-Wesley, 1999.
--
-- Chapter 2
--
-- The example scripts FirstScript.hs and FirstLiterate.lhs are provided
-- separately.
------------------------------------------------------------------------------
module Chapter2 where
import Chapter1
-- Some example expressions
ex1, ex2 :: Int
ex1 = double 32 - square (size - double 3)
ex2 = double 320 - square (size - double 6)
-- Some examples of expressions which cause errors; that's why
-- they appear as comments and not as Haskell text.
--
-- 2+(3+4
-- 2+(3+4))
-- double square
-- 4 double
-- 4 5
-- 4 `div` (3*2-6)