[GHC] #15080: List Operators Sorted by Precedence in GHCi

#15080: List Operators Sorted by Precedence in GHCi -------------------------------------+------------------------------------- Reporter: sjs | Owner: (none) Type: feature | Status: new request | Priority: normal | Milestone: 8.6.1 Component: GHCi | Version: 8.2.2 Keywords: operator | Operating System: Unknown/Multiple precedence | Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- In a large project, it can be difficult to keep track of the precedence of operators. It would be a nice quality-of-life improvement if there were a GHCi command to list the current operators in scope by precedence. It could list them in a table like this: {{{ :operators | prec | nonassoc | leftassoc | rightassoc | |------+----------+-----------+------------| | 9 | !! | | . | | 8 | | | ^ ^^ ** | | 7 | * / | | | | 6 | + - | | | | 5 | | | : ++ | | 4 | | == | | }}} Perhaps it could list all infix operators, as well as functions that have a fixity declaration? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15080 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15080: List Operators Sorted by Precedence in GHCi -------------------------------------+------------------------------------- Reporter: sjs | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 8.6.1 Component: GHCi | Version: 8.2.2 Resolution: | Keywords: operator | precedence, 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: | -------------------------------------+------------------------------------- Changes (by bgamari): * keywords: operator precedence => operator precedence, newcomer Comment: Indeed this does look quite handy. Moreover, it should be pretty easy to implement; perhaps you are interested in giving it a shot? I'm happy to advise. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15080#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15080: List Operators Sorted by Precedence in GHCi -------------------------------------+------------------------------------- Reporter: sjs | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 8.6.1 Component: GHCi | Version: 8.2.2 Resolution: | Keywords: operator | precedence, 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 goldfire): Should this be a [https://github.com/ghc-proposals/ghc-proposals/ ghc- proposal] first? I agree that this looks lovely and would likely be warmly welcomed. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15080#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15080: List Operators Sorted by Precedence in GHCi -------------------------------------+------------------------------------- Reporter: sjs | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 8.6.1 Component: GHCi | Version: 8.2.2 Resolution: | Keywords: operator | precedence, 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 bgamari): A good question; I suppose it wouldn't hurt. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15080#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15080: List Operators Sorted by Precedence in GHCi -------------------------------------+------------------------------------- Reporter: sjs | Owner: | artemohanjanyan Type: feature request | Status: new Priority: normal | Milestone: 8.6.1 Component: GHCi | Version: 8.2.2 Resolution: | Keywords: operator | precedence, 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: | -------------------------------------+------------------------------------- Changes (by artemohanjanyan): * owner: (none) => artemohanjanyan -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15080#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15080: List Operators Sorted by Precedence in GHCi -------------------------------------+------------------------------------- Reporter: sjs | Owner: | artemohanjanyan Type: feature request | Status: new Priority: normal | Milestone: 8.8.1 Component: GHCi | Version: 8.2.2 Resolution: | Keywords: operator | precedence, 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: | -------------------------------------+------------------------------------- Changes (by sjs): * Attachment "0001-Adds-fixities-GHCi-command.patch" added. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15080 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15080: List Operators Sorted by Precedence in GHCi -------------------------------------+------------------------------------- Reporter: sjs | Owner: | artemohanjanyan Type: feature request | Status: new Priority: normal | Milestone: 8.8.1 Component: GHCi | Version: 8.2.2 Resolution: | Keywords: operator | precedence, 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 sjs): The current iteration of this is really simple, it adds a `:fixities` command to GHCi that shows a table of all functions in scope with non- default fixities. With just the Prelude loaded, here's the output: {{{ Prelude> :fixities 9: right: . 8: right: ^ ** ^^ 7: left: * / div mod quot rem 6: left: + - right: <> 5: right: ++ 4: left: <*> *> <$ <* <$> none: elem >= == /= < <= > notElem 3: right: && 2: right: || 1: left: >>= >> right: =<< 0: right: $ seq $! }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15080#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC