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

Could not deduce: Show <+> '[] #2

Open
yaitskov opened this issue Jan 31, 2023 · 0 comments
Open

Could not deduce: Show <+> '[] #2

yaitskov opened this issue Jan 31, 2023 · 0 comments

Comments

@yaitskov
Copy link

Hi,

<+> type operator need a fix. In GHC 8.10 and GHC 9.2.4:

Definition is compiled, but function invocation gives a type error:

sp :: Show <+> [a, b] => a -> b -> String ; sp a b = show a <> show b
> sp () ()

<interactive>:35:1: error:
    • Could not deduce: Show <+> '[] arising from a use of ‘sp’
    • In the expression: sp () ()
      In an equation for ‘it’: it = sp () ()

Extending type family with follow member solve the problem:

type instance (<+>) _ '[] = (() :: Constraint)
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

No branches or pull requests

1 participant