[GHC] #12895: Lookup rules associated with functions/values in GHCI

GHC ghc-devs at haskell.org
Tue Nov 29 07:02:04 UTC 2016


#12895: Lookup rules associated with functions/values in GHCI
-------------------------------------+-------------------------------------
           Reporter:  harpocrates    |             Owner:
               Type:  feature        |            Status:  new
  request                            |
           Priority:  normal         |         Milestone:
          Component:  GHCi           |           Version:  8.0.1
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 It would be nice to have a way to look up in GHCi what rules can fire for
 a certain constant as the outmost symbol on the LHS. For example,
 something like

 {{{
 ghci> :pragmas map
 {-# RULE "map"         [~1] forall f xs. map f xs = build (\c n -> foldr
 (mapFB c f) n xs) #-}
 {-# RULE "map/coerce"  [1]               map coerce = coerce #-}
 }}}

 As the name suggests, I think we would also want to list applicable
 NOINLINE, INLINE, INLINABLE, CONLIKE, SPECIALIZE, etc pragmas too. This
 would simplify the process of debugging mis-firing rules.

 If this isn't too difficult, I'd love to try implementing it. I've been
 looking for some way of contributing to GHC.

 This initially came up here http://stackoverflow.com/q/38651602/3072788.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12895>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list