| Turns out that I need a larger example to trigger the bug. I can
| reliable trigger it using the unordered-containers library. I won't bore
| you with the details. The workaround I need is this:
|
| forall x. integerToWord (smallInteger x) = int2Word# x
So why not just add that rule (perha
Hi,
Turns out that I need a larger example to trigger the bug. I can
reliable trigger it using the unordered-containers library. I won't
bore you with the details. The workaround I need is this:
forall x. integerToWord (smallInteger x) = int2Word# x
__
On Montag, 17. Dezember 2012, 07:07:21, Johan Tibell wrote:
> This compiles badly in 7.4.2:
>
> f :: Int -> Word
> f = fromIntegral
>
> I need a workaround.
Mine produces (with optimisations, of course)
Convert.f :: GHC.Types.Int -> GHC.Word.Word
[GblId,
Arity=1,
Caf=NoCafRefs,
Str=D
t; | -Original Message-
> | From: glasgow-haskell-users-boun...@haskell.org [mailto:glasgow-haskell-
> | users-boun...@haskell.org] On Behalf Of Johan Tibell
> | Sent: 14 December 2012 23:17
> | To: glasgow-haskell-users
> | Subject: Need workaround for lack of fromIntegral/Int->W
| 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__)
| i
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 #