
7 Aug
2015
7 Aug
'15
11:15 a.m.
Hi, I am trying to run this basic multiline code in GHCi. I am not sure if this is even possible without writing it in a file and compiling it in a traditional way. ------- Prelude> :set +m Prelude> let main1 = do Prelude| a <- readLn Prelude| return a Prelude| Prelude> Prelude> main1 <interactive>:75:1: No instance for (Show (IO b0)) arising from a use of `print' In the first argument of `print', namely `it' In a stmt of an interactive GHCi command: print it ------- Could someone please confirm if the function can be defined and called like this in GHCi or point to where am going wrong. Thanks, Shishir Srivastava