projects
/
summerofcode2018soln.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added some comments
[summerofcode2018soln.git]
/
src
/
task6
/
task6-monad.hs
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