notes

Haskell notes

stdin and stdout translate LF to CRLF on Windows because they are text-mode Handles.

putChar used to print the value mod 256 as a byte.

ghc --show-iface file.hi dumps an interface file in human-readable form. The .h source cannot be recovered from a .hi/.o pair.

Default values for localeEncoding: On Linux it is the LANG and LC_* environment variables. On Windows it is code page.

Int is guaranteed to have at least the range [-2^29 .. 2^29) [Haskell 98; Haskell 2010]

(fromInteger n) :: Int wraps n to be within minBound :: Int and maxBound :: Int with twos-complement, likewise for types other than Int (it is not saturating and does not error) [Haskell mailing list, Feb 2002]

Relevant GHC changelog

Changes related to I/O, especially encodings, arbitrary-precision integers, and building GHC: