[GHC] #9901: Error message: f is applied to two arguments, but its type has only two (sic)

GHC ghc-devs at haskell.org
Sun Feb 1 21:08:26 UTC 2015


#9901: Error message: f is applied to two arguments, but its type has only two
(sic)
-------------------------------------+-------------------------------------
        Reporter:  zardoz            |                   Owner:
            Type:  bug               |                  Status:  infoneeded
        Priority:  normal            |               Milestone:
       Component:  Compiler (Type    |                 Version:  7.8.3
  checker)                           |                Keywords:
      Resolution:                    |            Architecture:
Operating System:  Unknown/Multiple  |  Unknown/Multiple
 Type of failure:  None/Unknown      |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:  #9605             |  Differential Revisions:
-------------------------------------+-------------------------------------
Changes (by Yuras):

 * status:  new => infoneeded
 * related:   => #9605


Comment:

 Thank you for the test case.

 That is what I get with HEAD:

 {{{#!haskell
 test.hs:22:17:
     Couldn't match type ‘Maybe a0’ with ‘Either String Int’
     Expected type: Either a1 [Char] -> Either String Int
       Actual type: Either a1 [Char] -> Maybe a0
     The function ‘preview’ is applied to two arguments,
     its type is ‘Getting (Data.Monoid.First a0) s0 a0
                  -> m0 (Maybe a0)’,
     it is specialized to ‘Getting (Data.Monoid.First a0) s0 a0
                           -> Either a1 [Char] -> Maybe a0’
     In the second argument of ‘($)’, namely
       ‘(preview _Left (Right "abc") :: Either String Int)’
     In the expression:
       print $ (preview _Left (Right "abc") :: Either String Int)
 }}}

 That looks right for me, so I'd say the issue is a duplicate.

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


More information about the ghc-tickets mailing list