
On 07/23/2014 03:08 PM, 양철웅 wrote:
Hi, all!
Hi, Code attached and online: http://lpaste.net/107954 If you look at the formatTime docs [1] you'll see that it returns a "String" not an "IO String" as you expected in the original code, so we need to wrap that in the IO monad using "return", because on the "utc" case branch you're in a monad (keyword: "do"). After doing this modification we bound an IO String to timedVal in the where clause, thus it's no longer necessary to "return timedVal" on the ('x': val) branch of the first case since timedVal is already an IO monad containing a string. Hope this helps. PS: Also if I were you, I'd extract the barFunc function form the fooFunc function and write it as a standalone with explicit types, too. For me, seeing the types helps a lot. http://hackage.haskell.org/package/time-1.4.2/docs/Data-Time-Format.html#v:f... -- Barbu Paul - Gheorghe Common sense is not so common - Voltaire Visit My GitHub profile to see my open-source projects - https://github.com/paullik