[GHC] #8672: :browse and roles on typefamilies

#8672: :browse and roles on typefamilies -------------------------------------+------------------------------------- Reporter: monoidal | Owner: Type: bug | Status: new Priority: low | Milestone: Component: Compiler (Type | Version: 7.7 checker) | Operating System: Unknown/Multiple Keywords: | Type of failure: Incorrect Architecture: Unknown/Multiple | warning at compile-time Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | -------------------------------------+------------------------------------- :browse on `ghci tests/ghci.debugger/scripts/T8557.hs` outputs a weird looking line: {{{ type role Sing nominal data family Sing (a :: k) type role T8557.R:Sing[]a nominal <-- data instance Sing a = SNil }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8672 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8672: :browse and roles on typefamilies -------------------------------------------------+------------------------- Reporter: monoidal | Owner: Type: bug | goldfire Priority: low | Status: new Component: Compiler (Type checker) | Milestone: Resolution: | Version: 7.7 Operating System: Unknown/Multiple | Keywords: Type of failure: Incorrect warning at | Architecture: compile-time | Unknown/Multiple Test Case: | Difficulty: Blocking: | Unknown | Blocked By: | Related Tickets: -------------------------------------------------+------------------------- Changes (by simonpj): * owner: => goldfire Comment: The reason this is happening is because `SNil` is defined, so GHC is showing the appropriate `data instance`. Then it tries to show the roles of the data instance, and does so badly. Richard, two questions. First in this case, can't the data instance have a representational role inferred? Eg this ought to work. The definition of `g` is currently rejected. {{{ data family T a data instance T [b] = MkT b newtype Age = MkAge Int g :: T [Age] -> T [Int] g x = coerce x }}} Second question. Are role annotations allowed on data family declarations, where they could indicate which parameters are the indices: {{{ type role T representational nominal -- Only second param can be an index data family T a b data instance T a Bool = ... -- Allowed data instance T Bool b = ... -- Rejected }}} (And similarly for type families.) Similarly are role annotations allowed on data instance declarations, where they would be useful in exactly the same way that they are on data decls {{{ data family T a type role T [a] (a:nominal) data instance T [a] = MkT a }}} Here we are running out of syntax! This isn't supported now because I think all parameters are automatically nominal (see point 1 for why they shouldn't be). Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8672#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8672: :browse and roles on typefamilies
-------------------------------------------------+-------------------------
Reporter: monoidal | Owner:
Type: bug | goldfire
Priority: low | Status: new
Component: Compiler (Type checker) | Milestone:
Resolution: | Version: 7.7
Operating System: Unknown/Multiple | Keywords:
Type of failure: Incorrect warning at | Architecture:
compile-time | Unknown/Multiple
Test Case: | Difficulty:
Blocking: | Unknown
| Blocked By:
| Related Tickets:
-------------------------------------------------+-------------------------
Comment (by Simon Peyton Jones

#8672: :browse and roles on typefamilies -------------------------------------------------+------------------------- Reporter: monoidal | Owner: Type: bug | goldfire Priority: low | Status: new Component: Compiler (Type checker) | Milestone: Resolution: | Version: 7.7 Operating System: Unknown/Multiple | Keywords: Type of failure: Incorrect warning at | Architecture: compile-time | Unknown/Multiple Test Case: | Difficulty: Blocking: | Unknown | Blocked By: | Related Tickets: -------------------------------------------------+------------------------- Comment (by goldfire): I've moved the conversation about roles on data instances to #8177, where it is more relevant. Please see that ticket for further information. Perhaps this ticket should stay open as a reminder to revisit `:browse` and `:info` if/when data instance role annotations are added. Is there a test case? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8672#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8672: :browse and roles on typefamilies -------------------------------------+------------------------------------- Reporter: monoidal | Owner: goldfire Type: bug | Status: closed Priority: low | Milestone: Component: Compiler | Version: 7.7 (Type checker) | Keywords: Resolution: fixed | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: Incorrect | Related Tickets: warning at compile-time | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by goldfire): * status: new => closed * resolution: => fixed Comment: Leaving this ticket open doesn't seem to serve a purpose any more. I made a comment on #8177. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8672#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC