[GHC] #12879: (xs -> xs) wrongly suggests TypeApplications

GHC ghc-devs at haskell.org
Thu Dec 15 22:21:39 UTC 2016


#12879: (xs -> xs) wrongly suggests TypeApplications
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Poor/confusing    |  Unknown/Multiple
  error message                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by zyla):

 I believe this is fixed in HEAD:

 {{{
 GHCi, version 8.1.20161209: http://www.haskell.org/ghc/  :? for help
 Prelude> map (xs -> xs)

 <interactive>:1:6: error:
     Pattern syntax in expression context: xs -> xs
 Prelude>
 }}}

 But there's another issue - the message still appears when using as-
 patterns when TypeApplications is already enabled:

 {{{
 Prelude> :set -XTypeApplications
 Prelude> map (xs at xs)

 <interactive>:19:6: error:
     Pattern syntax in expression context: xs at xs
     Did you mean to enable TypeApplications?
 }}}

 Perhaps replacing it with `Type application syntax requires a space before
 '@'` is a good idea in this case?

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


More information about the ghc-tickets mailing list