Anatomy of a Haskell-based Application
abailly.github.io
abailly.github.io
Once you've abstracted away the persistence and querying details, I think you get to the best part of FP which is modeling the actual behaviour/flow of data and types. In a typical app lifecycle Haskell starts shining more as time goes on and the app grows past CRUD and in size.
[1] https://code.facebook.com/projects/854888367872565/haxl/ [2] http://ren.zone/articles/opaleye-sot
For a smaller but similarly safe approach, I reccomend Esqueleto.
[0] http://www.yesodweb.com/book/persistent [1] https://hackage.haskell.org/package/esqueleto
acid-state is a smaller, no-SQL alternative [1].
If you just wrap the C calls for some SQL database, or say, OpenGL, the resultant code ends up looking very imperative, stateful, and C-like.
Some people have tried to make more Haskell-ish wrappings with limited success.
Fortunately, even C-like Haskell is not totally awful. It's just not as nice as more idiomatic Haskell.
I highly recommend Opaleye for this (with the caveat that I'm the primary author!).
From the Opaleye front page:
> Opaleye is a Haskell library that provides an SQL-generating embedded domain specific language for targeting Postgres. You need Opaleye if you want to use Haskell to write typesafe and composable code to query a Postgres database.
> "Opaleye really is great. You've managed to bring what is so wonderful about relational databases and give it type safety and composition (i.e. what is wonderful about Haskell)" – Daniel Patterson, Position Development