[GHC] #8815: confusing language in error message

GHC ghc-devs at haskell.org
Sat Feb 22 17:56:34 UTC 2014


#8815: confusing language in error message
------------------------------------+-------------------------------------
       Reporter:  carter            |             Owner:
           Type:  bug               |            Status:  new
       Priority:  normal            |         Milestone:
      Component:  Compiler          |           Version:  7.8.1-rc1
       Keywords:                    |  Operating System:  Unknown/Multiple
   Architecture:  Unknown/Multiple  |   Type of failure:  None/Unknown
     Difficulty:  Unknown           |         Test Case:
     Blocked By:                    |          Blocking:
Related Tickets:                    |
------------------------------------+-------------------------------------
 Late last night I was finding myself very confused by the following (in
 retrospect obvious error message)
 {{{
 src/Numerical/OpenBLAS/BLAS.hs:41:44:
     A pattern match on a GADT requires GADTs or TypeFamilies
     In the pattern: SRow
     In the pattern: DenseMatrix SRow _ _ _ _
     In an equation for ‛encodeNiceOrderHelper’:
         encodeNiceOrderHelper (DenseMatrix SRow _ _ _ _)
           = encodeOrder BLASRowMajor
 }}}

 the error is correct per se, but reading (at least late at night) made me
 think "wait, how is my type not a GADT or TypeFamily?!!?!"

 I'm thinking (perhaps ) that

 ``` A pattern match on a GADT requires GADTs or TypeFamilies `` `

 could perhaps be more clearly communicated as

 ```A pattern match on a GADT requires that GADTs or TypeFamilies Language
 extensions be enabled in the use site module``` (or something similar)

 relatedly: whats the current reasoning for why GADT related matching logic
 isn't enabled in client modules that use GADTs? (i'm not questioning it,
 just wondering why)

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


More information about the ghc-tickets mailing list