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