[GHC] #12363: Type application for infix

GHC ghc-devs at haskell.org
Wed Jan 18 17:53:47 UTC 2017


#12363: Type application for infix
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:
            Type:  feature request   |               Status:  new
        Priority:  lowest            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
  (Parser)                           |             Keywords:
      Resolution:                    |  TypeApplications
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by goldfire):

 Replying to [comment:18 rwbarton]:
 > I know the manual says you can write things like `f x @Bool` meaning `(f
 x) @Bool` if `f` has a suitable type, though I wonder if there are any
 real uses for that.

 One plausible-sounding scenario is in specializing a polymorphic function
 accessed by a record selector:

 {{{#!hs
 data Mon'd m = MkMon'd { ret'rn :: forall a. a -> m a }

 f :: Mon'd m -> ...
 f dict ... = ... ret'rn dict @Int ...
 }}}

 But, yes, frequently the function applied to type parameters is just an
 identifier.

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


More information about the ghc-tickets mailing list