
14 Dec
2012
14 Dec
'12
6:16 p.m.
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