[GHC] #15806: Impredicativity behavior in `:k` command in GHCi

#15806: Impredicativity behavior in `:k` command in GHCi -------------------------------------+------------------------------------- Reporter: ningning | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.6.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: #14859 Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- In GHCi, the following command works: {{{#!hs Prelude> :set -XRankNTypes Prelude> :k (Maybe (forall a. a -> a)) (Maybe (forall a. a -> a)) :: * }}} Note here the type argument of `Maybe` is a polymorphic type. However the following would be (correctly) rejected: {{{#!hs Prelude> let f :: (Maybe (forall a. a -> a)) -> Int; f _ = 1 <interactive>:4:10: error: • Illegal polymorphic type: forall a. a -> a GHC doesn't yet support impredicative polymorphism • In the type signature: f :: (Maybe (forall a. a -> a)) -> Int }}} Question: why does `:k` behave differently and is it what is expected? I think if we have #14859 those are both acceptable though? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15806 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15806: Impredicativity behavior in `:k` command in GHCi -------------------------------------+------------------------------------- Reporter: ningning | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.6.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #14859 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): I think the `:k` should be rejected to -- maybe we are missing a call to `checkValidType` somewhere? Yes if we had explicit impredicativity we should be ok -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15806#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15806: Impredicativity behavior in `:k` command in GHCi -------------------------------------+------------------------------------- Reporter: ningning | Owner: ningning Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.6.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #14859 | Differential Rev(s): Phab:D5265 Wiki Page: | -------------------------------------+------------------------------------- Changes (by ningning): * owner: (none) => ningning * differential: => Phab:D5265 Comment: Yes that's exactly the reason! Just pushed a patch. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15806#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15806: Impredicativity behavior in `:k` command in GHCi -------------------------------------+------------------------------------- Reporter: ningning | Owner: ningning Type: bug | Status: merge Priority: normal | Milestone: 8.6.2 Component: Compiler | Version: 8.6.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #14859 | Differential Rev(s): Phab:D5265 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => merge * milestone: => 8.6.2 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15806#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15806: Impredicativity behavior in `:k` command in GHCi
-------------------------------------+-------------------------------------
Reporter: ningning | Owner: ningning
Type: bug | Status: merge
Priority: normal | Milestone: 8.6.2
Component: Compiler | Version: 8.6.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: #14859 | Differential Rev(s): Phab:D5265
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#15806: Impredicativity behavior in `:k` command in GHCi -------------------------------------+------------------------------------- Reporter: ningning | Owner: ningning Type: bug | Status: closed Priority: normal | Milestone: 8.6.2 Component: Compiler | Version: 8.6.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #14859 | Differential Rev(s): Phab:D5265 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: Merged to `ghc-8.6` with 804518f703076829aa1f5206beaf83e4c1e0c68f. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15806#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC