Building Recursive Data Structures in Haskell: Duncan Coutts 4/12/03
Building Recursive Data Structures in Haskell: Duncan Coutts 4/12/03
structures in Haskell
Duncan Coutts
4/12/03
Infinite Values
● Haskell allows us to build 'infinite
values' with finite representation
● For example the prelude function
repeat returns an infinite list of the
same element
e
● For starters we'll
d consider directed
graphs where
node link each node has
a 3
b 0 exactly one
c 3 outgoing edge
d 2
e 2
Graphs
● The data type
data Graph a = GNode a (Graph a)