#5059: Pragma to SPECIALISE on value arguments
---------------------------------+------------------------------------------
    Reporter:  batterseapower    |        Owner:              
        Type:  feature request   |       Status:  new         
    Priority:  normal            |    Milestone:  7.4.1       
   Component:  Compiler          |      Version:  7.0.3       
    Keywords:                    |     Testcase:              
   Blockedby:                    |   Difficulty:              
          Os:  Unknown/Multiple  |     Blocking:              
Architecture:  Unknown/Multiple  |      Failure:  None/Unknown
---------------------------------+------------------------------------------

Comment(by simonpj):

 Here's another example where I'd like to write a specialise-on-value
 pragma.  Consider equality on lists:
 {{{
 eqList [] [] = True
 eqList (x:xs) [] = False
 eqList [] (y:ys) = False
 eqList (x:xs) (y:ys) = x==y && eqList xs ys
 }}}
 I'd like to specialise on the empty list
 {{{
 {-# SPECIALISE eqList [] xs #-}
 {#- SPECIALISE eqList xs [] #-}
 }}}
 because in each case the result boils down to `null`, and that's great at
 the call sites.  This shows up in `string_of` in nofib `spectral/rewrite`.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5059#comment:8>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to