projects
/
summerofcode2018soln.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
71da18e
)
Tweaked a name
author
Neil Smith
<neil.git@njae.me.uk>
Tue, 2 Oct 2018 10:31:09 +0000
(11:31 +0100)
committer
Neil Smith
<neil.git@njae.me.uk>
Tue, 2 Oct 2018 10:31:09 +0000
(11:31 +0100)
src/task6/task6-monad.hs
patch
|
blob
|
history
diff --git
a/src/task6/task6-monad.hs
b/src/task6/task6-monad.hs
index df52ed1410b40a343846705d582028d381b30d7d..50aca558fa21e9d4a6c4f40cc58d341458d630e1 100644
(file)
--- a/
src/task6/task6-monad.hs
+++ b/
src/task6/task6-monad.hs
@@
-66,10
+66,10
@@
execGroups (State st) = fst $ st M.empty
-- including all the friendships is just a monadic fold
mergeFriendships :: [(Name, Name)] -> State ()
-- including all the friendships is just a monadic fold
mergeFriendships :: [(Name, Name)] -> State ()
-mergeFriendships pairs = foldM_ includeFriendship
M
() pairs
+mergeFriendships pairs = foldM_ includeFriendship () pairs
-includeFriendship
M
:: () -> (Name, Name) -> State ()
-includeFriendship
M
_ (thisPerson, thatPerson) = do
+includeFriendship :: () -> (Name, Name) -> State ()
+includeFriendship _ (thisPerson, thatPerson) = do
include thisPerson
include thatPerson
thisExemplar <- exemplar thisPerson
include thisPerson
include thatPerson
thisExemplar <- exemplar thisPerson