module PostgresqlSyntax.Ast.ConstTypename where
import PostgresqlSyntax.Algebra
import PostgresqlSyntax.Ast.Bit (Bit)
import PostgresqlSyntax.Ast.ConstCharacter
import PostgresqlSyntax.Ast.ConstDatetime
import PostgresqlSyntax.Ast.Numeric
import PostgresqlSyntax.Prelude
import qualified Test.QuickCheck as Qc
data ConstTypename
= NumericConstTypename Numeric
| ConstBitConstTypename Bit
| ConstCharacterConstTypename ConstCharacter
| ConstDatetimeConstTypename ConstDatetime
deriving (Int -> ConstTypename -> ShowS
[ConstTypename] -> ShowS
ConstTypename -> String
(Int -> ConstTypename -> ShowS)
-> (ConstTypename -> String)
-> ([ConstTypename] -> ShowS)
-> Show ConstTypename
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ConstTypename -> ShowS
showsPrec :: Int -> ConstTypename -> ShowS
$cshow :: ConstTypename -> String
show :: ConstTypename -> String
$cshowList :: [ConstTypename] -> ShowS
showList :: [ConstTypename] -> ShowS
Show, (forall x. ConstTypename -> Rep ConstTypename x)
-> (forall x. Rep ConstTypename x -> ConstTypename)
-> Generic ConstTypename
forall x. Rep ConstTypename x -> ConstTypename
forall x. ConstTypename -> Rep ConstTypename x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ConstTypename -> Rep ConstTypename x
from :: forall x. ConstTypename -> Rep ConstTypename x
$cto :: forall x. Rep ConstTypename x -> ConstTypename
to :: forall x. Rep ConstTypename x -> ConstTypename
Generic, ConstTypename -> ConstTypename -> Bool
(ConstTypename -> ConstTypename -> Bool)
-> (ConstTypename -> ConstTypename -> Bool) -> Eq ConstTypename
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ConstTypename -> ConstTypename -> Bool
== :: ConstTypename -> ConstTypename -> Bool
$c/= :: ConstTypename -> ConstTypename -> Bool
/= :: ConstTypename -> ConstTypename -> Bool
Eq, Eq ConstTypename
Eq ConstTypename =>
(ConstTypename -> ConstTypename -> Ordering)
-> (ConstTypename -> ConstTypename -> Bool)
-> (ConstTypename -> ConstTypename -> Bool)
-> (ConstTypename -> ConstTypename -> Bool)
-> (ConstTypename -> ConstTypename -> Bool)
-> (ConstTypename -> ConstTypename -> ConstTypename)
-> (ConstTypename -> ConstTypename -> ConstTypename)
-> Ord ConstTypename
ConstTypename -> ConstTypename -> Bool
ConstTypename -> ConstTypename -> Ordering
ConstTypename -> ConstTypename -> ConstTypename
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 :: ConstTypename -> ConstTypename -> Ordering
compare :: ConstTypename -> ConstTypename -> Ordering
$c< :: ConstTypename -> ConstTypename -> Bool
< :: ConstTypename -> ConstTypename -> Bool
$c<= :: ConstTypename -> ConstTypename -> Bool
<= :: ConstTypename -> ConstTypename -> Bool
$c> :: ConstTypename -> ConstTypename -> Bool
> :: ConstTypename -> ConstTypename -> Bool
$c>= :: ConstTypename -> ConstTypename -> Bool
>= :: ConstTypename -> ConstTypename -> Bool
$cmax :: ConstTypename -> ConstTypename -> ConstTypename
max :: ConstTypename -> ConstTypename -> ConstTypename
$cmin :: ConstTypename -> ConstTypename -> ConstTypename
min :: ConstTypename -> ConstTypename -> ConstTypename
Ord, Typeable ConstTypename
Typeable ConstTypename =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ConstTypename -> c ConstTypename)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ConstTypename)
-> (ConstTypename -> Constr)
-> (ConstTypename -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ConstTypename))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ConstTypename))
-> ((forall b. Data b => b -> b) -> ConstTypename -> ConstTypename)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ConstTypename -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ConstTypename -> r)
-> (forall u. (forall d. Data d => d -> u) -> ConstTypename -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> ConstTypename -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ConstTypename -> m ConstTypename)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConstTypename -> m ConstTypename)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConstTypename -> m ConstTypename)
-> Data ConstTypename
ConstTypename -> Constr
ConstTypename -> DataType
(forall b. Data b => b -> b) -> ConstTypename -> ConstTypename
forall a.
Typeable a =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> ConstTypename -> u
forall u. (forall d. Data d => d -> u) -> ConstTypename -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ConstTypename -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ConstTypename -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ConstTypename -> m ConstTypename
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConstTypename -> m ConstTypename
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ConstTypename
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ConstTypename -> c ConstTypename
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ConstTypename)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ConstTypename)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ConstTypename -> c ConstTypename
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ConstTypename -> c ConstTypename
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ConstTypename
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ConstTypename
$ctoConstr :: ConstTypename -> Constr
toConstr :: ConstTypename -> Constr
$cdataTypeOf :: ConstTypename -> DataType
dataTypeOf :: ConstTypename -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ConstTypename)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ConstTypename)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ConstTypename)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ConstTypename)
$cgmapT :: (forall b. Data b => b -> b) -> ConstTypename -> ConstTypename
gmapT :: (forall b. Data b => b -> b) -> ConstTypename -> ConstTypename
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ConstTypename -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ConstTypename -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ConstTypename -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ConstTypename -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ConstTypename -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> ConstTypename -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ConstTypename -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ConstTypename -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ConstTypename -> m ConstTypename
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ConstTypename -> m ConstTypename
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConstTypename -> m ConstTypename
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConstTypename -> m ConstTypename
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConstTypename -> m ConstTypename
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConstTypename -> m ConstTypename
Data)
instance IsAst ConstTypename where
toTextBuilder :: Settings -> ConstTypename -> TextBuilder
toTextBuilder Settings
settings = \case
NumericConstTypename Numeric
a -> Settings -> Numeric -> TextBuilder
forall a. IsAst a => Settings -> a -> TextBuilder
toTextBuilder Settings
settings Numeric
a
ConstBitConstTypename Bit
a -> Settings -> Bit -> TextBuilder
forall a. IsAst a => Settings -> a -> TextBuilder
toTextBuilder Settings
settings Bit
a
ConstCharacterConstTypename ConstCharacter
a -> Settings -> ConstCharacter -> TextBuilder
forall a. IsAst a => Settings -> a -> TextBuilder
toTextBuilder Settings
settings ConstCharacter
a
ConstDatetimeConstTypename ConstDatetime
a -> Settings -> ConstDatetime -> TextBuilder
forall a. IsAst a => Settings -> a -> TextBuilder
toTextBuilder Settings
settings ConstDatetime
a
parser :: Settings -> Parser ConstTypename
parser Settings
settings =
[Parser ConstTypename] -> Parser ConstTypename
forall (t :: * -> *) (f :: * -> *) a.
(Foldable t, Alternative f) =>
t (f a) -> f a
asum
[ Numeric -> ConstTypename
NumericConstTypename (Numeric -> ConstTypename)
-> HeadedParsec Void Text Numeric -> Parser ConstTypename
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Settings -> HeadedParsec Void Text Numeric
forall a. IsAst a => Settings -> Parser a
parser Settings
settings,
Bit -> ConstTypename
ConstBitConstTypename (Bit -> ConstTypename)
-> HeadedParsec Void Text Bit -> Parser ConstTypename
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Settings -> HeadedParsec Void Text Bit
forall a. IsAst a => Settings -> Parser a
parser Settings
settings,
ConstCharacter -> ConstTypename
ConstCharacterConstTypename (ConstCharacter -> ConstTypename)
-> HeadedParsec Void Text ConstCharacter -> Parser ConstTypename
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Settings -> HeadedParsec Void Text ConstCharacter
forall a. IsAst a => Settings -> Parser a
parser Settings
settings,
ConstDatetime -> ConstTypename
ConstDatetimeConstTypename (ConstDatetime -> ConstTypename)
-> HeadedParsec Void Text ConstDatetime -> Parser ConstTypename
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Settings -> HeadedParsec Void Text ConstDatetime
forall a. IsAst a => Settings -> Parser a
parser Settings
settings
]
instance Qc.Arbitrary ConstTypename where
shrink :: ConstTypename -> [ConstTypename]
shrink = ConstTypename -> [ConstTypename]
forall a.
(Generic a, RecursivelyShrink (Rep a), GSubterms (Rep a) a) =>
a -> [a]
Qc.genericShrink
arbitrary :: Gen ConstTypename
arbitrary =
[Gen ConstTypename] -> Gen ConstTypename
forall a. HasCallStack => [Gen a] -> Gen a
Qc.oneof
[ Numeric -> ConstTypename
NumericConstTypename (Numeric -> ConstTypename) -> Gen Numeric -> Gen ConstTypename
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Gen Numeric
forall a. Arbitrary a => Gen a
Qc.arbitrary,
Bit -> ConstTypename
ConstBitConstTypename (Bit -> ConstTypename) -> Gen Bit -> Gen ConstTypename
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Gen Bit
forall a. Arbitrary a => Gen a
Qc.arbitrary,
ConstCharacter -> ConstTypename
ConstCharacterConstTypename (ConstCharacter -> ConstTypename)
-> Gen ConstCharacter -> Gen ConstTypename
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Gen ConstCharacter
forall a. Arbitrary a => Gen a
Qc.arbitrary,
ConstDatetime -> ConstTypename
ConstDatetimeConstTypename (ConstDatetime -> ConstTypename)
-> Gen ConstDatetime -> Gen ConstTypename
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Gen ConstDatetime
forall a. Arbitrary a => Gen a
Qc.arbitrary
]