*Main> read "12.3"::Float
12.3
*Main> read "-42"::Int
-42
module Tree ( Tree(Leaf,Branch), fringe ) where |
|
data Tree a = Leaf a | Branch ( Tree a ) ( Tree a ) deriving (Eq, Show) |
|
fringe :: Tree a -> [a] |
fringe ( Leaf x ) = [x] |
fringe ( Branch left right ) = fringe left ++ fringe right |
14. Haskell Tips Notes on Functional Programming / Version 2.10 2014-02-24 |