:
addBook = do
putStrLn "Enter the title of the Book"
tit <- getLine
putStrLn "Enter the author of "++tit
aut <- getLine
putStrLn "Enter the year "++tit++" was published"
yr <- getLine
との "翻訳" は "通常"(非do
)表記(与えられたp = putStrLn "..."
):
addBook =
p >> getLine >>= (\tit ->
p >> getLine >>= (\aut ->
p >> getLine >>= (yr ->
あなたは(yr ->
で終わるされていますそれは意味をなさない。最後に
return()
:あなたが行うには有益な何かを持っていない場合は、あなただけの空のタプルを返すことができ
addBook = do
putStrLn "Enter the title of the Book"
tit <- getLine
putStrLn "Enter the author of "++tit
aut <- getLine
putStrLn "Enter the year "++tit++" was published"
yr <- getLine
return()
あなたがaut
を取得する必要があり、なぜあなたは、おそらく自分自身に問う必要がありますし、 yr
です。
これは他の人と関連があるかもしれません...私は、タブのインデントと残りのスペースで "do"の最初の行を持っていました:P –