[Haskell-cafe] Lifting IO actions into Applicatives

Yitzchak Gale gale
Tue Oct 1 12:27:20 UTC 2013

Dan Burton wrote:
> From what you've said, it sounds like you can already write:
>     serverSide :: IO a -> Form a
> This seems elegant enough to me for your needs. Just encourage it as an
> idiom specific to Forms.
>     myBlogForm = Blog <$> titleForm <*> serverSide getCurrentTime <*>
> contentsForm
> Could you abstract `serverSide` out into a typeclass, such as ApplicativeIO?
> Sure. but why bother? The point is, you've got the specialization you need
> already.

In my opinion, this is the nicest answer to the original question
about yesod forms. But the more general question that it led to
is an interesting and important one.


More information about the Haskell-Cafe mailing list