{-# language Safe #-}
module D10.Predicate where
import Numeric.Natural (Natural)
isD10Char :: Char -> Bool
isD10Char :: Char -> Bool
isD10Char Char
x = Char
x Char -> Char -> Bool
forall a. Ord a => a -> a -> Bool
>= Char
'0' Bool -> Bool -> Bool
&& Char
x Char -> Char -> Bool
forall a. Ord a => a -> a -> Bool
<= Char
'9'
isD10Str :: String -> Bool
isD10Str :: String -> Bool
isD10Str [Char
x] = Char -> Bool
isD10Char Char
x
isD10Str String
_ = Bool
False
isD10ListStr :: String -> Bool
isD10ListStr :: String -> Bool
isD10ListStr = (Char -> Bool) -> String -> Bool
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Bool
all Char -> Bool
isD10Char
isD10Nat :: Natural -> Bool
isD10Nat :: Natural -> Bool
isD10Nat Natural
x = Natural
x Natural -> Natural -> Bool
forall a. Ord a => a -> a -> Bool
<= Natural
9
isD10Integer :: Integer -> Bool
isD10Integer :: Integer -> Bool
isD10Integer Integer
x = Integer
x Integer -> Integer -> Bool
forall a. Ord a => a -> a -> Bool
>= Integer
0 Bool -> Bool -> Bool
&& Integer
x Integer -> Integer -> Bool
forall a. Ord a => a -> a -> Bool
<= Integer
9
isD10Int :: Int -> Bool
isD10Int :: Int -> Bool
isD10Int Int
x = Int
x Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>= Int
0 Bool -> Bool -> Bool
&& Int
x Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
<= Int
9
isD10Integral :: Integral a => a -> Bool
isD10Integral :: a -> Bool
isD10Integral a
x = Integer -> Bool
isD10Integer (a -> Integer
forall a. Integral a => a -> Integer
toInteger a
x)