[GHC] #15872: Odd pretty printing of equality constraint in kind ('GHC.Types.Eq# <>)

GHC ghc-devs at haskell.org
Fri Dec 7 15:13:11 UTC 2018


#15872: Odd pretty printing of equality constraint in kind ('GHC.Types.Eq# <>)
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:  (none)
            Type:  bug               |               Status:  patch
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.6.2
      Resolution:                    |             Keywords:  TypeInType
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Poor/confusing    |  Unknown/Multiple
  error message                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #12102, #13933    |  Differential Rev(s):  Phab:D5397
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Ryan Scott <ryan.gl.scott@…>):

 In [changeset:"73cce63f33ee80f5095085141df9313ac70d1cfa/ghc"
 73cce63f/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="73cce63f33ee80f5095085141df9313ac70d1cfa"
 Fix #12102/#15872 by removing outdated users' guide prose

 Summary:
 In the beginning, #12102 (and #15872, which is of a similar
 ilk) were caused by a poor, confused user trying to use code that
 looks like this (with a constraint in the kind of a data type):

 ```lang=haskell
 type family IsTypeLit a where
   IsTypeLit Nat    = 'True
   IsTypeLit Symbol = 'True
   IsTypeLit a      = 'False

 data T :: forall a. (IsTypeLit a ~ 'True) => a -> * where
   MkNat    :: T 42
   MkSymbol :: T "Don't panic!"
 ```

 Many bizarre GHC quirks (documented in those tickets) arose from
 this sort of construction. Ultimately, the use of constraints in
 data type kinds like this has made a lot of people very confused and
 been widely regarded as a bad move.

 Commit 2257a86daa72db382eb927df12a718669d5491f8 finally put this
 feature out of its misery, so now the code above simply errors with
 `Illegal constraint in a kind`. As a result, the aforementioned
 tickets are moot, so this patch wraps a bow on the whole thing by:

 1. Removing the (now outdated) section on constraints in data type
    kinds from the users' guide, and
 2. Adding a test case to test this code path.

 Test Plan: make test TEST=T12102

 Reviewers: goldfire, simonpj, bgamari, tdammers

 Reviewed By: tdammers

 Subscribers: tdammers, rwbarton, carter

 GHC Trac Issues: #12102, #15872

 Differential Revision: https://phabricator.haskell.org/D5397
 }}}

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15872#comment:6>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list