{-# language MagicHash #-}

-- This is actually used with both GHC 8.10 and with GHC 9.0.
-- The name of the directory is a little misleading.
module Compat
  ( int8ToInt#
  , int16ToInt#
  , int32ToInt#
  , wordToWord8#
  , wordToWord16#
  , wordToWord32#
  , word8ToWord#
  , word16ToWord#
  , word32ToWord#
  ) where

import GHC.Exts (Int#,Word#)

int8ToInt# :: Int# -> Int#
{-# inline int8ToInt# #-}
int8ToInt# :: Int# -> Int#
int8ToInt# Int#
x = Int#
x

int16ToInt# :: Int# -> Int#
{-# inline int16ToInt# #-}
int16ToInt# :: Int# -> Int#
int16ToInt# Int#
x = Int#
x

int32ToInt# :: Int# -> Int#
{-# inline int32ToInt# #-}
int32ToInt# :: Int# -> Int#
int32ToInt# Int#
x = Int#
x

wordToWord8# :: Word# -> Word#
{-# inline wordToWord8# #-}
wordToWord8# :: Word# -> Word#
wordToWord8#  Word#
x = Word#
x

wordToWord16# :: Word# -> Word#
{-# inline wordToWord16# #-}
wordToWord16# :: Word# -> Word#
wordToWord16# Word#
x = Word#
x

wordToWord32# :: Word# -> Word#
{-# inline wordToWord32# #-}
wordToWord32# :: Word# -> Word#
wordToWord32# Word#
x = Word#
x

word8ToWord# :: Word# -> Word#
{-# inline word8ToWord# #-}
word8ToWord# :: Word# -> Word#
word8ToWord# Word#
x = Word#
x

word16ToWord# :: Word# -> Word#
{-# inline word16ToWord# #-}
word16ToWord# :: Word# -> Word#
word16ToWord# Word#
x = Word#
x

word32ToWord# :: Word# -> Word#
{-# inline word32ToWord# #-}
word32ToWord# :: Word# -> Word#
word32ToWord# Word#
x = Word#
x