I want to convert between different integral types; e.g. Word32 and Word8.
What is the idiomatic way to do this in Haskell?
Word8 -> Converting Word32 can always be successful. Converting Word32 -> Word8 can lead to overflow, and I will deal with this (either by checking explicitly, or by getting directions from any conversion idiom).
integer haskell
Ben clifford
source share