Open StevenWInfo opened 7 years ago
Some possible ways to reduce the boilerplate are with Haskell generics, template Haskell, and/or type families using type functions. There's also the possibilities that I'm overlooking simpler ways as well. I'm not sure how realistic any of these methods are though.
Getting stuff out of the response is a little wordier than I would like as well. I could probably make some utility functions that sum up some of the most common ways of extracting values out of the response. For example, functions that already get values out of ResponseType
, and maybe something that combines those with the lookup function.
I've also been thinking about having a smart constructor for Column
types that also takes in a Proxy a
value to specify the column's type as a
. It wouldn't necessarily reduce the amount of boilerplate, but it might be a bit nicer than adding type declarations, especially if you're trying to create the column in line.
I think I've figured out how to get rid of using SodaVal all over the place using type families. I just need to code it up and test it.
Perhaps the emptyQuery should just have default values instead of being Maybe a
values. It creates some boilerplate for no significant benefit since they are interpreted as default values on the SODA side.
I don't know if getting rid of some or any of the following is possible, but I'd like to try.
SodaVal
on all of the SODA values.Proxy a
value or something like that could make it simpler.Expr
on a lot of things