{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
module System.CPUFeatures.Util where
import Data.Kind
import Unsafe.Coerce

type SBool :: Bool -> Type
data SBool x where
  STrue :: SBool True
  SFalse :: SBool False

unsafeBoolToSBool :: Bool -> SBool a
unsafeBoolToSBool :: forall (a :: Bool). Bool -> SBool a
unsafeBoolToSBool Bool
True = SBool 'True -> SBool a
forall a b. a -> b
unsafeCoerce SBool 'True
STrue
unsafeBoolToSBool Bool
False = SBool 'False -> SBool a
forall a b. a -> b
unsafeCoerce SBool 'False
SFalse

type Dict :: Constraint -> Type
data Dict c = c => Dict