This code:
import Data.Binary
import qualified Data.ByteString.Internal as BS (c2w, w2c)
import qualified Data.ByteString.Lazy as B
import Data.Int
main :: IO ()
main = do
B.putStr $ encode $ (0x01020304 :: Int32)
produces this output on my machine (run through xxd):
00000000: 0102 0304 ....
which tells me that it is output in big endian order, but I have an x86_64 system, so... what's going on?