[GHC] #14084: Strange behavior of GHC by writing the types in GHCi

GHC ghc-devs at haskell.org
Thu Aug 3 13:19:02 UTC 2017


#14084: Strange behavior of GHC by writing the types in GHCi
-------------------------------------+-------------------------------------
        Reporter:  vanto             |                Owner:  (none)
            Type:  bug               |               Status:  closed
        Priority:  normal            |            Milestone:
       Component:  GHCi              |              Version:  8.0.2
      Resolution:  invalid           |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Incorrect result  |  Unknown/Multiple
  at runtime                         |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by AntC):

 @vanto, I think you'll get better explanations if you post these kind of
 questions on StackOverflow, or the beginners forum. If the people there
 tell you to report a bug, then come to Trac. (For comparison, I've been
 using GHC for over 10 years. I've never felt a need to raise a bug.)

 Briefly: this behaviour is correct. When you go
 {{{
 Prelude> 1:2
 }}}

 You are asking to evaluate the expression. (As well as give its type.) To
 evaluate the expression, GHC must figure out its type. Its type is indeed
 not Haskell2010-conformant: it needs `FlexibleContexts`.

 Contrariwise, when you go
 {{{
 Prelude> :t ...
 }}}

 You are not asking to evaluate the expression. You are merely asking for
 its type. GHCi is being generous (I'd say) in telling you the type
 irrespective of whether that type is conformant with current
 settings/extensions.

 I see no bug.

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


More information about the ghc-tickets mailing list