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.
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.