[GHC] #13853: TypeApplications and record syntax don't mix

GHC ghc-devs at haskell.org
Tue Jun 20 16:32:42 UTC 2017


#13853: TypeApplications and record syntax don't mix
-------------------------------------+-------------------------------------
           Reporter:  RyanGlScott    |             Owner:  (none)
               Type:  feature        |            Status:  new
  request                            |
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.1
           Keywords:                 |  Operating System:  Unknown/Multiple
  TypeApplications                   |
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 Let's fire up GHCi:

 {{{
 $ ~/Software/ghc-8.2.0.20170507/bin/ghci
 GHCi, version 8.2.0.20170507: http://www.haskell.org/ghc/  :? for help
 Loaded GHCi configuration from /Users/rscott/.ghci
 λ> :set -XTypeApplications -fprint-explicit-foralls
 λ> import Data.Functor.Identity
 }}}

 I can use `TypeApplications` on `Identity` like so:

 {{{
 λ> Identity @Int 42
 Identity 42
 }}}

 But not if I try to use record syntax:

 {{{
 λ> Identity @Int { runIdentity = 42 }

 <interactive>:4:15: error: parse error on input ‘{’
 λ> (Identity @Int) { runIdentity = 42 }

 <interactive>:7:1: error:
     • Couldn't match expected type ‘Identity a0’
                   with actual type ‘Int -> Identity Int’
     • In the expression: (Identity @Int) {runIdentity = 42}
       In an equation for ‘it’: it = (Identity @Int) {runIdentity = 42}
 }}}

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


More information about the ghc-tickets mailing list