Anwendung II: geordnete Bäume

inorder :: Tree a -> [a]

ordered :: Ord a => Tree a -> Tree a
ordered t = 
    relabel t $ Data.List.sort $ inorder t
relabel :: Tree a -> [b] -> Tree b

data Ordered a = Ordered ( Tree a )
instance ( Ord a, Serial a ) 
  => Serial (Ordered a ) where
    series = \ d -> map ordered $ series d

test ( \ (Ordered t :: Ordered Int) -> ... )



Johannes Waldmann 2012-06-25