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

Implement typeclasses for Dummy TypeParameters #73

Open
flip111 opened this issue Feb 18, 2023 · 1 comment
Open

Implement typeclasses for Dummy TypeParameters #73

flip111 opened this issue Feb 18, 2023 · 1 comment

Comments

@flip111
Copy link

flip111 commented Feb 18, 2023

Out of the box using the TypeParameters needs an additional standalone deriving like deriving instance Eq A. Otherwise you will get the errors below. Could this library deriving these classes by itself so we can avoid the standalone deriving boilerplate?

data Maybe' a = Nothing' | Just' a
  deriving (Generic, Eq)

myTypes :: [SumType 'Haskell]
myTypes =
  [ let p = (Proxy :: Proxy (Maybe' A)) in equal p (mkSumType p) -- line 53
  ]

run :: IO ()
run = writePSTypes "/home/flip111/types" (buildBridge defaultBridge) myTypes
Main.hs:53:44: error:
    • No instance for (Eq A) arising from a use of ‘equal’
    • In the expression: equal p (mkSumType p)
      In the expression:
        let p = (Proxy :: Proxy (Maybe' A)) in equal p (mkSumType p)
      In the expression:
        [let p = (Proxy :: Proxy (Maybe' A)) in equal p (mkSumType p)]
   |
53 |   [ let p = (Proxy :: Proxy (Maybe' A)) in equal p (mkSumType p)
   |                                            ^^^^^
@peterbecich
Copy link
Contributor

I am trying to merge the IOHK fork: #63 I suggest we complete this before solving other bugs.

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

2 participants