diff options
Diffstat (limited to 'lec08/Party.hs')
| -rw-r--r-- | lec08/Party.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lec08/Party.hs b/lec08/Party.hs index fe60fe8..05b5e0e 100644 --- a/lec08/Party.hs +++ b/lec08/Party.hs @@ -1,6 +1,7 @@ module Party where import Employee +import Data.Tree -- Exercise 1 @@ -18,3 +19,8 @@ moreFun :: GuestList -> GuestList -> GuestList moreFun gl1@(GL _ f1) gl2@(GL _ f2) | f1 >= f2 = gl1 | otherwise = gl2 + +-- Exercise 2 + +treeFold :: (a -> [b] -> b) -> Tree a -> b +treeFold f (Node l subs) = f l $ map (\t -> treeFold f t) subs |