purescript-bridge icon indicating copy to clipboard operation
purescript-bridge copied to clipboard

Implement typeclasses for Dummy TypeParameters

Open flip111 opened this issue 2 years ago • 1 comments

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)
   |                                            ^^^^^

flip111 avatar Feb 18 '23 19:02 flip111

I am trying to merge the IOHK fork: https://github.com/eskimor/purescript-bridge/issues/63 I suggest we complete this before solving other bugs.

peterbecich avatar Feb 20 '23 04:02 peterbecich