{-# LANGUAGE CPP #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
{-# OPTIONS_HADDOCK hide #-}
#include "MachDeps.h"
module Clash.Class.NumConvert.Internal.Canonical where
import Clash.Promoted.Nat (SNat)
import Clash.Sized.BitVector
import Clash.Sized.Index
import Clash.Sized.Signed
import Clash.Sized.Unsigned
import Data.Int (Int16, Int32, Int64, Int8)
import Data.Word (Word16, Word32, Word64, Word8)
import GHC.TypeLits (type (+))
type family Canonical a
type instance Canonical Word = Unsigned WORD_SIZE_IN_BITS
type instance Canonical Word64 = Unsigned 64
type instance Canonical Word32 = Unsigned 32
type instance Canonical Word16 = Unsigned 16
type instance Canonical Word8 = Unsigned 8
type instance Canonical Int = Signed WORD_SIZE_IN_BITS
type instance Canonical Int64 = Signed 64
type instance Canonical Int32 = Signed 32
type instance Canonical Int16 = Signed 16
type instance Canonical Int8 = Signed 8
type instance Canonical Bit = BitVector 1
type instance Canonical (SNat n) = Index (n + 1)
type instance Canonical (Unsigned n) = Unsigned n
type instance Canonical (Signed n) = Signed n
type instance Canonical (BitVector n) = BitVector n
type instance Canonical (Index n) = Index n