1
*Main> :t putStrn

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

Please note that I am practising haskell programming in emacs with haskell mode.

Even while using terminal, I am getting following error:

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)
martin
  • 1,102
  • 2
  • 12
  • 20
Optimight
  • 2,989
  • 6
  • 30
  • 48
  • 1
    Are you sure there is a function named `putStrn`? – Pikaurd Jul 29 '12 at 01:14
  • @Pikaurd: Yes, I am using after refering to the book- Learn you a Haskell for Good - topic 9.1 where it has written "Let's examine what we wrote. First, let's look at the type of the function putStrLn. ghci> :t putStrLn putStrLn :: String -> IO () ghci> :t putStrLn "hello, world" putStrLn "hello, world" :: IO () – Optimight Jul 29 '12 at 01:17
  • 3
    `putStrn` and `putStrln` are a different names than `putStrLn`. – ephemient Jul 29 '12 at 01:19

1 Answers1

4

The I/O action you are looking for is putStrLn. Note the capital L — Haskell symbols are case-sensitive — just before the final n, as in “put a string on a line of its own.”.

Greg Bacon
  • 134,834
  • 32
  • 188
  • 245