summaryrefslogtreecommitdiff
path: root/Presence
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2013-07-01 20:51:01 -0400
committerjoe <joe@jerkface.net>2013-07-01 20:51:01 -0400
commit35c063708a4e4465a0c0f8c89ff2338c79296210 (patch)
treee3d4c33b638b1247b75bd70530e7caac82b3b88d /Presence
parent2b0b81054f19460a465fd0228279c9b6d3b8c1a2 (diff)
new file ControlMaybe: whenJust and withJust
Diffstat (limited to 'Presence')
-rw-r--r--Presence/ControlMaybe.hs10
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 @@
1module ControlMaybe where
2
3withJust (Just x) f = f x
4withJust Nothing f = return ()
5
6whenJust acn f = do
7 x <- acn
8 withJust x f
9
10