Making Haskell Talk to PostgreSQL Without Suffering

How to eliminate the three performance taxes that make database queries slow: encoding overhead, round-trip latency, and N+1 query patterns.