2005-01-05から1日間の記事一覧

Continuation Monad (3)

[Haskell] Continuation Monad (2) [id:yts:20050103#p1] の続き。 13.3 Tree matching まずTree型の定義をしておく。 data Tree a = Tree [Tree a] | Leaf a deriving (Eq, Show) car (Tree (x:xs)) = x cdr (Tree (x:xs)) = Tree xs isNull (Tree []) = Tr…