diff options
Diffstat (limited to 'Presence')
-rw-r--r-- | Presence/ControlMaybe.hs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Presence/ControlMaybe.hs b/Presence/ControlMaybe.hs new file mode 100644 index 00000000..e277df12 --- /dev/null +++ b/Presence/ControlMaybe.hs | |||
@@ -0,0 +1,10 @@ | |||
1 | module ControlMaybe where | ||
2 | |||
3 | withJust (Just x) f = f x | ||
4 | withJust Nothing f = return () | ||
5 | |||
6 | whenJust acn f = do | ||
7 | x <- acn | ||
8 | withJust x f | ||
9 | |||
10 | |||