module Grisette.Internal.SymPrim.IntBitwidth (intBitwidthQ) where
import Data.Bits (FiniteBits (finiteBitSize))
import Language.Haskell.TH (TyLit (NumTyLit), Type (LitT), TypeQ)
intBitwidthQ :: TypeQ
intBitwidthQ :: TypeQ
intBitwidthQ =
Type -> TypeQ
forall a. a -> Q a
forall (m :: * -> *) a. Monad m => a -> m a
return (Type -> TypeQ) -> Type -> TypeQ
forall a b. (a -> b) -> a -> b
$ TyLit -> Type
LitT (Integer -> TyLit
NumTyLit (Integer -> TyLit) -> Integer -> TyLit
forall a b. (a -> b) -> a -> b
$ Int -> Integer
forall a. Integral a => a -> Integer
toInteger (Int -> Integer) -> Int -> Integer
forall a b. (a -> b) -> a -> b
$ Int -> Int
forall b. FiniteBits b => b -> Int
finiteBitSize (Int
forall a. HasCallStack => a
undefined :: Int))