Created
November 20, 2014 13:48
-
-
Save tokiwoousaka/c9a073ddb7b64b65495a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
f :: Maybe Int | |
f = do | |
x <- return 5 | |
y <- return 3 | |
return $ x + y | |
f' :: Maybe Int | |
f' = do | |
x <- return 5 | |
Nothing --途中どこかでNothingが挟まると問答無用で結果はNothingになる | |
y <- return 3 | |
return $ x + y | |
g :: [Int] | |
g = do | |
x <- [1,2,3] | |
y <- [10,11,20] | |
return $ x + y | |
g' :: [Int] | |
g' = do | |
x <- [1,2,3] | |
[] --途中どこかで空リストが挟まると問答無用で結果は空リスト | |
y <- [10,11,20] | |
return $ x + y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment