diff options
author | joe <joe@jerkface.net> | 2013-07-01 20:51:01 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2013-07-01 20:51:01 -0400 |
commit | 35c063708a4e4465a0c0f8c89ff2338c79296210 (patch) | |
tree | e3d4c33b638b1247b75bd70530e7caac82b3b88d /Presence | |
parent | 2b0b81054f19460a465fd0228279c9b6d3b8c1a2 (diff) |
new file ControlMaybe: whenJust and withJust
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 | |||