You are looking for something like this: https://hackage.haskell.org/package/cpu-0.1.0/docs/System-Endian.html
If you do not want / cannot use these packages, looking at the source code for the above, you can see how to check compliance on any platform with (almost) any lower-level programming language such as C or similar. Fill part of your stack (for a machine with 4 bits: for example, 1000), and then read the LSB or MSB of the specified stack. Endianness will determine how it is stored (you will read 1000 or 0001).
source share