[Haskell-cafe] GHC TV station?

Sylvester sylvester.hazel at googlemail.com
Tue May 15 16:03:22 UTC 2018


                               strlen in Hutton 2ed 10.5 Derived primitives
        White Spaced                                                       
run on Windows 7 Haskell Platform 8.2.2
strlen :: IO ()                                                         
GHCi, version 8.2.2: http://www.haskell.org/ghc/  :? for help    
strlen = do putStr "Enter a string: "                       [1 of 1]
Compiling Main      ( C:\strlen.WhiteSpaced.hs, interpreted )
                  xs <-  getLine                                
                  putStr "The string has "                      
C:\strlen.WhiteSpaced.hs:2:14: error:
                  putStr (show (length xs))                        Parse
error in pattern: putStr
                  putStr " characters"                               
Possibly caused by a missing 'do'?
                                                                               
|
                                                                             
2 | strlen = do  putStr "Enter a string: "
                                                                               
|              ^^^^^^^^^^^^^^^^^^^^^^^^^^^...
                                                                             
Failed, no modules loaded.
                                                                             
Prelude>
      Bracesed
strlen :: IO                                                            
GHCi, version 8.2.2: http://www.haskell.org/ghc/  :? for help 
strlen = do {putStr "Enter a string: ";                    [1 of 1]
Compiling Main             ( C:\strlen.Bracesed.hs, interpreted )
                   xs <-  getLine;                                   Ok, one
module loaded.
                   putStr "The string has ";                    *Main>
                   putStr (show (length xs));      
                   putStr " characters"}           
                                                        
                                                        
                                                        
                                                          
                                                          
                                                          
                                                          


 




--
Sent from: http://haskell.1045720.n5.nabble.com/Haskell-Haskell-Cafe-f3074699.html


More information about the Haskell-Cafe mailing list