获取错误时如何解决问题:不在范围内

时间:2012-07-29 01:03:25

标签: haskell emacs haskell-platform haskell-mode haskell-prelude

*Main> :t putStrn

<interactive>:1:1:
Not in scope: `putStrn'
Perhaps you meant one of these:  
  `putStr' (imported from Prelude),  
  `putStrLn' (imported from Prelude)

请注意,我正在使用haskell模式在emacs中练习haskell编程。

即使在使用终端时,我也会收到以下错误:

optimight@optimight:~$ ghci  
GHCi, version 7.4.1: http://www.haskell.org/ghc/  :? for help  
Loading package ghc-prim ... linking ... done. 
Loading package integer-gmp ... linking ... done.  
Loading package base ... linking ... done.  
Prelude> :set prompt ghci>  
ghci>:t putStrln   

<interactive>:1:1:  
    Not in scope: `putStrln'  
    Perhaps you meant one of these:  
      `putStrLn' (imported from Prelude),  
      `putStr' (imported from Prelude)

1 个答案:

答案 0 :(得分:4)

您正在寻找的I / O操作是putStrLn。请注意,大写L - Haskell符号区分大小写 - 就在最后的n之前,如“将字符串放在上”。