summaryrefslogtreecommitdiff
path: root/Presence/ControlMaybe.hs
blob: e277df12688bf36691aba653f7cbe3ce82c95cbc (plain)
1
2
3
4
5
6
7
8
9
10
module ControlMaybe where

withJust (Just x) f = f x
withJust Nothing  f = return ()

whenJust acn f = do
    x <- acn
    withJust x f