do記法の中でletやlet ... inを使ったサンプル
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
main = do | |
-- let ... in を使った場合 | |
let f :: String -> IO () | |
f = putStrLn | |
in f "f" | |
-- ただの let を使った場合(こっちの方が大抵おすすめ!) | |
let g :: String -> IO () | |
g = putStrLn | |
g "g" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment