Created
July 15, 2016 12:09
-
-
Save denisshevchenko/4a78d624050a9c038083d2666c041f43 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
whenM (ms_isNeeded ms) | |
(ifM (pure (isJust (ms_onFailure ms)) <&&> isManagerAlive m) | |
(fromJust (ms_onFailure ms) >> reloadManager m) | |
(killManager m)) |
И меньше скобочек
let MS{ms_isNeeded, ms_onFailure} = ms
whenM ms_isNeeded $ do
managerIsAlive <- isManagerAlive m
case ms_onFailure of
Just onFailure | managerIsAlive -> do
onFailure
reloadManager m
_ ->
killManager m
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Меньше магии