Created
August 16, 2017 13:07
-
-
Save mheinzel/f15fbbb441b90cfedeab4fb56203a586 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Control.Monad.Trans.Maybe | |
import Control.Monad.IO.Class (liftIO) | |
prog x = do | |
print "hi" | |
runMaybeT $ do | |
Right y <- return x | |
liftIO $ print y -- will only be executed if x matched the pattern `Right y` | |
print "bye" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment