From 35c063708a4e4465a0c0f8c89ff2338c79296210 Mon Sep 17 00:00:00 2001 From: joe Date: Mon, 1 Jul 2013 20:51:01 -0400 Subject: new file ControlMaybe: whenJust and withJust --- Presence/ControlMaybe.hs | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 Presence/ControlMaybe.hs (limited to 'Presence') 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 @@ +module ControlMaybe where + +withJust (Just x) f = f x +withJust Nothing f = return () + +whenJust acn f = do + x <- acn + withJust x f + + -- cgit v1.2.3