Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

errorTypeName method has sensible default implementation #64

Open
parsonsmatt opened this issue Jun 12, 2018 · 1 comment
Open

errorTypeName method has sensible default implementation #64

parsonsmatt opened this issue Jun 12, 2018 · 1 comment

Comments

@parsonsmatt
Copy link

Using DefaultSignatures, the errorTypeName method could easily be given the implementation:

    default errorTypeName :: (Typeable a) => Proxy a -> String
    errorTypeName prxy = show (typeRep prxy)

Since all types are Typeable in recent GHC, this would be trivially satisfiable for all types.

@parsonsmatt
Copy link
Author

This is a somewhat larger change than anticipated, since we are using CPP to conditionally check on the availability of DefaultSignatures. This is to support GHC < 7.2.

I can make a PR keeping GHC < 7.2 support that uses CPP in all of the instance declarations to give Typeable constraints if DefaultSignatures is available, and not otherwise. Or we can drop support for < 7.2 and remove the CPP entirely. I'm weakly in favor of the latter option as it would simplify the library, and I'd be shocked if anyone is still on GHC 7.0 or earlier and using new versions of this package.

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 a pull request may close this issue.

1 participant