[GHC] #14354: Unexpected type inference behavior with -XTypeApplications

GHC ghc-devs at haskell.org
Mon Oct 16 00:36:50 UTC 2017


#14354: Unexpected type inference behavior with -XTypeApplications
-------------------------------------+-------------------------------------
        Reporter:  mbw               |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  8.2.1
  checker)                           |
      Resolution:                    |             Keywords:
Operating System:  POSIX             |         Architecture:  x86_64
                                     |  (amd64)
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by goldfire):

 This is expected behavior. The
 [https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html
 #visible-type-application relevant section] of the GHC manual includes
 this sentence:

 > If the function is an identifier (the common case), its type is
 considered known only when the identifier has been given a type signature.
 If the identifier does not have a type signature, visible type application
 cannot be used.

 I know this behavior can be unintuitive, but it seems that it's the best
 we can do. If you want to know more about ''why'' this is the case, you
 will find the answers in
 [https://repository.brynmawr.edu/cgi/viewcontent.cgi?article=1001&context=compsci_pubs
 the original paper].

 The panic you report is due to an unrelated, fixed bug.

 If you're satisfied with this answer, please close the ticket. Thanks for
 reporting!

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


More information about the ghc-tickets mailing list