
#12785: GHC panic, TypeFamily in equality constraint -------------------------------------+------------------------------------- Reporter: heisenbug | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 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 heisenbug): With the attached patch I get: {{{ $ ghci Tree.hs GHCi, version 8.1.20161030: http://www.haskell.org/ghc/ :? for help [1 of 1] Compiling Tree ( Tree.hs, interpreted ) Tree.hs:29:63: error: • Could not deduce: Payload ('S n1) (Payload n1 s1) ~ s arising from a use of ‘SBranchX’ from the context: m1 ~ 'S n1 bound by a pattern with constructor: Branch :: forall a (n :: Peano). a -> HTree n (HTree ('S n) a) -> HTree ('S n) a, in an equation for ‘nest’ at Tree.hs:29:7-51 • In the second argument of ‘($)’, namely ‘a `SBranchX` tr’ In the expression: Hide $ a `SBranchX` tr In an equation for ‘nest’: nest (Hide a `Branch` (nest . hmap nest -> Hide tr)) = Hide $ a `SBranchX` tr • Relevant bindings include tr :: STree n1 (STree ('S n1) (STree ('S ('S n1)) f)) s1 (bound at Tree.hs:29:49) a :: STree ('S m1) f s (bound at Tree.hs:29:12) nest :: HTree m1 (Hidden ('S m1) f) -> Hidden m1 (STree ('S m1) f) (bound at Tree.hs:27:1) Failed, modules loaded: none. }}} Please review... (and consider the note above) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12785#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler