
#13549: GHC 8.2.1's typechecker rejects code generated by singletons that 8.0 accepts -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.2.1 Component: Compiler (Type | Version: 8.1 checker) | Resolution: | Keywords: TypeInType Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by goldfire): I still think this is #13555. In all cases, the extra kind signatures mention kind variables, which GHC is now not generalizing. What surprises me about this case is that no generalization should be necessary to compile the singled `permutations`. My best guess is that untouchable type variables induced by some GADT pattern matching prevent GHC from inferring the correct kinds of the functions. If their kinds are generalized, then all works out. But since they are not being generalized any more, we run into a problem. I'm inclined to try to understand this as an infelicity in singletons, that it produces code that GHC can't infer the kinds of. I doubt singletons can fix the problem, but it would be nice to be able to characterize what exactly is the cause of the problem and then document the infelicity. In the meantime, I'd bet that adding a type annotation to `perms` and `interleave` in the `Data.Singletons.Prelude.List` implementation would allow singletons to compile. I'm happy to do the further digging, but not for a few weeks, I'm afraid. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13549#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler