
On Tue, Dec 27, 2011 at 9:41 AM, AbdulSattar Mohammed
I'm still learning Haskell and I've started learning Yesod. I pretty much built a blog before I came this silly roadblock.
Whenever I create a new post, I want it take the current system time as its creation time. I understand it's an impure operation and it must go into the IO Monad to be performed. But, in Yesod, your handler is of the type Handler RepHtml. I don't get how you could get the impure value into a pure function without main playing any part.
Thankfully, we can build monad "stacks" that contains several capacities, this is a standard way to design libraries in Haskell. Yesod use Handler and not IO because it needs to convey more informations than just the IO monad but Handler normally contains IO and is as such a MonadIO instance. In other words, you can use any IO action with the "liftIO" function. -- Jedaï