[GHC] #12363: Type application for infix

GHC ghc-devs at haskell.org
Fri Nov 10 11:19:43 UTC 2017


#12363: Type application for infix
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:  (none)
            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 AntC):

 I'm perturbed by the type argument appearing after the infix operator;
 whereas with a prefixed function the type argument comes first. In

 {{{
 instance Eq a => Eq [a] where
   ...
   (x:xs) == (y:ys) = x == @a y && xs == @[a] ys
 }}}

 the prefix form would put `@a` before `x` So my brain has to parse that as
 `x (== @a) y`.

 Shouldn't it be like this

 {{{
   (x:xs) == (y:ys) = @a x == y && @[a] xs ==  ys
 }}}

 I notice in @dredozubov's #14446, the `@"foo"` comes before the operator.

 As to whether the syntax becomes less scary from looking through the
 examples: no, to me it still looks like perl or Teco.

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


More information about the ghc-tickets mailing list