Ich weiß, was ein Einzug Fehler ist, aber ich habe keine Ahnung, warum ich diesen Fehler hier bekomme, während jeder ausgerichtet ist, versuchen, es für 2 Stunden zu lösen.Let Block gibt Eindruck Fehler
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"
Ich habe auch versucht, diese Version aber das gibt auch 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. Bitte verwende keine Bilder, um 'text' -basierte Informationen anzuzeigen - kopiere einfach die Fehlermeldung und füge sie wie deinen Quellcode ein. Es ist einfacher für Suchmaschinen, Ihre Inhalte zu indizieren und es stellt Ihre Frage in sich abgeschlossen, wenn der Hosting-Service Ihres Bildes die Frage nicht beantwortet, kann nicht beantwortet werden. – epsilonhalbe