[GHC] #11275: :kind! doesn't reduce type families with poly-kinded return kinds

#11275: :kind! doesn't reduce type families with poly-kinded return kinds -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.10.3 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: -------------------------------------+------------------------------------- Originally discovered [https://mail.haskell.org/pipermail/ghc- devs/2015-December/010831.html here], here is a simplified example: {{{ $ ghci GHCi, version 7.10.3: http://www.haskell.org/ghc/ :? for help λ> :set -XPolyKinds -XTypeFamilies λ> type family Hm :: k where Hm = Int λ> :kind! Hm Hm :: k = Hm }}} Giving `Hm` a monomorphic return kind of `*` makes it work with `:kind!`: {{{ $ ghci GHCi, version 7.10.3: http://www.haskell.org/ghc/ :? for help λ> :set -XTypeFamilies λ> type family Hm :: * where Hm = Int λ> :kind! Hm Hm :: * = Int }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11275 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11275: :kind! doesn't reduce type families with poly-kinded return kinds -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.10.3 Resolution: | 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 rwbarton): Isn't this correct behavior? In the first case `Hm` could be at any kind, and it's not equal to `Int` for any kind other than `*`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11275#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11275: :kind! doesn't reduce type families with poly-kinded return kinds -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: GHCi | Version: 7.10.3 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: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => closed * resolution: => invalid Comment: Oh, that is a very good point, and GHCi agrees with you: {{{ $ /opt/ghc/head/bin/ghci GHCi, version 7.11.20151220: http://www.haskell.org/ghc/ :? for help λ> :set -XPolyKinds -XTypeFamilies λ> type family Hm :: k where Hm = Int λ> :kind! (Hm :: *) (Hm :: *) :: * = Int }}} I just didn't realize that `Hm = Int` forced the return kind to be `*`, which made `Hm` incomplete, since it doesn't have cases for return kinds other than `*`. I'd probably have been less likely to make this mistake if #10116 was fixed, but that's a separate issue. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11275#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC