projects
/
yorgey.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3086656
)
exercise 4
author
Ramakrishnan Muthukrishnan
<ram@rkrishnan.org>
Fri, 26 Dec 2014 10:08:12 +0000
(15:38 +0530)
committer
Ramakrishnan Muthukrishnan
<ram@rkrishnan.org>
Fri, 26 Dec 2014 10:08:12 +0000
(15:38 +0530)
hw8/Party.hs
patch
|
blob
|
history
diff --git
a/hw8/Party.hs
b/hw8/Party.hs
index d303b01f3296c99d6ea4933b020437cb0c5c2e42..3bc5e1b448b84b399c4101b26305152637f6c197 100644
(file)
--- 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
+