module UVMHS.Core.Data.Bitty where import UVMHS.Core.Init import UVMHS.Core.Classes import UVMHS.Core.Data.Arithmetic () import qualified Data.Bits as HS shiftL_shim ∷ (HS.Bits a) ⇒ a → ℕ64 → a shiftL_shim :: forall a. Bits a => a -> ℕ64 -> a shiftL_shim a x ℕ64 n = a -> Int -> a forall a. Bits a => a -> Int -> a HS.shiftL a x (Int -> a) -> Int -> a forall a b. (a -> b) -> a -> b $ ℤ64 -> Int forall a b. CHS a b => a -> b tohs (ℤ64 -> Int) -> ℤ64 -> Int forall a b. (a -> b) -> a -> b $ ℕ64 -> ℤ64 forall a. (ToIntO64 a, STACK) => a -> ℤ64 intΩ64 ℕ64 n shiftR_shim ∷ (HS.Bits a) ⇒ a → ℕ64 → a shiftR_shim :: forall a. Bits a => a -> ℕ64 -> a shiftR_shim a x ℕ64 n = a -> Int -> a forall a. Bits a => a -> Int -> a HS.shiftR a x (Int -> a) -> Int -> a forall a b. (a -> b) -> a -> b $ ℤ64 -> Int forall a b. CHS a b => a -> b tohs (ℤ64 -> Int) -> ℤ64 -> Int forall a b. (a -> b) -> a -> b $ ℕ64 -> ℤ64 forall a. (ToIntO64 a, STACK) => a -> ℤ64 intΩ64 ℕ64 n bsize_shim ∷ ∀ a. (HS.FiniteBits a) ⇒ P a → ℕ64 bsize_shim :: forall a. FiniteBits a => P a -> ℕ64 bsize_shim P a _ = ℤ64 -> ℕ64 forall a. (ToNatO64 a, STACK) => a -> ℕ64 natΩ64 (ℤ64 -> ℕ64) -> ℤ64 -> ℕ64 forall a b. (a -> b) -> a -> b $ Int -> ℤ64 forall a b. CHS a b => b -> a frhs (Int -> ℤ64) -> Int -> ℤ64 forall a b. (a -> b) -> a -> b $ forall b. FiniteBits b => b -> Int HS.finiteBitSize @a a forall a. STACK => a undefined instance BitZero 𝔹 where bzero :: 𝔹 bzero = 𝔹 forall a. Bits a => a HS.zeroBits instance BitOne 𝔹 where bone :: 𝔹 bone = 𝔹 True instance BitComp 𝔹 where comp :: 𝔹 -> 𝔹 comp = 𝔹 -> 𝔹 forall a. Bits a => a -> a HS.complement instance BitAnd 𝔹 where ⟑ :: 𝔹 -> 𝔹 -> 𝔹 (⟑) = 𝔹 -> 𝔹 -> 𝔹 forall a. Bits a => a -> a -> a (HS..&.) instance BitOr 𝔹 where ⟇ :: 𝔹 -> 𝔹 -> 𝔹 (⟇) = 𝔹 -> 𝔹 -> 𝔹 forall a. Bits a => a -> a -> a (HS..|.) instance BitXor 𝔹 where ⊻ :: 𝔹 -> 𝔹 -> 𝔹 (⊻) = 𝔹 -> 𝔹 -> 𝔹 forall a. Bits a => a -> a -> a HS.xor instance BitShiftL 𝔹 where ⋘ :: 𝔹 -> ℕ64 -> 𝔹 (⋘) = 𝔹 -> ℕ64 -> 𝔹 forall a. Bits a => a -> ℕ64 -> a shiftL_shim instance BitShiftR 𝔹 where ⋙ :: 𝔹 -> ℕ64 -> 𝔹 (⋙) = 𝔹 -> ℕ64 -> 𝔹 forall a. Bits a => a -> ℕ64 -> a shiftR_shim instance BitSize 𝔹 where bsize :: P 𝔹 -> ℕ64 bsize = P 𝔹 -> ℕ64 forall a. FiniteBits a => P a -> ℕ64 bsize_shim instance Bitty 𝔹 instance BitZero ℕ64 where bzero :: ℕ64 bzero = ℕ64 forall a. Bits a => a HS.zeroBits instance BitOne ℕ64 where bone :: ℕ64 bone = ℕ64 forall a. One a => a one instance BitComp ℕ64 where comp :: ℕ64 -> ℕ64 comp = ℕ64 -> ℕ64 forall a. Bits a => a -> a HS.complement instance BitAnd ℕ64 where ⟑ :: ℕ64 -> ℕ64 -> ℕ64 (⟑) = ℕ64 -> ℕ64 -> ℕ64 forall a. Bits a => a -> a -> a (HS..&.) instance BitOr ℕ64 where ⟇ :: ℕ64 -> ℕ64 -> ℕ64 (⟇) = ℕ64 -> ℕ64 -> ℕ64 forall a. Bits a => a -> a -> a (HS..|.) instance BitXor ℕ64 where ⊻ :: ℕ64 -> ℕ64 -> ℕ64 (⊻) = ℕ64 -> ℕ64 -> ℕ64 forall a. Bits a => a -> a -> a HS.xor instance BitShiftL ℕ64 where ⋘ :: ℕ64 -> ℕ64 -> ℕ64 (⋘) = ℕ64 -> ℕ64 -> ℕ64 forall a. Bits a => a -> ℕ64 -> a shiftL_shim instance BitShiftR ℕ64 where ⋙ :: ℕ64 -> ℕ64 -> ℕ64 (⋙) = ℕ64 -> ℕ64 -> ℕ64 forall a. Bits a => a -> ℕ64 -> a shiftR_shim instance BitSize ℕ64 where bsize :: P ℕ64 -> ℕ64 bsize = P ℕ64 -> ℕ64 forall a. FiniteBits a => P a -> ℕ64 bsize_shim instance Bitty ℕ64 instance BitZero ℕ32 where bzero :: ℕ32 bzero = ℕ32 forall a. Bits a => a HS.zeroBits instance BitOne ℕ32 where bone :: ℕ32 bone = ℕ32 forall a. One a => a one instance BitComp ℕ32 where comp :: ℕ32 -> ℕ32 comp = ℕ32 -> ℕ32 forall a. Bits a => a -> a HS.complement instance BitAnd ℕ32 where ⟑ :: ℕ32 -> ℕ32 -> ℕ32 (⟑) = ℕ32 -> ℕ32 -> ℕ32 forall a. Bits a => a -> a -> a (HS..&.) instance BitOr ℕ32 where ⟇ :: ℕ32 -> ℕ32 -> ℕ32 (⟇) = ℕ32 -> ℕ32 -> ℕ32 forall a. Bits a => a -> a -> a (HS..|.) instance BitXor ℕ32 where ⊻ :: ℕ32 -> ℕ32 -> ℕ32 (⊻) = ℕ32 -> ℕ32 -> ℕ32 forall a. Bits a => a -> a -> a HS.xor instance BitShiftL ℕ32 where ⋘ :: ℕ32 -> ℕ64 -> ℕ32 (⋘) = ℕ32 -> ℕ64 -> ℕ32 forall a. Bits a => a -> ℕ64 -> a shiftL_shim instance BitShiftR ℕ32 where ⋙ :: ℕ32 -> ℕ64 -> ℕ32 (⋙) = ℕ32 -> ℕ64 -> ℕ32 forall a. Bits a => a -> ℕ64 -> a shiftR_shim instance BitSize ℕ32 where bsize :: P ℕ32 -> ℕ64 bsize = P ℕ32 -> ℕ64 forall a. FiniteBits a => P a -> ℕ64 bsize_shim instance Bitty ℕ32 instance BitZero ℕ16 where bzero :: ℕ16 bzero = ℕ16 forall a. Bits a => a HS.zeroBits instance BitOne ℕ16 where bone :: ℕ16 bone = ℕ16 forall a. One a => a one instance BitComp ℕ16 where comp :: ℕ16 -> ℕ16 comp = ℕ16 -> ℕ16 forall a. Bits a => a -> a HS.complement instance BitAnd ℕ16 where ⟑ :: ℕ16 -> ℕ16 -> ℕ16 (⟑) = ℕ16 -> ℕ16 -> ℕ16 forall a. Bits a => a -> a -> a (HS..&.) instance BitOr ℕ16 where ⟇ :: ℕ16 -> ℕ16 -> ℕ16 (⟇) = ℕ16 -> ℕ16 -> ℕ16 forall a. Bits a => a -> a -> a (HS..|.) instance BitXor ℕ16 where ⊻ :: ℕ16 -> ℕ16 -> ℕ16 (⊻) = ℕ16 -> ℕ16 -> ℕ16 forall a. Bits a => a -> a -> a HS.xor instance BitShiftL ℕ16 where ⋘ :: ℕ16 -> ℕ64 -> ℕ16 (⋘) = ℕ16 -> ℕ64 -> ℕ16 forall a. Bits a => a -> ℕ64 -> a shiftL_shim instance BitShiftR ℕ16 where ⋙ :: ℕ16 -> ℕ64 -> ℕ16 (⋙) = ℕ16 -> ℕ64 -> ℕ16 forall a. Bits a => a -> ℕ64 -> a shiftR_shim instance BitSize ℕ16 where bsize :: P ℕ16 -> ℕ64 bsize = P ℕ16 -> ℕ64 forall a. FiniteBits a => P a -> ℕ64 bsize_shim instance Bitty ℕ16 instance BitZero ℕ8 where bzero :: ℕ8 bzero = ℕ8 forall a. Bits a => a HS.zeroBits instance BitOne ℕ8 where bone :: ℕ8 bone = ℕ8 forall a. One a => a one instance BitComp ℕ8 where comp :: ℕ8 -> ℕ8 comp = ℕ8 -> ℕ8 forall a. Bits a => a -> a HS.complement instance BitAnd ℕ8 where ⟑ :: ℕ8 -> ℕ8 -> ℕ8 (⟑) = ℕ8 -> ℕ8 -> ℕ8 forall a. Bits a => a -> a -> a (HS..&.) instance BitOr ℕ8 where ⟇ :: ℕ8 -> ℕ8 -> ℕ8 (⟇) = ℕ8 -> ℕ8 -> ℕ8 forall a. Bits a => a -> a -> a (HS..|.) instance BitXor ℕ8 where ⊻ :: ℕ8 -> ℕ8 -> ℕ8 (⊻) = ℕ8 -> ℕ8 -> ℕ8 forall a. Bits a => a -> a -> a HS.xor instance BitShiftL ℕ8 where ⋘ :: ℕ8 -> ℕ64 -> ℕ8 (⋘) = ℕ8 -> ℕ64 -> ℕ8 forall a. Bits a => a -> ℕ64 -> a shiftL_shim instance BitShiftR ℕ8 where ⋙ :: ℕ8 -> ℕ64 -> ℕ8 (⋙) = ℕ8 -> ℕ64 -> ℕ8 forall a. Bits a => a -> ℕ64 -> a shiftR_shim instance BitSize ℕ8 where bsize :: P ℕ8 -> ℕ64 bsize = P ℕ8 -> ℕ64 forall a. FiniteBits a => P a -> ℕ64 bsize_shim instance Bitty ℕ8 instance BitZero ℤ64 where bzero :: ℤ64 bzero = ℤ64 forall a. Bits a => a HS.zeroBits instance BitOne ℤ64 where bone :: ℤ64 bone = ℤ64 forall a. One a => a one instance BitComp ℤ64 where comp :: ℤ64 -> ℤ64 comp = ℤ64 -> ℤ64 forall a. Bits a => a -> a HS.complement instance BitAnd ℤ64 where ⟑ :: ℤ64 -> ℤ64 -> ℤ64 (⟑) = ℤ64 -> ℤ64 -> ℤ64 forall a. Bits a => a -> a -> a (HS..&.) instance BitOr ℤ64 where ⟇ :: ℤ64 -> ℤ64 -> ℤ64 (⟇) = ℤ64 -> ℤ64 -> ℤ64 forall a. Bits a => a -> a -> a (HS..|.) instance BitXor ℤ64 where ⊻ :: ℤ64 -> ℤ64 -> ℤ64 (⊻) = ℤ64 -> ℤ64 -> ℤ64 forall a. Bits a => a -> a -> a HS.xor instance BitShiftL ℤ64 where ⋘ :: ℤ64 -> ℕ64 -> ℤ64 (⋘) = ℤ64 -> ℕ64 -> ℤ64 forall a. Bits a => a -> ℕ64 -> a shiftL_shim instance BitShiftR ℤ64 where ⋙ :: ℤ64 -> ℕ64 -> ℤ64 (⋙) = ℤ64 -> ℕ64 -> ℤ64 forall a. Bits a => a -> ℕ64 -> a shiftR_shim instance BitSize ℤ64 where bsize :: P ℤ64 -> ℕ64 bsize = P ℤ64 -> ℕ64 forall a. FiniteBits a => P a -> ℕ64 bsize_shim instance Bitty ℤ64 instance BitZero ℤ32 where bzero :: ℤ32 bzero = ℤ32 forall a. Bits a => a HS.zeroBits instance BitOne ℤ32 where bone :: ℤ32 bone = ℤ32 forall a. One a => a one instance BitComp ℤ32 where comp :: ℤ32 -> ℤ32 comp = ℤ32 -> ℤ32 forall a. Bits a => a -> a HS.complement instance BitAnd ℤ32 where ⟑ :: ℤ32 -> ℤ32 -> ℤ32 (⟑) = ℤ32 -> ℤ32 -> ℤ32 forall a. Bits a => a -> a -> a (HS..&.) instance BitOr ℤ32 where ⟇ :: ℤ32 -> ℤ32 -> ℤ32 (⟇) = ℤ32 -> ℤ32 -> ℤ32 forall a. Bits a => a -> a -> a (HS..|.) instance BitXor ℤ32 where ⊻ :: ℤ32 -> ℤ32 -> ℤ32 (⊻) = ℤ32 -> ℤ32 -> ℤ32 forall a. Bits a => a -> a -> a HS.xor instance BitShiftL ℤ32 where ⋘ :: ℤ32 -> ℕ64 -> ℤ32 (⋘) = ℤ32 -> ℕ64 -> ℤ32 forall a. Bits a => a -> ℕ64 -> a shiftL_shim instance BitShiftR ℤ32 where ⋙ :: ℤ32 -> ℕ64 -> ℤ32 (⋙) = ℤ32 -> ℕ64 -> ℤ32 forall a. Bits a => a -> ℕ64 -> a shiftR_shim instance BitSize ℤ32 where bsize :: P ℤ32 -> ℕ64 bsize = P ℤ32 -> ℕ64 forall a. FiniteBits a => P a -> ℕ64 bsize_shim instance Bitty ℤ32 instance BitZero ℤ16 where bzero :: ℤ16 bzero = ℤ16 forall a. Bits a => a HS.zeroBits instance BitOne ℤ16 where bone :: ℤ16 bone = ℤ16 forall a. One a => a one instance BitComp ℤ16 where comp :: ℤ16 -> ℤ16 comp = ℤ16 -> ℤ16 forall a. Bits a => a -> a HS.complement instance BitAnd ℤ16 where ⟑ :: ℤ16 -> ℤ16 -> ℤ16 (⟑) = ℤ16 -> ℤ16 -> ℤ16 forall a. Bits a => a -> a -> a (HS..&.) instance BitOr ℤ16 where ⟇ :: ℤ16 -> ℤ16 -> ℤ16 (⟇) = ℤ16 -> ℤ16 -> ℤ16 forall a. Bits a => a -> a -> a (HS..|.) instance BitXor ℤ16 where ⊻ :: ℤ16 -> ℤ16 -> ℤ16 (⊻) = ℤ16 -> ℤ16 -> ℤ16 forall a. Bits a => a -> a -> a HS.xor instance BitShiftL ℤ16 where ⋘ :: ℤ16 -> ℕ64 -> ℤ16 (⋘) = ℤ16 -> ℕ64 -> ℤ16 forall a. Bits a => a -> ℕ64 -> a shiftL_shim instance BitShiftR ℤ16 where ⋙ :: ℤ16 -> ℕ64 -> ℤ16 (⋙) = ℤ16 -> ℕ64 -> ℤ16 forall a. Bits a => a -> ℕ64 -> a shiftR_shim instance BitSize ℤ16 where bsize :: P ℤ16 -> ℕ64 bsize = P ℤ16 -> ℕ64 forall a. FiniteBits a => P a -> ℕ64 bsize_shim instance Bitty ℤ16 instance BitZero ℤ8 where bzero :: ℤ8 bzero = ℤ8 forall a. Bits a => a HS.zeroBits instance BitOne ℤ8 where bone :: ℤ8 bone = ℤ8 forall a. One a => a one instance BitComp ℤ8 where comp :: ℤ8 -> ℤ8 comp = ℤ8 -> ℤ8 forall a. Bits a => a -> a HS.complement instance BitAnd ℤ8 where ⟑ :: ℤ8 -> ℤ8 -> ℤ8 (⟑) = ℤ8 -> ℤ8 -> ℤ8 forall a. Bits a => a -> a -> a (HS..&.) instance BitOr ℤ8 where ⟇ :: ℤ8 -> ℤ8 -> ℤ8 (⟇) = ℤ8 -> ℤ8 -> ℤ8 forall a. Bits a => a -> a -> a (HS..|.) instance BitXor ℤ8 where ⊻ :: ℤ8 -> ℤ8 -> ℤ8 (⊻) = ℤ8 -> ℤ8 -> ℤ8 forall a. Bits a => a -> a -> a HS.xor instance BitShiftL ℤ8 where ⋘ :: ℤ8 -> ℕ64 -> ℤ8 (⋘) = ℤ8 -> ℕ64 -> ℤ8 forall a. Bits a => a -> ℕ64 -> a shiftL_shim instance BitShiftR ℤ8 where ⋙ :: ℤ8 -> ℕ64 -> ℤ8 (⋙) = ℤ8 -> ℕ64 -> ℤ8 forall a. Bits a => a -> ℕ64 -> a shiftR_shim instance BitSize ℤ8 where bsize :: P ℤ8 -> ℕ64 bsize = P ℤ8 -> ℕ64 forall a. FiniteBits a => P a -> ℕ64 bsize_shim instance Bitty ℤ8