#4191: Replace -fstrict-dicts with programmer-custom strictness annotations for
class contexts
---------------------------------+------------------------------------------
    Reporter:  LouisWasserman    |        Owner:              
        Type:  feature request   |       Status:  new         
    Priority:  normal            |    Milestone:              
   Component:  Compiler          |      Version:  6.12.3      
    Keywords:                    |   Difficulty:              
          Os:  Unknown/Multiple  |     Testcase:              
Architecture:  Unknown/Multiple  |      Failure:  None/Unknown
---------------------------------+------------------------------------------

Comment(by LouisWasserman):

 At the moment, there are two styles of workaround available without
 -fstrict-dicts:

 {{{
 instance SizeT [] where
         getSizeT xs = getSize' `seq` sum [getSize' x | x <- xs] where
                 getSize' = getSize
 }}}

 or

 {{{
 instance SizeT [] where
         getSizeT xs = sum [getSize' x | x <- xs] where
                 {-# NOINLINE getSize' #-}
                 getSize' = getSize
 }}}

 Both of these are awkward, and noticeably, neither of these is equivalent
 to forcing the dictionary -- the type of getSize' may be specialized when
 I want it at the full generality available from the dictionary.  (I'll try
 to cook up a small example for this use case, but I'm running into that
 case in my package.)

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4191#comment:9>
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