Some frameworks provide automatically generated type-safe entities, query, and update capabilites, such as the Yesod Persistent framework [0].<p>For a smaller but similarly safe approach, I reccomend Esqueleto.<p>[0] <a href="http:&#x2F;&#x2F;www.yesodweb.com&#x2F;book&#x2F;persistent" rel="nofollow">http:&#x2F;&#x2F;www.yesodweb.com&#x2F;book&#x2F;persistent</a>
[1] <a href="https:&#x2F;&#x2F;hackage.haskell.org&#x2F;package&#x2F;esqueleto" rel="nofollow">https:&#x2F;&#x2F;hackage.haskell.org&#x2F;package&#x2F;esqueleto</a>