From: Ramakrishnan Muthukrishnan Date: Fri, 26 Dec 2014 10:08:12 +0000 (+0530) Subject: exercise 4 X-Git-Url: https://git.rkrishnan.org/%5B/%5D%20/uri/flags/frontends/status?a=commitdiff_plain;h=65df75188219ab115c290e37199b8e46e115c70a;p=yorgey.git exercise 4 --- diff --git a/hw8/Party.hs b/hw8/Party.hs index d303b01..3bc5e1b 100644 --- a/hw8/Party.hs +++ b/hw8/Party.hs @@ -51,3 +51,12 @@ nextLevel e lst = withoutBoss = mconcat $ map (uncurry moreFun) lst in (withBoss, withoutBoss) + +-- exercise 4 +-- maxFun +maxFun :: Tree Employee -> GuestList +maxFun = uncurry moreFun . maxFunPair + +maxFunPair :: Tree Employee -> (GuestList, GuestList) +maxFunPair (Node e es) = nextLevel e $ map maxFunPair es +