
#11052: Standalone derived Typeable instance for promoted lists is not found -------------------------------------+------------------------------------- Reporter: liamoc | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 7.10.2 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by rwbarton): The error is correct, though the error message is bad (especially the second one). With `-fprint-explicit-kinds` the error is better: {{{ Test2.hs:10:28: No instance for (Typeable [k1] ('[] k1)) arising from a use of ‘typeRep’ In the first argument of ‘typeRepTyCon’, namely ‘(typeRep (Proxy :: Proxy []))’ In the expression: typeRepTyCon (typeRep (Proxy :: Proxy [])) In an equation for ‘nilTyCon’: nilTyCon = typeRepTyCon (typeRep (Proxy :: Proxy [])) Test2.hs:11:28: No instance for (Typeable (k0 -> [k0] -> [k0]) ((':) k0)) (maybe you haven't applied enough arguments to a function?) arising from a use of ‘typeRep’ In the first argument of ‘typeRepTyCon’, namely ‘(typeRep (Proxy :: Proxy (:)))’ In the expression: typeRepTyCon (typeRep (Proxy :: Proxy (:))) In an equation for ‘consTyCon’: consTyCon = typeRepTyCon (typeRep (Proxy :: Proxy (:))) }}} The type `'[]` can have any kind `[k1]`, and these must have different Typeable instances. So, the (implicit, and not even mentioned in the original error message) kind variable is really ambiguous. You could choose a particular kind with a signature: {{{ nilStarTyCon = typeRepTyCon (typeRep (Proxy :: Proxy ('[] :: [*]))) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11052#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler