ねえ-素晴らしいコーダーとハスケラー、私はハスケルの新入生で、次の状況に要約されるプログラムに問題があります
main :: IO ()
main = do
putStrLn "\nplease give me some input"
input1 <- getLine
putStrLn "\nplease give me another input"
input2 <-getLine
putStrLn ("\nyour inputs were "++show(input1)++" and "++ show(input2)")
putStrLn "restart ?? yY or nN"
c <- getChar
restart c
where
restart c
|elem c "yY" = do
main
|elem c "nN" = putStrLn "\nExample Over"
|otherwise = do
putStrLn "\nyou must type one of Yy to confirm or nN to abort"
c'<- getChar
restart c'
メインの最初の実行以外で
input1 <- getLine
次のようにスキップされ、私はそれの理由を見つけることができません
input2 <- getLine
期待どおりに実行されます、私はどんな提案にもオープンであり、事前に感謝を助けますε/ 2