{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveGeneric #-}
module GHC.ByteOrder where
#include <ghcautoconf.h>
import GHC.Generics (Generic)
data ByteOrder
= BigEndian
| LittleEndian
deriving ( ByteOrder -> ByteOrder -> Bool
(ByteOrder -> ByteOrder -> Bool)
-> (ByteOrder -> ByteOrder -> Bool) -> Eq ByteOrder
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ByteOrder -> ByteOrder -> Bool
== :: ByteOrder -> ByteOrder -> Bool
$c/= :: ByteOrder -> ByteOrder -> Bool
/= :: ByteOrder -> ByteOrder -> Bool
Eq
, Eq ByteOrder
Eq ByteOrder
-> (ByteOrder -> ByteOrder -> Ordering)
-> (ByteOrder -> ByteOrder -> Bool)
-> (ByteOrder -> ByteOrder -> Bool)
-> (ByteOrder -> ByteOrder -> Bool)
-> (ByteOrder -> ByteOrder -> Bool)
-> (ByteOrder -> ByteOrder -> ByteOrder)
-> (ByteOrder -> ByteOrder -> ByteOrder)
-> Ord ByteOrder
ByteOrder -> ByteOrder -> Bool
ByteOrder -> ByteOrder -> Ordering
ByteOrder -> ByteOrder -> ByteOrder
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: ByteOrder -> ByteOrder -> Ordering
compare :: ByteOrder -> ByteOrder -> Ordering
$c< :: ByteOrder -> ByteOrder -> Bool
< :: ByteOrder -> ByteOrder -> Bool
$c<= :: ByteOrder -> ByteOrder -> Bool
<= :: ByteOrder -> ByteOrder -> Bool
$c> :: ByteOrder -> ByteOrder -> Bool
> :: ByteOrder -> ByteOrder -> Bool
$c>= :: ByteOrder -> ByteOrder -> Bool
>= :: ByteOrder -> ByteOrder -> Bool
$cmax :: ByteOrder -> ByteOrder -> ByteOrder
max :: ByteOrder -> ByteOrder -> ByteOrder
$cmin :: ByteOrder -> ByteOrder -> ByteOrder
min :: ByteOrder -> ByteOrder -> ByteOrder
Ord
, ByteOrder
ByteOrder -> ByteOrder -> Bounded ByteOrder
forall a. a -> a -> Bounded a
$cminBound :: ByteOrder
minBound :: ByteOrder
$cmaxBound :: ByteOrder
maxBound :: ByteOrder
Bounded
, Int -> ByteOrder
ByteOrder -> Int
ByteOrder -> [ByteOrder]
ByteOrder -> ByteOrder
ByteOrder -> ByteOrder -> [ByteOrder]
ByteOrder -> ByteOrder -> ByteOrder -> [ByteOrder]
(ByteOrder -> ByteOrder)
-> (ByteOrder -> ByteOrder)
-> (Int -> ByteOrder)
-> (ByteOrder -> Int)
-> (ByteOrder -> [ByteOrder])
-> (ByteOrder -> ByteOrder -> [ByteOrder])
-> (ByteOrder -> ByteOrder -> [ByteOrder])
-> (ByteOrder -> ByteOrder -> ByteOrder -> [ByteOrder])
-> Enum ByteOrder
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: ByteOrder -> ByteOrder
succ :: ByteOrder -> ByteOrder
$cpred :: ByteOrder -> ByteOrder
pred :: ByteOrder -> ByteOrder
$ctoEnum :: Int -> ByteOrder
toEnum :: Int -> ByteOrder
$cfromEnum :: ByteOrder -> Int
fromEnum :: ByteOrder -> Int
$cenumFrom :: ByteOrder -> [ByteOrder]
enumFrom :: ByteOrder -> [ByteOrder]
$cenumFromThen :: ByteOrder -> ByteOrder -> [ByteOrder]
enumFromThen :: ByteOrder -> ByteOrder -> [ByteOrder]
$cenumFromTo :: ByteOrder -> ByteOrder -> [ByteOrder]
enumFromTo :: ByteOrder -> ByteOrder -> [ByteOrder]
$cenumFromThenTo :: ByteOrder -> ByteOrder -> ByteOrder -> [ByteOrder]
enumFromThenTo :: ByteOrder -> ByteOrder -> ByteOrder -> [ByteOrder]
Enum
, ReadPrec [ByteOrder]
ReadPrec ByteOrder
Int -> ReadS ByteOrder
ReadS [ByteOrder]
(Int -> ReadS ByteOrder)
-> ReadS [ByteOrder]
-> ReadPrec ByteOrder
-> ReadPrec [ByteOrder]
-> Read ByteOrder
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS ByteOrder
readsPrec :: Int -> ReadS ByteOrder
$creadList :: ReadS [ByteOrder]
readList :: ReadS [ByteOrder]
$creadPrec :: ReadPrec ByteOrder
readPrec :: ReadPrec ByteOrder
$creadListPrec :: ReadPrec [ByteOrder]
readListPrec :: ReadPrec [ByteOrder]
Read
, Int -> ByteOrder -> ShowS
[ByteOrder] -> ShowS
ByteOrder -> String
(Int -> ByteOrder -> ShowS)
-> (ByteOrder -> String)
-> ([ByteOrder] -> ShowS)
-> Show ByteOrder
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ByteOrder -> ShowS
showsPrec :: Int -> ByteOrder -> ShowS
$cshow :: ByteOrder -> String
show :: ByteOrder -> String
$cshowList :: [ByteOrder] -> ShowS
showList :: [ByteOrder] -> ShowS
Show
, (forall x. ByteOrder -> Rep ByteOrder x)
-> (forall x. Rep ByteOrder x -> ByteOrder) -> Generic ByteOrder
forall x. Rep ByteOrder x -> ByteOrder
forall x. ByteOrder -> Rep ByteOrder x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ByteOrder -> Rep ByteOrder x
$cto :: forall x. Rep ByteOrder x -> ByteOrder
Generic
)
targetByteOrder :: ByteOrder
#if defined(WORDS_BIGENDIAN)
targetByteOrder = BigEndian
#else
targetByteOrder :: ByteOrder
targetByteOrder = ByteOrder
LittleEndian
#endif