mirror of
https://github.com/MartinThoma/LaTeX-examples.git
synced 2025-04-25 22:38:04 +02:00
5 lines
No EOL
182 B
Haskell
5 lines
No EOL
182 B
Haskell
mapT :: (t -> s) -> Tree t -> Tree s
|
|
mapT f (Node x ts) = Node (f x) (map (mapT f) ts)
|
|
|
|
reduceT :: (t -> t -> t) -> Tree t -> t
|
|
reduceT f (Node x ts) = foldl f x (map (reduceT f) ts) |