
#15472: GHC HEAD type inference regression post-"Remove decideKindGeneralisationPlan" -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: closed Priority: highest | Milestone: 8.8.1 Component: Compiler (Type | Version: 8.5 checker) | Resolution: invalid | 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: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => closed * resolution: => invalid Comment: Thanks, goldfire! I am quite appreciative of the time you took to make that very detailed response. If you're convinced that this is correct behavior, then I'm convinced too, so I'll close this. Fortunately, `singletons` doesn't have to work very hard at all to work around this. Option (B) does indeed work quite nicely (and is backwards compatible): {{{#!diff diff -ru singletons-2.4.1.orig/src/Data/Singletons/Prelude/List.hs singletons-2.4.1/src/Data/Singletons/Prelude/List.hs --- singletons-2.4.1.orig/src/Data/Singletons/Prelude/List.hs 2018-01-08 11:09:19.000000000 -0500 +++ singletons-2.4.1/src/Data/Singletons/Prelude/List.hs 2018-08-03 12:53:25.480813967 -0400 @@ -310,6 +310,7 @@ permutations :: forall a. [a] -> [[a]] permutations xs0 = xs0 : perms xs0 [] where + perms :: [a] -> [a] -> [[a]] perms [] _ = [] perms (t:ts) is = foldr interleave (perms ts (t:is)) (permutations is) where interleave xs r = let (_,zs) = interleave' id xs r in zs }}} An alternative option (D) is to leave off the type signature for `interleave` entirely. (Unfortunately, that's not backwards compatible due to #13549/#13555, but //c'est la vie//.) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15472#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler