EDSL for SQL-like queries - Haskell

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

Georgi Lyubenov // googleson78

Has anyone had success with an EDSL (via some free monad-like thing or not) for extracting data, which supports both an SQL interpretation and some other (e.g. over lists/Set/Map) interpretation?

I'm using an effects system, with an effect for interacting with a "store" - which is a SQL database "in production", but a lot of logic is ending up in an interpreter - which is fine, if the action being handled was simple enough to convey this, but it isn't.
I want to try to break down my "query" action(s) into smaller ones like "order", "group", etc, but I have the feeling that if I go down this route I'll just end up writing some EDSL for SQL.

I would be happy to see some domain-restricted version too! The "domain-restricted" part is what I'm hoping will help with making this not a 1-to-1 translation of SQL.