Reputation: 2212
From what I've seen from the Yesod book, validation happens with forms. Coming from an MVC background - where validation happens on the model - this feels like a conflation of concerns. For example, I am looking to build a JSON API using Yesod, and can't see an obvious way of using validation separate from forms.
Is it just a preconceived notion of mine that Form == HTML form, and forms are the right way to ingest data, regardless of the source? Is there some other way that I've ignorant of? If there is some other way, does this not represent a duplication of code in terms of the validations having to be applied to the various data ingress methods?
Upvotes: 3
Views: 108
Reputation: 2585
try look at this digestive-functors and this digestive-functors-aeson
Upvotes: 1