{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}

module Taiwan.ID.CharIndex
  ( CharIndex (..)
  )
  where

-- | Specifies the zero-based position of a character within a string.
--
newtype CharIndex = CharIndex Int
  deriving stock (ReadPrec [CharIndex]
ReadPrec CharIndex
Int -> ReadS CharIndex
ReadS [CharIndex]
(Int -> ReadS CharIndex)
-> ReadS [CharIndex]
-> ReadPrec CharIndex
-> ReadPrec [CharIndex]
-> Read CharIndex
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS CharIndex
readsPrec :: Int -> ReadS CharIndex
$creadList :: ReadS [CharIndex]
readList :: ReadS [CharIndex]
$creadPrec :: ReadPrec CharIndex
readPrec :: ReadPrec CharIndex
$creadListPrec :: ReadPrec [CharIndex]
readListPrec :: ReadPrec [CharIndex]
Read, Int -> CharIndex -> ShowS
[CharIndex] -> ShowS
CharIndex -> String
(Int -> CharIndex -> ShowS)
-> (CharIndex -> String)
-> ([CharIndex] -> ShowS)
-> Show CharIndex
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CharIndex -> ShowS
showsPrec :: Int -> CharIndex -> ShowS
$cshow :: CharIndex -> String
show :: CharIndex -> String
$cshowList :: [CharIndex] -> ShowS
showList :: [CharIndex] -> ShowS
Show)
  deriving newtype (Int -> CharIndex
CharIndex -> Int
CharIndex -> [CharIndex]
CharIndex -> CharIndex
CharIndex -> CharIndex -> [CharIndex]
CharIndex -> CharIndex -> CharIndex -> [CharIndex]
(CharIndex -> CharIndex)
-> (CharIndex -> CharIndex)
-> (Int -> CharIndex)
-> (CharIndex -> Int)
-> (CharIndex -> [CharIndex])
-> (CharIndex -> CharIndex -> [CharIndex])
-> (CharIndex -> CharIndex -> [CharIndex])
-> (CharIndex -> CharIndex -> CharIndex -> [CharIndex])
-> Enum CharIndex
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: CharIndex -> CharIndex
succ :: CharIndex -> CharIndex
$cpred :: CharIndex -> CharIndex
pred :: CharIndex -> CharIndex
$ctoEnum :: Int -> CharIndex
toEnum :: Int -> CharIndex
$cfromEnum :: CharIndex -> Int
fromEnum :: CharIndex -> Int
$cenumFrom :: CharIndex -> [CharIndex]
enumFrom :: CharIndex -> [CharIndex]
$cenumFromThen :: CharIndex -> CharIndex -> [CharIndex]
enumFromThen :: CharIndex -> CharIndex -> [CharIndex]
$cenumFromTo :: CharIndex -> CharIndex -> [CharIndex]
enumFromTo :: CharIndex -> CharIndex -> [CharIndex]
$cenumFromThenTo :: CharIndex -> CharIndex -> CharIndex -> [CharIndex]
enumFromThenTo :: CharIndex -> CharIndex -> CharIndex -> [CharIndex]
Enum, CharIndex -> CharIndex -> Bool
(CharIndex -> CharIndex -> Bool)
-> (CharIndex -> CharIndex -> Bool) -> Eq CharIndex
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CharIndex -> CharIndex -> Bool
== :: CharIndex -> CharIndex -> Bool
$c/= :: CharIndex -> CharIndex -> Bool
/= :: CharIndex -> CharIndex -> Bool
Eq, Integer -> CharIndex
CharIndex -> CharIndex
CharIndex -> CharIndex -> CharIndex
(CharIndex -> CharIndex -> CharIndex)
-> (CharIndex -> CharIndex -> CharIndex)
-> (CharIndex -> CharIndex -> CharIndex)
-> (CharIndex -> CharIndex)
-> (CharIndex -> CharIndex)
-> (CharIndex -> CharIndex)
-> (Integer -> CharIndex)
-> Num CharIndex
forall a.
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (Integer -> a)
-> Num a
$c+ :: CharIndex -> CharIndex -> CharIndex
+ :: CharIndex -> CharIndex -> CharIndex
$c- :: CharIndex -> CharIndex -> CharIndex
- :: CharIndex -> CharIndex -> CharIndex
$c* :: CharIndex -> CharIndex -> CharIndex
* :: CharIndex -> CharIndex -> CharIndex
$cnegate :: CharIndex -> CharIndex
negate :: CharIndex -> CharIndex
$cabs :: CharIndex -> CharIndex
abs :: CharIndex -> CharIndex
$csignum :: CharIndex -> CharIndex
signum :: CharIndex -> CharIndex
$cfromInteger :: Integer -> CharIndex
fromInteger :: Integer -> CharIndex
Num, Eq CharIndex
Eq CharIndex =>
(CharIndex -> CharIndex -> Ordering)
-> (CharIndex -> CharIndex -> Bool)
-> (CharIndex -> CharIndex -> Bool)
-> (CharIndex -> CharIndex -> Bool)
-> (CharIndex -> CharIndex -> Bool)
-> (CharIndex -> CharIndex -> CharIndex)
-> (CharIndex -> CharIndex -> CharIndex)
-> Ord CharIndex
CharIndex -> CharIndex -> Bool
CharIndex -> CharIndex -> Ordering
CharIndex -> CharIndex -> CharIndex
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: CharIndex -> CharIndex -> Ordering
compare :: CharIndex -> CharIndex -> Ordering
$c< :: CharIndex -> CharIndex -> Bool
< :: CharIndex -> CharIndex -> Bool
$c<= :: CharIndex -> CharIndex -> Bool
<= :: CharIndex -> CharIndex -> Bool
$c> :: CharIndex -> CharIndex -> Bool
> :: CharIndex -> CharIndex -> Bool
$c>= :: CharIndex -> CharIndex -> Bool
>= :: CharIndex -> CharIndex -> Bool
$cmax :: CharIndex -> CharIndex -> CharIndex
max :: CharIndex -> CharIndex -> CharIndex
$cmin :: CharIndex -> CharIndex -> CharIndex
min :: CharIndex -> CharIndex -> CharIndex
Ord)