Idea: Make interpolation dependent on user-defined instances
This is a WIP idea I’ve had that’s related to I think GHC string interpolation should ultimately work.
Instead of defaulting to IsString and having a fixed amount of output formats we can use, we want the user to provide three things:
A) The output type out, which has to be Semigroup for
concatenation
B) An instance Interpolate a out for each type that
should be able to be interpolated into out.
C) An instance
Interpolate Text out for interpolating raw strings
This way the user can provide domain-specific instances and prevent some problematic interpolations.
This is just an initial idea, not intended to be merged.
Now that I think about it, the output type should probably come first so that you can curry the type constructor better