Skip to content

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

@yaitskov

Description

@yaitskov

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions