StevenWInfo / haskell-soda

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

SodaFunc parameters are both not restrictive enough, and too restrictive at the same time. #17

Closed StevenWInfo closed 7 years ago

StevenWInfo commented 7 years ago

Many of the SodaFunc constructors, which currently have the type something like a -> a -> b can actually have different types for the first two parameters, like +. They can only allow a subset of SodaType types though, like the numeric ones.

Another related problem is that SodaFunc constructors like within_circle currently allow any SodaType for the first parameter, whereas it should really only be geometric SodaTypes.

These two problems can be solved by creating a bunch of typeclasses that just specify different subsets of SodaType that need to be used. They don't need to have any methods.

There might be another, more terse way of going about this, but I think this is the simplest way that doesn't add any more boilerplate for the user.

StevenWInfo commented 7 years ago

I forgot that I already made an issue for this: #9