[GHC] #9901: Error message: f is applied to two arguments, but its type has only two (sic)
GHC
ghc-devs at haskell.org
Mon Jan 26 12:02:46 UTC 2015
#9901: Error message: f is applied to two arguments, but its type has only two
(sic)
-------------------------------------+-------------------------------------
Reporter: zardoz | Owner:
Type: bug | Status: new
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: | Differential Revisions:
-------------------------------------+-------------------------------------
Comment (by zardoz):
I’ve updated the attachment. Hopefully this should go through with just
«base» installed.
I’m out of my depth on the language pragmas. I added them as requested by
GHC when mocking the respective types. The error message seems to be the
same as before.
This program yields me:
{{{
test.hs:22:17:
Couldn't match type ‘Either String Int’ with ‘Maybe a0’
Expected type: Either a1 [Char] -> Either String Int
Actual type: Either a1 [Char] -> Maybe a0
The function ‘preview’ is applied to two arguments,
but its type ‘Getting (Data.Monoid.First a0) s0 a0
-> Either a1 [Char] -> Maybe a0’
has only two
In the second argument of ‘($)’, namely
‘(preview _Left (Right "abc") :: Either String Int)’
In the expression:
print $ (preview _Left (Right "abc") :: Either String Int)
Failed, modules loaded: none.
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9901#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list