[GHC] #13401: GHCi gives conflicting information about visible type application

GHC ghc-devs at haskell.org
Fri Mar 10 01:58:27 UTC 2017


#13401: GHCi gives conflicting information about visible type application
-------------------------------------+-------------------------------------
        Reporter:  crockeea          |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  GHCi              |              Version:  8.0.1
      Resolution:                    |             Keywords:
                                     |  TypeApplications
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #11376, #11975    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by goldfire):

 I agree with Ryan's explanations. `:type expr` gives you the type that
 would be assigned to `x` if you say `let x = expr`. `:type +v expr` gives
 you the type of `expr`.

 One challenge here is that `foo` ''does'' have type `forall {k}. k`. It
 also has type `forall k. k`. It also has type `Int`. One challenge in a
 type system like Haskell's is that an expression has many types.

 All this said, I do agree with @crockeea's suggestions to clarify the
 documentation.

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


More information about the ghc-tickets mailing list