StevenWInfo / haskell-soda

Haskell bindings for the Socrata Open Data API
MIT License
4 stars 0 forks source link

Make the type for the "Case" SodaFunc constructor less restrictive #13

Open StevenWInfo opened 7 years ago

StevenWInfo commented 7 years ago

I think that my definition of the Case constructor might be a little restrictive because I think the soda level function can return differently typed values. We could make an existential type just to hide those types, but that would be yet another thing to keep track of.

StevenWInfo commented 7 years ago

One possibly lightweight way of doing it would be to create a new recursive GADT acts like a list and "combines" making a list, making tuples, and adding an existential operator. Could have the constructors be like "When" and "Then" and maybe "End" if needed. Not sure if just have this as a SodaExpr or put into a Case SodaFunc constructor. This might just be hiding the verbosity/boilerplate behind something that looks like a natural SQL query rather than eliminating it, but that might be almost as good.