I don't understand the problem clearly enough to help.  Can you give a concrete 
example?

Simon

| -----Original Message-----
| From: [email protected] [mailto:glasgow-haskell-
| [email protected]] On Behalf Of Johan Tibell
| Sent: 14 December 2012 23:17
| To: glasgow-haskell-users
| Subject: Need workaround for lack of fromIntegral/Int->Word rules in
| 7.4.2
| 
| I'm trying to work around the lack of some fromIntegral/Int->Word rules
| in 7.4.2. I tried something like:
| 
| int2Word :: Int -> Word
| #if defined(__GLASGOW_HASKELL__)
| int2Word (I# i#) = W# (int2Word# i#)
| #else
| int2Word = fromIntegral
| #endif
| 
| {-# RULES "fromIntegral/Int->Word" fromIntegral = int2Word #-}
| 
| but that didn't work as some fromSmallInteger and integerToWord function
| calls got inserted before my rule had a chance to fire. Can anyone think
| of a workaround that would work with 7.4.2?
| 
| P.S. The reason I want this workaround is that some of my users are
| stuck on 7.4.2 and this regression is affecting them quite badly, making
| me want to try to fix it in my library.
| 
| Cheers,
| Johan
| 
| _______________________________________________
| Glasgow-haskell-users mailing list
| [email protected]
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


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

Reply via email to