I have type in Haskell
newtype Uid a = Uid {uidToText :: Text}
deriving (Eq, Ord, Show, Data, Typeable, Generic)
Using purescript-bridge library mkSumType function I can't make SumType of it. Now I have
clientTypes :: [SumType 'Haskell]
clientTypes =
[ ...
, mkSumType (Proxy :: Proxy (Uid a))
]
main :: IO ()
main = writePSTypes path (buildBridge bridge) clientTypes
and it says
• No instance for (Data.Typeable.Internal.Typeable a0)
arising from a use of ‘mkSumType’
• In the expression: mkSumType (Proxy :: Proxy (Uid a))
How can I fix it?
Uid aa concrete type, i.e.mkSumType (Proxy :: (Uid ())possible/helpful? - trevor cookTypeableinstances, and theSumTypedatatype does not support polytypes (so you cannot even bypass the Typeable requirement ofmkSumType). - user2407038Proxyitself is a polykinded type, so you can doProxy Uidinstead ofProxy (Uid a). However, functions cannot be polykinded, which means that themkSumTypefunction is "frozen" to accept onlyProxy * aand cannot acceptProxy (* -> *) a. - Fyodor Soikin