Skip to content

Conversation

@Profpatsch
Copy link
Contributor

@Profpatsch Profpatsch commented Jan 20, 2025

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.

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.
@Profpatsch
Copy link
Contributor Author

Now that I think about it, the output type should probably come first so that you can curry the type constructor better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant