
23 Jul
2014
23 Jul
'14
8:33 a.m.
On Wed, Jul 23, 2014 at 7:08 PM, 양철웅
Since the return type of foo Func is IO String and first case statement has "return timedVal", I think that ghc expects the type of timedVal as String. However, the error message shows that ghc expects timedVal should have type IO b0.
It's not really about timedVal nor the case 'statement'. (The scare quotes are because there are only expressions, not statements, in haskell.) Consider the difference between do { putStrLn "hello"; True; } and do { putStrLn "hello"; return True; } Which one throws an error and why? -- Kim-Ee