[Haskell-cafe] Word32 to Int converions
Mark Carroll
mark at ixod.org
Wed Jul 20 07:52:01 EDT 2005
On Wed, 20 Jul 2005, yin wrote:
> Bernard Pope wrote:
>
> >On Wed, 2005-07-20 at 11:43 +0200, yin wrote:
> >
> >>
> >>how do I convert an Word32 (or WordXYZ) to Int, or Integer, or Float,
> >>...? The Int conversion is the priority.
> >>
> >>
> >fromIntegral to convert to an instance of Integral, such as Int, Integer
> >etc
> >
> Thank you, but how to "Work32 -> Int"?
Note that this compiles:
foo :: Word32 -> Int
foo = fromIntegral
fromIntegral really is what you want.
-- Mark
More information about the Haskell-Cafe
mailing list