[GHC] #9394: Show data/type family instances with ghci's :info command

#9394: Show data/type family instances with ghci's :info command -------------------------------------+------------------------------------- Reporter: s9gf4ult | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.6.3 Keywords: ghci | Operating System: Architecture: Unknown/Multiple | Unknown/Multiple Difficulty: Unknown | Type of failure: Blocked By: | None/Unknown Related Tickets: | Test Case: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Current version of ghci (7.6.3) does not show data instances. For example, I have some Yesod application and I want to see all data constructors of (Route App) data family instance: {{{#!hs *Application> :info Route App class Eq (Route a) => yesod-routes-1.2.0.6:Yesod.Routes.Class.RenderRoute a where data family Route a1 ... -- Defined in `yesod-routes-1.2.0.6:Yesod.Routes.Class' instance Eq (Route App) -- Defined at Foundation.hs:48:1 instance Read (Route App) -- Defined at Foundation.hs:48:1 ................. }}} It just shows info about `Route`, then info about `App` separately. When I try this: {{{#!hs *Application> :info (Route App) <interactive>:1:2: parse error on input `Route' }}} I am getting parse error. I offer to use this syntax (with parentheses) to show info about instance of data/type family, namely, data constructors and such stuff, just like for ordinal `data`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9394 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9394: Show data/type family instances with ghci's :info command -------------------------------------+------------------------------------- Reporter: s9gf4ult | Owner: Type: feature | Status: new request | Milestone: Priority: normal | Version: 7.6.3 Component: GHCi | Keywords: ghci Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by simonpj): Dear s9gf4ult (I wonder who you are in real life?) That makes sense. For classes, actually `:info Eq` lists all the instances of `Eq`, so maybe that should happen for `type` and `data` families too? Then adding arguments could filter the list to just the instances that match the pattern given? Would you, or anyone else, like to specify the feature and offer a patch? Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9394#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9394: Show data/type family instances with ghci's :info command -------------------------------------+------------------------------------- Reporter: s9gf4ult | Owner: Type: feature | Status: new request | Milestone: Priority: normal | Version: 7.6.3 Component: GHCi | Keywords: ghci Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by s9gf4ult): Hello, Simon! Unfortunately, I have no experience with GHC code base to make a patch. What do you mean about "to specify the feature" ? My English is not native... In real life I am like a https://github.com/s9gf4ult (dont have good personal blog) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9394#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9394: Show data/type family instances with ghci's :info command -------------------------------------+------------------------------------- Reporter: s9gf4ult | Owner: Type: feature | Status: new request | Milestone: Priority: normal | Version: 7.6.3 Component: GHCi | Keywords: ghci Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by simonpj): OK great. Let's leave this open as a useful feature request. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9394#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9394: Show data/type family instances with ghci's :info command -------------------------------------+------------------------------------- Reporter: s9gf4ult | Owner: Type: feature | Status: new request | Milestone: Priority: normal | Version: 7.6.3 Component: GHCi | Keywords: ghci Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by rodlogic): * cc: rodlogic (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9394#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9394: Show data/type family instances with ghci's :info command -------------------------------------+------------------------------------- Reporter: s9gf4ult | Owner: Type: feature | Status: new request | Milestone: Priority: normal | Version: 7.6.3 Component: GHCi | Keywords: ghci newcomer Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by goldfire): * keywords: ghci => ghci newcomer -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9394#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9394: Show data/type family instances with ghci's :info command -------------------------------------+------------------------------------- Reporter: s9gf4ult | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.6.3 Resolution: | Keywords: ghci Operating System: Unknown/Multiple | newcomer Type of failure: None/Unknown | Architecture: Blocked By: | Unknown/Multiple Related Tickets: | Test Case: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by javran): Newcomer here. I'm interested in this issue. Not sure about the difficulty, so I'll just give some of my thoughts and see if it works out. Currently `:info` isn't doing a good job parsing its arguments, it simply uses `words` to separate arguments so that for `:info (Route App)`, what will `:info` really see is two separated arguments: `(Route` and `App)`. I think the first step is to have some better handling on `:info`, maybe allowing it to accept a list of either names (as before) or type applications (use parentheses to disambiguate it from names). And then we can probably leverage some type checking facilities to help filtering out instances. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9394#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9394: Show data/type family instances with ghci's :info command -------------------------------------+------------------------------------- Reporter: s9gf4ult | Owner: javran Type: feature request | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.6.3 Resolution: | Keywords: ghci Operating System: Unknown/Multiple | newcomer Type of failure: None/Unknown | Architecture: Blocked By: | Unknown/Multiple Related Tickets: | Test Case: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by javran): * owner: => javran -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9394#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9394: Show data/type family instances with ghci's :info command -------------------------------------+------------------------------------- Reporter: s9gf4ult | Owner: javran Type: feature request | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.6.3 Resolution: | Keywords: ghci newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by thomie): javran: did you make any progress with this ticket? Maybe just some notes that you could contribute, such that someone else can take over? Come over to the #ghc irc channel if you need help, there are usually people around all day there. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9394#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

javran: did you make any progress with this ticket? Maybe just some notes that you could contribute, such that someone else can take over? Come over to the #ghc irc channel if you need help, there are usually
#9394: Show data/type family instances with ghci's :info command -------------------------------------+------------------------------------- Reporter: s9gf4ult | Owner: javran Type: feature request | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.6.3 Resolution: | Keywords: ghci newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by javran): Replying to [comment:8 thomie]: people around all day there. Sorry I didn't have time to contribute since I have owned this ticket. I'm just about to continue working this. Previously I sent an email to goldfire and he suggested to begin with writing up new wiki page about the plan -- will do it as a start point. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9394#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC