module Opaleye.Internal.Tag where
newtype Tag = UnsafeTag Int deriving (ReadPrec [Tag]
ReadPrec Tag
Int -> ReadS Tag
ReadS [Tag]
(Int -> ReadS Tag)
-> ReadS [Tag] -> ReadPrec Tag -> ReadPrec [Tag] -> Read Tag
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Tag]
$creadListPrec :: ReadPrec [Tag]
readPrec :: ReadPrec Tag
$creadPrec :: ReadPrec Tag
readList :: ReadS [Tag]
$creadList :: ReadS [Tag]
readsPrec :: Int -> ReadS Tag
$creadsPrec :: Int -> ReadS Tag
Read, Int -> Tag -> ShowS
[Tag] -> ShowS
Tag -> String
(Int -> Tag -> ShowS)
-> (Tag -> String) -> ([Tag] -> ShowS) -> Show Tag
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Tag] -> ShowS
$cshowList :: [Tag] -> ShowS
show :: Tag -> String
$cshow :: Tag -> String
showsPrec :: Int -> Tag -> ShowS
$cshowsPrec :: Int -> Tag -> ShowS
Show)
start :: Tag
start :: Tag
start = Int -> Tag
UnsafeTag Int
1
next :: Tag -> Tag
next :: Tag -> Tag
next = Int -> Tag
UnsafeTag (Int -> Tag) -> (Tag -> Int) -> Tag -> Tag
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int -> Int -> Int
forall a. Num a => a -> a -> a
+Int
1) (Int -> Int) -> (Tag -> Int) -> Tag -> Int
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Tag -> Int
unsafeUnTag
unsafeUnTag :: Tag -> Int
unsafeUnTag :: Tag -> Int
unsafeUnTag (UnsafeTag Int
i) = Int
i
tagWith :: Tag -> String -> String
tagWith :: Tag -> ShowS
tagWith Tag
t String
s = String
s String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
"_" String -> ShowS
forall a. [a] -> [a] -> [a]
++ Int -> String
forall a. Show a => a -> String
show (Tag -> Int
unsafeUnTag Tag
t)