
#15740: Type family with higher-rank result is too accepting -------------------------------------+------------------------------------- Reporter: goldfire | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.6.1 Keywords: TypeFamilies, | Operating System: Unknown/Multiple TypeInType | Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- GHC accepts this garbage: {{{ type family F2 :: forall k. k -> Type data SBool :: Bool -> Type data Nat data SNat :: Nat -> Type type instance F2 = SBool type instance F2 = SNat }}} The family `F2` should have an arity of 0, meaning that only one instance is possible -- and the RHS of that instance must have kind `forall k. k -> Type`. In other words, even accepting only one of the instances above is hogwash. This is from comment:15:ticket:11719, but you don't have to read that to understand this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15740 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler