[Haskell-cafe] Detecting system endianness
ryani.spam at gmail.com
Thu Dec 18 07:33:22 EST 2008
I think something like this might work:
Prelude GHC.Exts GHC.Word> let W64# x = 0x100000002 in W32# (unsafeCoerce# x)
You should get 1 for big-endian and 2 for little-endian.
(Disclaimer: not particularily well-tested.)
On Thu, Dec 18, 2008 at 3:27 AM, Mauricio <briqueabraque at yahoo.com> wrote:
> Is there some way I can check the endianness
> of the machine my haskell code is running in?
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe