インデントエラーが何であるかは知っていますが、ここでこのエラーが発生する理由は何もわかりません。ブロックでインデントエラーが発生する
Account.hs:40:25: error:
parse error (possibly incorrect indentation or mismatched brackets)
|
40 | let amount = readLn :: IO Int
| ^
Failed, 0 modules loaded.
main = do
putStrLn $ "Press one to create a new account"
let g = getLine
enteredValue = read g :: Int
if g == 1
then do putStrLn $ "Enter your name "
let name = getLine
putStrLn $ "Enter the initial amount"
let amount = readLn :: IO Int
value = Account (name,1,amount) Saving
show value
else do putStrLn $ "Nothing"
私はまた、このバージョンを試してみましたが、これもincorrect indentation or mismatched brackets
を与える:
main = do
putStrLn $ "Press one to create a new account"
let g = getLine
enteredValue = read g :: Int
if g == 1
then do putStrLn $ "Enter your name "
let name = getLine
putStrLn $ "Enter the initial amount"
amount = readLn :: IO Int
value = Account (name,1,amount) Saving
show value
else do putStrLn $ "Nothing"
Btw。画像を使って 'テキスト'ベースの情報を表示しないでください。エラーメッセージをコピーしてコピーして、ソースコードのように追加してください。検索エンジンがあなたのコンテンツのインデックスを作成することは簡単です。あなたの写真のホスティングサービスが質問の答えが理解できない場合は、自己完結型の質問になります。 – epsilonhalbe