Zustands-Transformatoren (Anwendung)

relabel :: Tree a -> State [b] (Tree b)
relabel t = case t of
  Leaf -> return Leaf
  Branch {} -> do
    l <- relabel $ left t
    k <- next
    r <- relabel $ right t
    return $ Branch {left=l,key=k,right=r}



Johannes Waldmann 2011-01-18