Monomorphize kinds of Error{,WithoutStackTrace}, introduce PolyError#554
Merged
RyanGlScott merged 2 commits intomasterfrom Feb 18, 2023
Merged
Monomorphize kinds of Error{,WithoutStackTrace}, introduce PolyError#554RyanGlScott merged 2 commits intomasterfrom
Error{,WithoutStackTrace}, introduce PolyError#554RyanGlScott merged 2 commits intomasterfrom
Conversation
Previously, we had generalized the argument kind to `Error` in commit 077aee5 to permit passing things to `Error` besides `Symbol`s. Back then, there was no way to `show` things at the type level, nor was there a way to manipulate `Symbol`s in any meaningful fashion, so this seemed like a reasonable choice. Nowadays, however, the story is different. There is a type-level `Show_` function, and the API for manipulating `Symbol`s is nearly as expressive as the API for manipulating `String`s. What's more, making `Error`'s argument kind more general introduces ambiguity-related issues when deriving `Enum` instances with `OverloadedStrings` enabled, as observed in #89. In light of this, I have changed the API such that: * The kind of the argument to `Error` (as well as the related `ErrorWithoutStackTrace` function) is now `Symbol`. In this sense, this patch reverts 077aee5. * There is now a new `Data.Singletons.Base.PolyError` module that provides a `PolyError` function. `PolyError` provides a kind-polymorphic `Error` interface much like what the previous type of `Error` was, so any existing code that relied on the argument of `Error` being kind-polymorphic can be migrated over to use `PolyError`. Resolves #89 (hopefully for good this time).
Closed
amesgen
approved these changes
Feb 18, 2023
amesgen
left a comment
There was a problem hiding this comment.
I think this is looking great, thanks for such a quick and thorough resolution!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, we had generalized the argument kind to
Errorin commit 077aee5 to permit passing things toErrorbesidesSymbols. Back then, there was no way toshowthings at the type level, nor was there a way to manipulateSymbols in any meaningful fashion, so this seemed like a reasonable choice.Nowadays, however, the story is different. There is a type-level
Show_function, and the API for manipulatingSymbols is nearly as expressive as the API for manipulatingStrings. What's more, makingError's argument kind more general introduces ambiguity-related issues when derivingEnuminstances withOverloadedStringsenabled, as observed in #89.In light of this, I have changed the API such that:
Error(as well as the relatedErrorWithoutStackTracefunction) is nowSymbol. In this sense, this patch reverts 077aee5.Data.Singletons.Base.PolyErrormodule that provides aPolyErrorfunction.PolyErrorprovides a kind-polymorphicErrorinterface much like what the previous type ofErrorwas, so any existing code that relied on the argument ofErrorbeing kind-polymorphic can be migrated over to usePolyError.Resolves #89 (hopefully for good this time).