File: part21.lhs

package info (click to toggle)
haskell98-tutorial 200006-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 624 kB
  • ctags: 11
  • sloc: haskell: 2,125; makefile: 80; sh: 13
file content (24 lines) | stat: -rw-r--r-- 609 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Gentle Introduction to Haskell 98, Online Supplement 
Part 21
Covers Section 11

Section 11

> module Part21() where

Since each of these files is a separate module we need to place 
Tree in it's own module.  See Tree.lhs

> import Tree ( Tree(Leaf, Branch), fringe)

> e1 :: [Int]
> e1 = fringe (Branch (Leaf 1) (Leaf 2))

You could also just `import Tree' and get everything from Tree without
explicitly naming the entities you need.

This interactive Haskell environment can evaluate expressions in
any module.  You can do :m Tree to get to that module for interactive
evaluation.

Continued in Part22.lhs