Error del compilador de Haskell: no está en el alcance [duplicado]
Esta pregunta ya tiene una respuesta aquí:
¿Por qué no debería mezclar tabulaciones y espacios? 1 respuestaEstoy tratando de aprender haskell escribiendo un sencillo archivo para copiar:
main = do
putStr "Source: "
srcPath <- getLine
putStr "Destination: "
destPath <- getLine
putStrLn ("Copying from " ++ srcPath ++ " to " ++ destPath ++ "...")
contents <- readFile srcPath
writeFile destPath contents
putStrLn "Finished"
Esto me atrapa
GHCi, version 6.10.4: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer ... linking ... done.
Loading package base ... linking ... done.
[1 of 1] Compiling Main ( D:\Test.hs, interpreted )
D:\Test.hs:8:22: Not in scope: `contents'
Failed, modules loaded: none.
Prelude>
No entiendo el error del compilador porque la variable parece estar bien. ¿Qué está mal?
Aquí hay un archivo de reproducción:en rapidshare