{-# LANGUAGE DeriveGeneric     #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE DerivingVia       #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE Strict            #-}
module Language.Cimple.Ast
    ( AssignOp (..)
    , BinaryOp (..)
    , UnaryOp (..)
    , LiteralType (..)
    , Node, NodeF (..)
    , Scope (..)
    , CommentStyle (..)
    , Comment
    , CommentF (..)
    , Nullability (..)
    , getNodeId
    ) where

import           Data.Aeson                   (FromJSON, FromJSON1, ToJSON,
                                               ToJSON1)
import           Data.Bifunctor               (Bifunctor (..))
import           Data.Fix                     (Fix (..))
import           Data.Functor.Classes         (Eq1, Ord1, Read1, Show1)
import           Data.Functor.Classes.Generic (FunctorClassesDefault (..))
import           Data.Hashable                (Hashable (..))
import           Data.Hashable.Lifted         (Hashable1)
import           GHC.Generics                 (Generic, Generic1)
import           Test.QuickCheck              (Arbitrary (..),
                                               arbitraryBoundedEnum)

getNodeId :: Hashable a => Node a -> Int
getNodeId :: forall a. Hashable a => Node a -> Int
getNodeId = Node a -> Int
forall a. Hashable a => a -> Int
hash

data NodeF lexeme a
    -- Preprocessor
    = PreprocInclude lexeme
    | PreprocDefine lexeme
    | PreprocDefineConst lexeme a
    | PreprocDefineMacro lexeme [a] a
    | PreprocIf a [a] a
    | PreprocIfdef lexeme [a] a
    | PreprocIfndef lexeme [a] a
    | PreprocElse [a]
    | PreprocElif a [a] a
    | PreprocUndef lexeme
    | PreprocDefined lexeme
    | PreprocScopedDefine a [a] a
    | MacroBodyStmt a
    | MacroBodyFunCall a
    | MacroParam lexeme
    | StaticAssert a lexeme
    -- Comments
    | LicenseDecl lexeme [a]
    | CopyrightDecl lexeme (Maybe lexeme) [lexeme]
    | Comment CommentStyle lexeme [lexeme] lexeme
    | CommentSection a [a] a
    | CommentSectionEnd lexeme
    | Commented a a
    | CommentInfo (Comment lexeme)
    -- Namespace-like blocks
    | ExternC [a]
    -- An inferred coherent block of nodes, printed without empty lines
    -- between them.
    | Group [a]
    -- Statements
    | CompoundStmt [a]
    | Break
    | Goto lexeme
    | Continue
    | Return (Maybe a)
    | SwitchStmt a [a]
    | IfStmt a a (Maybe a)
    | ForStmt a a a a
    | WhileStmt a a
    | DoWhileStmt a a
    | Case a a
    | Default a
    | Label lexeme a
    | ExprStmt a
    -- Variable declarations
    | VLA a lexeme a
    | VarDeclStmt a (Maybe a)
    | VarDecl a lexeme [a]
    | DeclSpecArray Nullability (Maybe a)
    -- Expressions
    | InitialiserList [a]
    | UnaryExpr UnaryOp a
    | BinaryExpr a BinaryOp a
    | TernaryExpr a a a
    | AssignExpr a AssignOp a
    | ParenExpr a
    | CastExpr a a
    | CompoundLiteral a a
    | SizeofExpr a
    | SizeofType a
    | LiteralExpr LiteralType lexeme
    | VarExpr lexeme
    | MemberAccess a lexeme
    | PointerAccess a lexeme
    | ArrayAccess a a
    | FunctionCall a [a]
    | CommentExpr a a
    -- Type definitions
    | EnumConsts (Maybe lexeme) [a]
    | EnumDecl lexeme [a] lexeme
    | Enumerator lexeme (Maybe a)
    | AggregateDecl a
    | Typedef a lexeme [a]
    | TypedefFunction a
    | Struct lexeme [a]
    | Union lexeme [a]
    | MemberDecl a (Maybe lexeme)
    | TyBitwise a
    | TyForce a
    | TyConst a
    | TyOwner a
    | TyNonnull a
    | TyNullable a
    | TyPointer a
    | TyStruct lexeme
    | TyUnion lexeme
    | TyFunc lexeme
    | TyStd lexeme
    | TyUserDefined lexeme
    -- Functions
    | AttrPrintf lexeme lexeme a
    | AttrAllocSize [lexeme] a
    | FunctionDecl Scope a
    | FunctionDefn Scope a a
    | FunctionPrototype a lexeme [a]
    | CallbackDecl lexeme lexeme
    | Ellipsis
    | NonNull [lexeme] [lexeme] a
    | NonNullParam a
    | NullableParam a
    -- Constants
    | ConstDecl a lexeme
    | ConstDefn Scope a lexeme a
    deriving (Int -> NodeF lexeme a -> ShowS
[NodeF lexeme a] -> ShowS
NodeF lexeme a -> String
(Int -> NodeF lexeme a -> ShowS)
-> (NodeF lexeme a -> String)
-> ([NodeF lexeme a] -> ShowS)
-> Show (NodeF lexeme a)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall lexeme a.
(Show lexeme, Show a) =>
Int -> NodeF lexeme a -> ShowS
forall lexeme a. (Show lexeme, Show a) => [NodeF lexeme a] -> ShowS
forall lexeme a. (Show lexeme, Show a) => NodeF lexeme a -> String
$cshowsPrec :: forall lexeme a.
(Show lexeme, Show a) =>
Int -> NodeF lexeme a -> ShowS
showsPrec :: Int -> NodeF lexeme a -> ShowS
$cshow :: forall lexeme a. (Show lexeme, Show a) => NodeF lexeme a -> String
show :: NodeF lexeme a -> String
$cshowList :: forall lexeme a. (Show lexeme, Show a) => [NodeF lexeme a] -> ShowS
showList :: [NodeF lexeme a] -> ShowS
Show, ReadPrec [NodeF lexeme a]
ReadPrec (NodeF lexeme a)
Int -> ReadS (NodeF lexeme a)
ReadS [NodeF lexeme a]
(Int -> ReadS (NodeF lexeme a))
-> ReadS [NodeF lexeme a]
-> ReadPrec (NodeF lexeme a)
-> ReadPrec [NodeF lexeme a]
-> Read (NodeF lexeme a)
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
forall lexeme a. (Read lexeme, Read a) => ReadPrec [NodeF lexeme a]
forall lexeme a. (Read lexeme, Read a) => ReadPrec (NodeF lexeme a)
forall lexeme a.
(Read lexeme, Read a) =>
Int -> ReadS (NodeF lexeme a)
forall lexeme a. (Read lexeme, Read a) => ReadS [NodeF lexeme a]
$creadsPrec :: forall lexeme a.
(Read lexeme, Read a) =>
Int -> ReadS (NodeF lexeme a)
readsPrec :: Int -> ReadS (NodeF lexeme a)
$creadList :: forall lexeme a. (Read lexeme, Read a) => ReadS [NodeF lexeme a]
readList :: ReadS [NodeF lexeme a]
$creadPrec :: forall lexeme a. (Read lexeme, Read a) => ReadPrec (NodeF lexeme a)
readPrec :: ReadPrec (NodeF lexeme a)
$creadListPrec :: forall lexeme a. (Read lexeme, Read a) => ReadPrec [NodeF lexeme a]
readListPrec :: ReadPrec [NodeF lexeme a]
Read, NodeF lexeme a -> NodeF lexeme a -> Bool
(NodeF lexeme a -> NodeF lexeme a -> Bool)
-> (NodeF lexeme a -> NodeF lexeme a -> Bool)
-> Eq (NodeF lexeme a)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall lexeme a.
(Eq lexeme, Eq a) =>
NodeF lexeme a -> NodeF lexeme a -> Bool
$c== :: forall lexeme a.
(Eq lexeme, Eq a) =>
NodeF lexeme a -> NodeF lexeme a -> Bool
== :: NodeF lexeme a -> NodeF lexeme a -> Bool
$c/= :: forall lexeme a.
(Eq lexeme, Eq a) =>
NodeF lexeme a -> NodeF lexeme a -> Bool
/= :: NodeF lexeme a -> NodeF lexeme a -> Bool
Eq, Eq (NodeF lexeme a)
Eq (NodeF lexeme a) =>
(NodeF lexeme a -> NodeF lexeme a -> Ordering)
-> (NodeF lexeme a -> NodeF lexeme a -> Bool)
-> (NodeF lexeme a -> NodeF lexeme a -> Bool)
-> (NodeF lexeme a -> NodeF lexeme a -> Bool)
-> (NodeF lexeme a -> NodeF lexeme a -> Bool)
-> (NodeF lexeme a -> NodeF lexeme a -> NodeF lexeme a)
-> (NodeF lexeme a -> NodeF lexeme a -> NodeF lexeme a)
-> Ord (NodeF lexeme a)
NodeF lexeme a -> NodeF lexeme a -> Bool
NodeF lexeme a -> NodeF lexeme a -> Ordering
NodeF lexeme a -> NodeF lexeme a -> NodeF lexeme a
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
forall lexeme a. (Ord lexeme, Ord a) => Eq (NodeF lexeme a)
forall lexeme a.
(Ord lexeme, Ord a) =>
NodeF lexeme a -> NodeF lexeme a -> Bool
forall lexeme a.
(Ord lexeme, Ord a) =>
NodeF lexeme a -> NodeF lexeme a -> Ordering
forall lexeme a.
(Ord lexeme, Ord a) =>
NodeF lexeme a -> NodeF lexeme a -> NodeF lexeme a
$ccompare :: forall lexeme a.
(Ord lexeme, Ord a) =>
NodeF lexeme a -> NodeF lexeme a -> Ordering
compare :: NodeF lexeme a -> NodeF lexeme a -> Ordering
$c< :: forall lexeme a.
(Ord lexeme, Ord a) =>
NodeF lexeme a -> NodeF lexeme a -> Bool
< :: NodeF lexeme a -> NodeF lexeme a -> Bool
$c<= :: forall lexeme a.
(Ord lexeme, Ord a) =>
NodeF lexeme a -> NodeF lexeme a -> Bool
<= :: NodeF lexeme a -> NodeF lexeme a -> Bool
$c> :: forall lexeme a.
(Ord lexeme, Ord a) =>
NodeF lexeme a -> NodeF lexeme a -> Bool
> :: NodeF lexeme a -> NodeF lexeme a -> Bool
$c>= :: forall lexeme a.
(Ord lexeme, Ord a) =>
NodeF lexeme a -> NodeF lexeme a -> Bool
>= :: NodeF lexeme a -> NodeF lexeme a -> Bool
$cmax :: forall lexeme a.
(Ord lexeme, Ord a) =>
NodeF lexeme a -> NodeF lexeme a -> NodeF lexeme a
max :: NodeF lexeme a -> NodeF lexeme a -> NodeF lexeme a
$cmin :: forall lexeme a.
(Ord lexeme, Ord a) =>
NodeF lexeme a -> NodeF lexeme a -> NodeF lexeme a
min :: NodeF lexeme a -> NodeF lexeme a -> NodeF lexeme a
Ord, (forall x. NodeF lexeme a -> Rep (NodeF lexeme a) x)
-> (forall x. Rep (NodeF lexeme a) x -> NodeF lexeme a)
-> Generic (NodeF lexeme a)
forall x. Rep (NodeF lexeme a) x -> NodeF lexeme a
forall x. NodeF lexeme a -> Rep (NodeF lexeme a) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall lexeme a x. Rep (NodeF lexeme a) x -> NodeF lexeme a
forall lexeme a x. NodeF lexeme a -> Rep (NodeF lexeme a) x
$cfrom :: forall lexeme a x. NodeF lexeme a -> Rep (NodeF lexeme a) x
from :: forall x. NodeF lexeme a -> Rep (NodeF lexeme a) x
$cto :: forall lexeme a x. Rep (NodeF lexeme a) x -> NodeF lexeme a
to :: forall x. Rep (NodeF lexeme a) x -> NodeF lexeme a
Generic, (forall a. NodeF lexeme a -> Rep1 (NodeF lexeme) a)
-> (forall a. Rep1 (NodeF lexeme) a -> NodeF lexeme a)
-> Generic1 (NodeF lexeme)
forall a. Rep1 (NodeF lexeme) a -> NodeF lexeme a
forall a. NodeF lexeme a -> Rep1 (NodeF lexeme) a
forall lexeme a. Rep1 (NodeF lexeme) a -> NodeF lexeme a
forall lexeme a. NodeF lexeme a -> Rep1 (NodeF lexeme) a
forall k (f :: k -> *).
(forall (a :: k). f a -> Rep1 f a)
-> (forall (a :: k). Rep1 f a -> f a) -> Generic1 f
$cfrom1 :: forall lexeme a. NodeF lexeme a -> Rep1 (NodeF lexeme) a
from1 :: forall a. NodeF lexeme a -> Rep1 (NodeF lexeme) a
$cto1 :: forall lexeme a. Rep1 (NodeF lexeme) a -> NodeF lexeme a
to1 :: forall a. Rep1 (NodeF lexeme) a -> NodeF lexeme a
Generic1, (forall a b. (a -> b) -> NodeF lexeme a -> NodeF lexeme b)
-> (forall a b. a -> NodeF lexeme b -> NodeF lexeme a)
-> Functor (NodeF lexeme)
forall a b. a -> NodeF lexeme b -> NodeF lexeme a
forall a b. (a -> b) -> NodeF lexeme a -> NodeF lexeme b
forall lexeme a b. a -> NodeF lexeme b -> NodeF lexeme a
forall lexeme a b. (a -> b) -> NodeF lexeme a -> NodeF lexeme b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall lexeme a b. (a -> b) -> NodeF lexeme a -> NodeF lexeme b
fmap :: forall a b. (a -> b) -> NodeF lexeme a -> NodeF lexeme b
$c<$ :: forall lexeme a b. a -> NodeF lexeme b -> NodeF lexeme a
<$ :: forall a b. a -> NodeF lexeme b -> NodeF lexeme a
Functor, (forall m. Monoid m => NodeF lexeme m -> m)
-> (forall m a. Monoid m => (a -> m) -> NodeF lexeme a -> m)
-> (forall m a. Monoid m => (a -> m) -> NodeF lexeme a -> m)
-> (forall a b. (a -> b -> b) -> b -> NodeF lexeme a -> b)
-> (forall a b. (a -> b -> b) -> b -> NodeF lexeme a -> b)
-> (forall b a. (b -> a -> b) -> b -> NodeF lexeme a -> b)
-> (forall b a. (b -> a -> b) -> b -> NodeF lexeme a -> b)
-> (forall a. (a -> a -> a) -> NodeF lexeme a -> a)
-> (forall a. (a -> a -> a) -> NodeF lexeme a -> a)
-> (forall a. NodeF lexeme a -> [a])
-> (forall a. NodeF lexeme a -> Bool)
-> (forall a. NodeF lexeme a -> Int)
-> (forall a. Eq a => a -> NodeF lexeme a -> Bool)
-> (forall a. Ord a => NodeF lexeme a -> a)
-> (forall a. Ord a => NodeF lexeme a -> a)
-> (forall a. Num a => NodeF lexeme a -> a)
-> (forall a. Num a => NodeF lexeme a -> a)
-> Foldable (NodeF lexeme)
forall a. Eq a => a -> NodeF lexeme a -> Bool
forall a. Num a => NodeF lexeme a -> a
forall a. Ord a => NodeF lexeme a -> a
forall m. Monoid m => NodeF lexeme m -> m
forall a. NodeF lexeme a -> Bool
forall a. NodeF lexeme a -> Int
forall a. NodeF lexeme a -> [a]
forall a. (a -> a -> a) -> NodeF lexeme a -> a
forall lexeme a. Eq a => a -> NodeF lexeme a -> Bool
forall lexeme a. Num a => NodeF lexeme a -> a
forall lexeme a. Ord a => NodeF lexeme a -> a
forall lexeme m. Monoid m => NodeF lexeme m -> m
forall m a. Monoid m => (a -> m) -> NodeF lexeme a -> m
forall lexeme a. NodeF lexeme a -> Bool
forall lexeme a. NodeF lexeme a -> Int
forall lexeme a. NodeF lexeme a -> [a]
forall b a. (b -> a -> b) -> b -> NodeF lexeme a -> b
forall a b. (a -> b -> b) -> b -> NodeF lexeme a -> b
forall lexeme a. (a -> a -> a) -> NodeF lexeme a -> a
forall lexeme m a. Monoid m => (a -> m) -> NodeF lexeme a -> m
forall lexeme b a. (b -> a -> b) -> b -> NodeF lexeme a -> b
forall lexeme a b. (a -> b -> b) -> b -> NodeF lexeme a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
$cfold :: forall lexeme m. Monoid m => NodeF lexeme m -> m
fold :: forall m. Monoid m => NodeF lexeme m -> m
$cfoldMap :: forall lexeme m a. Monoid m => (a -> m) -> NodeF lexeme a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> NodeF lexeme a -> m
$cfoldMap' :: forall lexeme m a. Monoid m => (a -> m) -> NodeF lexeme a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> NodeF lexeme a -> m
$cfoldr :: forall lexeme a b. (a -> b -> b) -> b -> NodeF lexeme a -> b
foldr :: forall a b. (a -> b -> b) -> b -> NodeF lexeme a -> b
$cfoldr' :: forall lexeme a b. (a -> b -> b) -> b -> NodeF lexeme a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> NodeF lexeme a -> b
$cfoldl :: forall lexeme b a. (b -> a -> b) -> b -> NodeF lexeme a -> b
foldl :: forall b a. (b -> a -> b) -> b -> NodeF lexeme a -> b
$cfoldl' :: forall lexeme b a. (b -> a -> b) -> b -> NodeF lexeme a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> NodeF lexeme a -> b
$cfoldr1 :: forall lexeme a. (a -> a -> a) -> NodeF lexeme a -> a
foldr1 :: forall a. (a -> a -> a) -> NodeF lexeme a -> a
$cfoldl1 :: forall lexeme a. (a -> a -> a) -> NodeF lexeme a -> a
foldl1 :: forall a. (a -> a -> a) -> NodeF lexeme a -> a
$ctoList :: forall lexeme a. NodeF lexeme a -> [a]
toList :: forall a. NodeF lexeme a -> [a]
$cnull :: forall lexeme a. NodeF lexeme a -> Bool
null :: forall a. NodeF lexeme a -> Bool
$clength :: forall lexeme a. NodeF lexeme a -> Int
length :: forall a. NodeF lexeme a -> Int
$celem :: forall lexeme a. Eq a => a -> NodeF lexeme a -> Bool
elem :: forall a. Eq a => a -> NodeF lexeme a -> Bool
$cmaximum :: forall lexeme a. Ord a => NodeF lexeme a -> a
maximum :: forall a. Ord a => NodeF lexeme a -> a
$cminimum :: forall lexeme a. Ord a => NodeF lexeme a -> a
minimum :: forall a. Ord a => NodeF lexeme a -> a
$csum :: forall lexeme a. Num a => NodeF lexeme a -> a
sum :: forall a. Num a => NodeF lexeme a -> a
$cproduct :: forall lexeme a. Num a => NodeF lexeme a -> a
product :: forall a. Num a => NodeF lexeme a -> a
Foldable, Functor (NodeF lexeme)
Foldable (NodeF lexeme)
(Functor (NodeF lexeme), Foldable (NodeF lexeme)) =>
(forall (f :: * -> *) a b.
 Applicative f =>
 (a -> f b) -> NodeF lexeme a -> f (NodeF lexeme b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    NodeF lexeme (f a) -> f (NodeF lexeme a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> NodeF lexeme a -> m (NodeF lexeme b))
-> (forall (m :: * -> *) a.
    Monad m =>
    NodeF lexeme (m a) -> m (NodeF lexeme a))
-> Traversable (NodeF lexeme)
forall lexeme. Functor (NodeF lexeme)
forall lexeme. Foldable (NodeF lexeme)
forall lexeme (m :: * -> *) a.
Monad m =>
NodeF lexeme (m a) -> m (NodeF lexeme a)
forall lexeme (f :: * -> *) a.
Applicative f =>
NodeF lexeme (f a) -> f (NodeF lexeme a)
forall lexeme (m :: * -> *) a b.
Monad m =>
(a -> m b) -> NodeF lexeme a -> m (NodeF lexeme b)
forall lexeme (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> NodeF lexeme a -> f (NodeF lexeme b)
forall (t :: * -> *).
(Functor t, Foldable t) =>
(forall (f :: * -> *) a b.
 Applicative f =>
 (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
NodeF lexeme (m a) -> m (NodeF lexeme a)
forall (f :: * -> *) a.
Applicative f =>
NodeF lexeme (f a) -> f (NodeF lexeme a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> NodeF lexeme a -> m (NodeF lexeme b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> NodeF lexeme a -> f (NodeF lexeme b)
$ctraverse :: forall lexeme (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> NodeF lexeme a -> f (NodeF lexeme b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> NodeF lexeme a -> f (NodeF lexeme b)
$csequenceA :: forall lexeme (f :: * -> *) a.
Applicative f =>
NodeF lexeme (f a) -> f (NodeF lexeme a)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
NodeF lexeme (f a) -> f (NodeF lexeme a)
$cmapM :: forall lexeme (m :: * -> *) a b.
Monad m =>
(a -> m b) -> NodeF lexeme a -> m (NodeF lexeme b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> NodeF lexeme a -> m (NodeF lexeme b)
$csequence :: forall lexeme (m :: * -> *) a.
Monad m =>
NodeF lexeme (m a) -> m (NodeF lexeme a)
sequence :: forall (m :: * -> *) a.
Monad m =>
NodeF lexeme (m a) -> m (NodeF lexeme a)
Traversable)
    deriving ((forall a. Show a => Show (NodeF lexeme a)) =>
(forall a.
 (Int -> a -> ShowS)
 -> ([a] -> ShowS) -> Int -> NodeF lexeme a -> ShowS)
-> (forall a.
    (Int -> a -> ShowS) -> ([a] -> ShowS) -> [NodeF lexeme a] -> ShowS)
-> Show1 (NodeF lexeme)
forall a. Show a => Show (NodeF lexeme a)
forall lexeme a. (Show lexeme, Show a) => Show (NodeF lexeme a)
forall lexeme a.
Show lexeme =>
(Int -> a -> ShowS)
-> ([a] -> ShowS) -> Int -> NodeF lexeme a -> ShowS
forall lexeme a.
Show lexeme =>
(Int -> a -> ShowS) -> ([a] -> ShowS) -> [NodeF lexeme a] -> ShowS
forall a.
(Int -> a -> ShowS)
-> ([a] -> ShowS) -> Int -> NodeF lexeme a -> ShowS
forall a.
(Int -> a -> ShowS) -> ([a] -> ShowS) -> [NodeF lexeme a] -> ShowS
forall (f :: * -> *).
(forall a. Show a => Show (f a)) =>
(forall a.
 (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> f a -> ShowS)
-> (forall a.
    (Int -> a -> ShowS) -> ([a] -> ShowS) -> [f a] -> ShowS)
-> Show1 f
$cliftShowsPrec :: forall lexeme a.
Show lexeme =>
(Int -> a -> ShowS)
-> ([a] -> ShowS) -> Int -> NodeF lexeme a -> ShowS
liftShowsPrec :: forall a.
(Int -> a -> ShowS)
-> ([a] -> ShowS) -> Int -> NodeF lexeme a -> ShowS
$cliftShowList :: forall lexeme a.
Show lexeme =>
(Int -> a -> ShowS) -> ([a] -> ShowS) -> [NodeF lexeme a] -> ShowS
liftShowList :: forall a.
(Int -> a -> ShowS) -> ([a] -> ShowS) -> [NodeF lexeme a] -> ShowS
Show1, (forall a. Read a => Read (NodeF lexeme a)) =>
(forall a.
 (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (NodeF lexeme a))
-> (forall a.
    (Int -> ReadS a) -> ReadS [a] -> ReadS [NodeF lexeme a])
-> (forall a.
    ReadPrec a -> ReadPrec [a] -> ReadPrec (NodeF lexeme a))
-> (forall a.
    ReadPrec a -> ReadPrec [a] -> ReadPrec [NodeF lexeme a])
-> Read1 (NodeF lexeme)
forall a. Read a => Read (NodeF lexeme a)
forall lexeme a. (Read lexeme, Read a) => Read (NodeF lexeme a)
forall lexeme a.
Read lexeme =>
ReadPrec a -> ReadPrec [a] -> ReadPrec [NodeF lexeme a]
forall lexeme a.
Read lexeme =>
ReadPrec a -> ReadPrec [a] -> ReadPrec (NodeF lexeme a)
forall lexeme a.
Read lexeme =>
(Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (NodeF lexeme a)
forall lexeme a.
Read lexeme =>
(Int -> ReadS a) -> ReadS [a] -> ReadS [NodeF lexeme a]
forall a. ReadPrec a -> ReadPrec [a] -> ReadPrec [NodeF lexeme a]
forall a. ReadPrec a -> ReadPrec [a] -> ReadPrec (NodeF lexeme a)
forall a.
(Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (NodeF lexeme a)
forall a. (Int -> ReadS a) -> ReadS [a] -> ReadS [NodeF lexeme a]
forall (f :: * -> *).
(forall a. Read a => Read (f a)) =>
(forall a. (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (f a))
-> (forall a. (Int -> ReadS a) -> ReadS [a] -> ReadS [f a])
-> (forall a. ReadPrec a -> ReadPrec [a] -> ReadPrec (f a))
-> (forall a. ReadPrec a -> ReadPrec [a] -> ReadPrec [f a])
-> Read1 f
$cliftReadsPrec :: forall lexeme a.
Read lexeme =>
(Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (NodeF lexeme a)
liftReadsPrec :: forall a.
(Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (NodeF lexeme a)
$cliftReadList :: forall lexeme a.
Read lexeme =>
(Int -> ReadS a) -> ReadS [a] -> ReadS [NodeF lexeme a]
liftReadList :: forall a. (Int -> ReadS a) -> ReadS [a] -> ReadS [NodeF lexeme a]
$cliftReadPrec :: forall lexeme a.
Read lexeme =>
ReadPrec a -> ReadPrec [a] -> ReadPrec (NodeF lexeme a)
liftReadPrec :: forall a. ReadPrec a -> ReadPrec [a] -> ReadPrec (NodeF lexeme a)
$cliftReadListPrec :: forall lexeme a.
Read lexeme =>
ReadPrec a -> ReadPrec [a] -> ReadPrec [NodeF lexeme a]
liftReadListPrec :: forall a. ReadPrec a -> ReadPrec [a] -> ReadPrec [NodeF lexeme a]
Read1, (forall a. Eq a => Eq (NodeF lexeme a)) =>
(forall a b.
 (a -> b -> Bool) -> NodeF lexeme a -> NodeF lexeme b -> Bool)
-> Eq1 (NodeF lexeme)
forall a. Eq a => Eq (NodeF lexeme a)
forall lexeme a. (Eq lexeme, Eq a) => Eq (NodeF lexeme a)
forall lexeme a b.
Eq lexeme =>
(a -> b -> Bool) -> NodeF lexeme a -> NodeF lexeme b -> Bool
forall a b.
(a -> b -> Bool) -> NodeF lexeme a -> NodeF lexeme b -> Bool
forall (f :: * -> *).
(forall a. Eq a => Eq (f a)) =>
(forall a b. (a -> b -> Bool) -> f a -> f b -> Bool) -> Eq1 f
$cliftEq :: forall lexeme a b.
Eq lexeme =>
(a -> b -> Bool) -> NodeF lexeme a -> NodeF lexeme b -> Bool
liftEq :: forall a b.
(a -> b -> Bool) -> NodeF lexeme a -> NodeF lexeme b -> Bool
Eq1, Eq1 (NodeF lexeme)
(Eq1 (NodeF lexeme), forall a. Ord a => Ord (NodeF lexeme a)) =>
(forall a b.
 (a -> b -> Ordering)
 -> NodeF lexeme a -> NodeF lexeme b -> Ordering)
-> Ord1 (NodeF lexeme)
forall a. Ord a => Ord (NodeF lexeme a)
forall lexeme. Ord lexeme => Eq1 (NodeF lexeme)
forall lexeme a. (Ord lexeme, Ord a) => Ord (NodeF lexeme a)
forall lexeme a b.
Ord lexeme =>
(a -> b -> Ordering)
-> NodeF lexeme a -> NodeF lexeme b -> Ordering
forall a b.
(a -> b -> Ordering)
-> NodeF lexeme a -> NodeF lexeme b -> Ordering
forall (f :: * -> *).
(Eq1 f, forall a. Ord a => Ord (f a)) =>
(forall a b. (a -> b -> Ordering) -> f a -> f b -> Ordering)
-> Ord1 f
$cliftCompare :: forall lexeme a b.
Ord lexeme =>
(a -> b -> Ordering)
-> NodeF lexeme a -> NodeF lexeme b -> Ordering
liftCompare :: forall a b.
(a -> b -> Ordering)
-> NodeF lexeme a -> NodeF lexeme b -> Ordering
Ord1) via FunctorClassesDefault (NodeF lexeme)

instance Bifunctor NodeF where
    bimap :: forall a b c d. (a -> b) -> (c -> d) -> NodeF a c -> NodeF b d
bimap a -> b
f c -> d
g NodeF a c
n = case NodeF a c
n of
        PreprocInclude a
l -> b -> NodeF b d
forall lexeme a. lexeme -> NodeF lexeme a
PreprocInclude (a -> b
f a
l)
        PreprocDefine a
l -> b -> NodeF b d
forall lexeme a. lexeme -> NodeF lexeme a
PreprocDefine (a -> b
f a
l)
        PreprocDefineConst a
l c
a -> b -> d -> NodeF b d
forall lexeme a. lexeme -> a -> NodeF lexeme a
PreprocDefineConst (a -> b
f a
l) (c -> d
g c
a)
        PreprocDefineMacro a
l [c]
as c
a -> b -> [d] -> d -> NodeF b d
forall lexeme a. lexeme -> [a] -> a -> NodeF lexeme a
PreprocDefineMacro (a -> b
f a
l) ((c -> d) -> [c] -> [d]
forall a b. (a -> b) -> [a] -> [b]
map c -> d
g [c]
as) (c -> d
g c
a)
        PreprocIf c
a [c]
as c
a' -> d -> [d] -> d -> NodeF b d
forall lexeme a. a -> [a] -> a -> NodeF lexeme a
PreprocIf (c -> d
g c
a) ((c -> d) -> [c] -> [d]
forall a b. (a -> b) -> [a] -> [b]
map c -> d
g [c]
as) (c -> d
g c
a')
        PreprocIfdef a
l [c]
as c
a -> b -> [d] -> d -> NodeF b d
forall lexeme a. lexeme -> [a] -> a -> NodeF lexeme a
PreprocIfdef (a -> b
f a
l) ((c -> d) -> [c] -> [d]
forall a b. (a -> b) -> [a] -> [b]
map c -> d
g [c]
as) (c -> d
g c
a)
        PreprocIfndef a
l [c]
as c
a -> b -> [d] -> d -> NodeF b d
forall lexeme a. lexeme -> [a] -> a -> NodeF lexeme a
PreprocIfndef (a -> b
f a
l) ((c -> d) -> [c] -> [d]
forall a b. (a -> b) -> [a] -> [b]
map c -> d
g [c]
as) (c -> d
g c
a)
        PreprocElse [c]
as -> [d] -> NodeF b d
forall lexeme a. [a] -> NodeF lexeme a
PreprocElse ((c -> d) -> [c] -> [d]
forall a b. (a -> b) -> [a] -> [b]
map c -> d
g [c]
as)
        PreprocElif c
a [c]
as c
a' -> d -> [d] -> d -> NodeF b d
forall lexeme a. a -> [a] -> a -> NodeF lexeme a
PreprocElif (c -> d
g c
a) ((c -> d) -> [c] -> [d]
forall a b. (a -> b) -> [a] -> [b]
map c -> d
g [c]
as) (c -> d
g c
a')
        PreprocUndef a
l -> b -> NodeF b d
forall lexeme a. lexeme -> NodeF lexeme a
PreprocUndef (a -> b
f a
l)
        PreprocDefined a
l -> b -> NodeF b d
forall lexeme a. lexeme -> NodeF lexeme a
PreprocDefined (a -> b
f a
l)
        PreprocScopedDefine c
a [c]
as c
a' -> d -> [d] -> d -> NodeF b d
forall lexeme a. a -> [a] -> a -> NodeF lexeme a
PreprocScopedDefine (c -> d
g c
a) ((c -> d) -> [c] -> [d]
forall a b. (a -> b) -> [a] -> [b]
map c -> d
g [c]
as) (c -> d
g c
a')
        MacroBodyStmt c
a -> d -> NodeF b d
forall lexeme a. a -> NodeF lexeme a
MacroBodyStmt (c -> d
g c
a)
        MacroBodyFunCall c
a -> d -> NodeF b d
forall lexeme a. a -> NodeF lexeme a
MacroBodyFunCall (c -> d
g c
a)
        MacroParam a
l -> b -> NodeF b d
forall lexeme a. lexeme -> NodeF lexeme a
MacroParam (a -> b
f a
l)
        StaticAssert c
a a
l -> d -> b -> NodeF b d
forall lexeme a. a -> lexeme -> NodeF lexeme a
StaticAssert (c -> d
g c
a) (a -> b
f a
l)
        LicenseDecl a
l [c]
as -> b -> [d] -> NodeF b d
forall lexeme a. lexeme -> [a] -> NodeF lexeme a
LicenseDecl (a -> b
f a
l) ((c -> d) -> [c] -> [d]
forall a b. (a -> b) -> [a] -> [b]
map c -> d
g [c]
as)
        CopyrightDecl a
l Maybe a
ml [a]
ls -> b -> Maybe b -> [b] -> NodeF b d
forall lexeme a.
lexeme -> Maybe lexeme -> [lexeme] -> NodeF lexeme a
CopyrightDecl (a -> b
f a
l) ((a -> b) -> Maybe a -> Maybe b
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
f Maybe a
ml) ((a -> b) -> [a] -> [b]
forall a b. (a -> b) -> [a] -> [b]
map a -> b
f [a]
ls)
        Comment CommentStyle
s a
l [a]
ls a
l' -> CommentStyle -> b -> [b] -> b -> NodeF b d
forall lexeme a.
CommentStyle -> lexeme -> [lexeme] -> lexeme -> NodeF lexeme a
Comment CommentStyle
s (a -> b
f a
l) ((a -> b) -> [a] -> [b]
forall a b. (a -> b) -> [a] -> [b]
map a -> b
f [a]
ls) (a -> b
f a
l')
        CommentSection c
a [c]
as c
a' -> d -> [d] -> d -> NodeF b d
forall lexeme a. a -> [a] -> a -> NodeF lexeme a
CommentSection (c -> d
g c
a) ((c -> d) -> [c] -> [d]
forall a b. (a -> b) -> [a] -> [b]
map c -> d
g [c]
as) (c -> d
g c
a')
        CommentSectionEnd a
l -> b -> NodeF b d
forall lexeme a. lexeme -> NodeF lexeme a
CommentSectionEnd (a -> b
f a
l)
        Commented c
a c
a' -> d -> d -> NodeF b d
forall lexeme a. a -> a -> NodeF lexeme a
Commented (c -> d
g c
a) (c -> d
g c
a')
        CommentInfo Comment a
c -> Comment b -> NodeF b d
forall lexeme a. Comment lexeme -> NodeF lexeme a
CommentInfo ((a -> b) -> Comment a -> Comment b
forall l l'. (l -> l') -> Comment l -> Comment l'
mapCommentLexeme a -> b
f Comment a
c)
        ExternC [c]
as -> [d] -> NodeF b d
forall lexeme a. [a] -> NodeF lexeme a
ExternC ((c -> d) -> [c] -> [d]
forall a b. (a -> b) -> [a] -> [b]
map c -> d
g [c]
as)
        Group [c]
as -> [d] -> NodeF b d
forall lexeme a. [a] -> NodeF lexeme a
Group ((c -> d) -> [c] -> [d]
forall a b. (a -> b) -> [a] -> [b]
map c -> d
g [c]
as)
        CompoundStmt [c]
as -> [d] -> NodeF b d
forall lexeme a. [a] -> NodeF lexeme a
CompoundStmt ((c -> d) -> [c] -> [d]
forall a b. (a -> b) -> [a] -> [b]
map c -> d
g [c]
as)
        NodeF a c
Break -> NodeF b d
forall lexeme a. NodeF lexeme a
Break
        Goto a
l -> b -> NodeF b d
forall lexeme a. lexeme -> NodeF lexeme a
Goto (a -> b
f a
l)
        NodeF a c
Continue -> NodeF b d
forall lexeme a. NodeF lexeme a
Continue
        Return Maybe c
ma -> Maybe d -> NodeF b d
forall lexeme a. Maybe a -> NodeF lexeme a
Return ((c -> d) -> Maybe c -> Maybe d
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap c -> d
g Maybe c
ma)
        SwitchStmt c
a [c]
as -> d -> [d] -> NodeF b d
forall lexeme a. a -> [a] -> NodeF lexeme a
SwitchStmt (c -> d
g c
a) ((c -> d) -> [c] -> [d]
forall a b. (a -> b) -> [a] -> [b]
map c -> d
g [c]
as)
        IfStmt c
a c
a' Maybe c
ma'' -> d -> d -> Maybe d -> NodeF b d
forall lexeme a. a -> a -> Maybe a -> NodeF lexeme a
IfStmt (c -> d
g c
a) (c -> d
g c
a') ((c -> d) -> Maybe c -> Maybe d
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap c -> d
g Maybe c
ma'')
        ForStmt c
a c
a' c
a'' c
a''' -> d -> d -> d -> d -> NodeF b d
forall lexeme a. a -> a -> a -> a -> NodeF lexeme a
ForStmt (c -> d
g c
a) (c -> d
g c
a') (c -> d
g c
a'') (c -> d
g c
a''')
        WhileStmt c
a c
as -> d -> d -> NodeF b d
forall lexeme a. a -> a -> NodeF lexeme a
WhileStmt (c -> d
g c
a) (c -> d
g c
as)
        DoWhileStmt c
a c
a' -> d -> d -> NodeF b d
forall lexeme a. a -> a -> NodeF lexeme a
DoWhileStmt (c -> d
g c
a) (c -> d
g c
a')
        Case c
a c
a' -> d -> d -> NodeF b d
forall lexeme a. a -> a -> NodeF lexeme a
Case (c -> d
g c
a) (c -> d
g c
a')
        Default c
a -> d -> NodeF b d
forall lexeme a. a -> NodeF lexeme a
Default (c -> d
g c
a)
        Label a
l c
a -> b -> d -> NodeF b d
forall lexeme a. lexeme -> a -> NodeF lexeme a
Label (a -> b
f a
l) (c -> d
g c
a)
        ExprStmt c
a -> d -> NodeF b d
forall lexeme a. a -> NodeF lexeme a
ExprStmt (c -> d
g c
a)
        VLA c
a a
l c
a' -> d -> b -> d -> NodeF b d
forall lexeme a. a -> lexeme -> a -> NodeF lexeme a
VLA (c -> d
g c
a) (a -> b
f a
l) (c -> d
g c
a')
        VarDeclStmt c
a Maybe c
ma -> d -> Maybe d -> NodeF b d
forall lexeme a. a -> Maybe a -> NodeF lexeme a
VarDeclStmt (c -> d
g c
a) ((c -> d) -> Maybe c -> Maybe d
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap c -> d
g Maybe c
ma)
        VarDecl c
a a
l [c]
as -> d -> b -> [d] -> NodeF b d
forall lexeme a. a -> lexeme -> [a] -> NodeF lexeme a
VarDecl (c -> d
g c
a) (a -> b
f a
l) ((c -> d) -> [c] -> [d]
forall a b. (a -> b) -> [a] -> [b]
map c -> d
g [c]
as)
        DeclSpecArray Nullability
nullability Maybe c
ma -> Nullability -> Maybe d -> NodeF b d
forall lexeme a. Nullability -> Maybe a -> NodeF lexeme a
DeclSpecArray Nullability
nullability ((c -> d) -> Maybe c -> Maybe d
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap c -> d
g Maybe c
ma)
        InitialiserList [c]
as -> [d] -> NodeF b d
forall lexeme a. [a] -> NodeF lexeme a
InitialiserList ((c -> d) -> [c] -> [d]
forall a b. (a -> b) -> [a] -> [b]
map c -> d
g [c]
as)
        UnaryExpr UnaryOp
u c
a -> UnaryOp -> d -> NodeF b d
forall lexeme a. UnaryOp -> a -> NodeF lexeme a
UnaryExpr UnaryOp
u (c -> d
g c
a)
        BinaryExpr c
a BinaryOp
b c
a' -> d -> BinaryOp -> d -> NodeF b d
forall lexeme a. a -> BinaryOp -> a -> NodeF lexeme a
BinaryExpr (c -> d
g c
a) BinaryOp
b (c -> d
g c
a')
        TernaryExpr c
a c
a' c
a'' -> d -> d -> d -> NodeF b d
forall lexeme a. a -> a -> a -> NodeF lexeme a
TernaryExpr (c -> d
g c
a) (c -> d
g c
a') (c -> d
g c
a'')
        AssignExpr c
a AssignOp
as c
a' -> d -> AssignOp -> d -> NodeF b d
forall lexeme a. a -> AssignOp -> a -> NodeF lexeme a
AssignExpr (c -> d
g c
a) AssignOp
as (c -> d
g c
a')
        ParenExpr c
a -> d -> NodeF b d
forall lexeme a. a -> NodeF lexeme a
ParenExpr (c -> d
g c
a)
        CastExpr c
a c
a' -> d -> d -> NodeF b d
forall lexeme a. a -> a -> NodeF lexeme a
CastExpr (c -> d
g c
a) (c -> d
g c
a')
        CompoundLiteral c
a c
a' -> d -> d -> NodeF b d
forall lexeme a. a -> a -> NodeF lexeme a
CompoundLiteral (c -> d
g c
a) (c -> d
g c
a')
        SizeofExpr c
a -> d -> NodeF b d
forall lexeme a. a -> NodeF lexeme a
SizeofExpr (c -> d
g c
a)
        SizeofType c
a -> d -> NodeF b d
forall lexeme a. a -> NodeF lexeme a
SizeofType (c -> d
g c
a)
        LiteralExpr LiteralType
t a
l -> LiteralType -> b -> NodeF b d
forall lexeme a. LiteralType -> lexeme -> NodeF lexeme a
LiteralExpr LiteralType
t (a -> b
f a
l)
        VarExpr a
l -> b -> NodeF b d
forall lexeme a. lexeme -> NodeF lexeme a
VarExpr (a -> b
f a
l)
        MemberAccess c
a a
l -> d -> b -> NodeF b d
forall lexeme a. a -> lexeme -> NodeF lexeme a
MemberAccess (c -> d
g c
a) (a -> b
f a
l)
        PointerAccess c
a a
l -> d -> b -> NodeF b d
forall lexeme a. a -> lexeme -> NodeF lexeme a
PointerAccess (c -> d
g c
a) (a -> b
f a
l)
        ArrayAccess c
a c
a' -> d -> d -> NodeF b d
forall lexeme a. a -> a -> NodeF lexeme a
ArrayAccess (c -> d
g c
a) (c -> d
g c
a')
        FunctionCall c
a [c]
as -> d -> [d] -> NodeF b d
forall lexeme a. a -> [a] -> NodeF lexeme a
FunctionCall (c -> d
g c
a) ((c -> d) -> [c] -> [d]
forall a b. (a -> b) -> [a] -> [b]
map c -> d
g [c]
as)
        CommentExpr c
a c
a' -> d -> d -> NodeF b d
forall lexeme a. a -> a -> NodeF lexeme a
CommentExpr (c -> d
g c
a) (c -> d
g c
a')
        EnumConsts Maybe a
ml [c]
as -> Maybe b -> [d] -> NodeF b d
forall lexeme a. Maybe lexeme -> [a] -> NodeF lexeme a
EnumConsts ((a -> b) -> Maybe a -> Maybe b
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
f Maybe a
ml) ((c -> d) -> [c] -> [d]
forall a b. (a -> b) -> [a] -> [b]
map c -> d
g [c]
as)
        EnumDecl a
l [c]
as a
l' -> b -> [d] -> b -> NodeF b d
forall lexeme a. lexeme -> [a] -> lexeme -> NodeF lexeme a
EnumDecl (a -> b
f a
l) ((c -> d) -> [c] -> [d]
forall a b. (a -> b) -> [a] -> [b]
map c -> d
g [c]
as) (a -> b
f a
l')
        Enumerator a
l Maybe c
ma -> b -> Maybe d -> NodeF b d
forall lexeme a. lexeme -> Maybe a -> NodeF lexeme a
Enumerator (a -> b
f a
l) ((c -> d) -> Maybe c -> Maybe d
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap c -> d
g Maybe c
ma)
        AggregateDecl c
a -> d -> NodeF b d
forall lexeme a. a -> NodeF lexeme a
AggregateDecl (c -> d
g c
a)
        Typedef c
a a
l [c]
as -> d -> b -> [d] -> NodeF b d
forall lexeme a. a -> lexeme -> [a] -> NodeF lexeme a
Typedef (c -> d
g c
a) (a -> b
f a
l) ((c -> d) -> [c] -> [d]
forall a b. (a -> b) -> [a] -> [b]
map c -> d
g [c]
as)
        TypedefFunction c
a -> d -> NodeF b d
forall lexeme a. a -> NodeF lexeme a
TypedefFunction (c -> d
g c
a)
        Struct a
l [c]
as -> b -> [d] -> NodeF b d
forall lexeme a. lexeme -> [a] -> NodeF lexeme a
Struct (a -> b
f a
l) ((c -> d) -> [c] -> [d]
forall a b. (a -> b) -> [a] -> [b]
map c -> d
g [c]
as)
        Union a
l [c]
as -> b -> [d] -> NodeF b d
forall lexeme a. lexeme -> [a] -> NodeF lexeme a
Union (a -> b
f a
l) ((c -> d) -> [c] -> [d]
forall a b. (a -> b) -> [a] -> [b]
map c -> d
g [c]
as)
        MemberDecl c
a Maybe a
ml -> d -> Maybe b -> NodeF b d
forall lexeme a. a -> Maybe lexeme -> NodeF lexeme a
MemberDecl (c -> d
g c
a) ((a -> b) -> Maybe a -> Maybe b
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
f Maybe a
ml)
        TyBitwise c
a -> d -> NodeF b d
forall lexeme a. a -> NodeF lexeme a
TyBitwise (c -> d
g c
a)
        TyForce c
a -> d -> NodeF b d
forall lexeme a. a -> NodeF lexeme a
TyForce (c -> d
g c
a)
        TyConst c
a -> d -> NodeF b d
forall lexeme a. a -> NodeF lexeme a
TyConst (c -> d
g c
a)
        TyOwner c
a -> d -> NodeF b d
forall lexeme a. a -> NodeF lexeme a
TyOwner (c -> d
g c
a)
        TyNonnull c
a -> d -> NodeF b d
forall lexeme a. a -> NodeF lexeme a
TyNonnull (c -> d
g c
a)
        TyNullable c
a -> d -> NodeF b d
forall lexeme a. a -> NodeF lexeme a
TyNullable (c -> d
g c
a)
        TyPointer c
a -> d -> NodeF b d
forall lexeme a. a -> NodeF lexeme a
TyPointer (c -> d
g c
a)
        TyStruct a
l -> b -> NodeF b d
forall lexeme a. lexeme -> NodeF lexeme a
TyStruct (a -> b
f a
l)
        TyUnion a
l -> b -> NodeF b d
forall lexeme a. lexeme -> NodeF lexeme a
TyUnion (a -> b
f a
l)
        TyFunc a
l -> b -> NodeF b d
forall lexeme a. lexeme -> NodeF lexeme a
TyFunc (a -> b
f a
l)
        TyStd a
l -> b -> NodeF b d
forall lexeme a. lexeme -> NodeF lexeme a
TyStd (a -> b
f a
l)
        TyUserDefined a
l -> b -> NodeF b d
forall lexeme a. lexeme -> NodeF lexeme a
TyUserDefined (a -> b
f a
l)
        AttrPrintf a
l a
l' c
a -> b -> b -> d -> NodeF b d
forall lexeme a. lexeme -> lexeme -> a -> NodeF lexeme a
AttrPrintf (a -> b
f a
l) (a -> b
f a
l') (c -> d
g c
a)
        AttrAllocSize [a]
ls c
a -> [b] -> d -> NodeF b d
forall lexeme a. [lexeme] -> a -> NodeF lexeme a
AttrAllocSize ((a -> b) -> [a] -> [b]
forall a b. (a -> b) -> [a] -> [b]
map a -> b
f [a]
ls) (c -> d
g c
a)
        FunctionDecl Scope
s c
a -> Scope -> d -> NodeF b d
forall lexeme a. Scope -> a -> NodeF lexeme a
FunctionDecl Scope
s (c -> d
g c
a)
        FunctionDefn Scope
s c
a c
a' -> Scope -> d -> d -> NodeF b d
forall lexeme a. Scope -> a -> a -> NodeF lexeme a
FunctionDefn Scope
s (c -> d
g c
a) (c -> d
g c
a')
        FunctionPrototype c
a a
l [c]
as -> d -> b -> [d] -> NodeF b d
forall lexeme a. a -> lexeme -> [a] -> NodeF lexeme a
FunctionPrototype (c -> d
g c
a) (a -> b
f a
l) ((c -> d) -> [c] -> [d]
forall a b. (a -> b) -> [a] -> [b]
map c -> d
g [c]
as)
        CallbackDecl a
l a
l' -> b -> b -> NodeF b d
forall lexeme a. lexeme -> lexeme -> NodeF lexeme a
CallbackDecl (a -> b
f a
l) (a -> b
f a
l')
        NodeF a c
Ellipsis -> NodeF b d
forall lexeme a. NodeF lexeme a
Ellipsis
        NonNull [a]
ls [a]
ls' c
a -> [b] -> [b] -> d -> NodeF b d
forall lexeme a. [lexeme] -> [lexeme] -> a -> NodeF lexeme a
NonNull ((a -> b) -> [a] -> [b]
forall a b. (a -> b) -> [a] -> [b]
map a -> b
f [a]
ls) ((a -> b) -> [a] -> [b]
forall a b. (a -> b) -> [a] -> [b]
map a -> b
f [a]
ls') (c -> d
g c
a)
        NonNullParam c
a -> d -> NodeF b d
forall lexeme a. a -> NodeF lexeme a
NonNullParam (c -> d
g c
a)
        NullableParam c
a -> d -> NodeF b d
forall lexeme a. a -> NodeF lexeme a
NullableParam (c -> d
g c
a)
        ConstDecl c
a a
l -> d -> b -> NodeF b d
forall lexeme a. a -> lexeme -> NodeF lexeme a
ConstDecl (c -> d
g c
a) (a -> b
f a
l)
        ConstDefn Scope
s c
a a
l c
a' -> Scope -> d -> b -> d -> NodeF b d
forall lexeme a. Scope -> a -> lexeme -> a -> NodeF lexeme a
ConstDefn Scope
s (c -> d
g c
a) (a -> b
f a
l) (c -> d
g c
a')

type Node lexeme = Fix (NodeF lexeme)

instance FromJSON lexeme => FromJSON1 (NodeF lexeme)
instance ToJSON lexeme => ToJSON1 (NodeF lexeme)
instance Hashable lexeme => Hashable1 (NodeF lexeme)

data CommentF lexeme a
    = DocComment [a]

    | DocAttention
    | DocBrief
    | DocDeprecated
    | DocExtends lexeme
    | DocFile
    | DocImplements lexeme
    | DocNote
    | DocParam (Maybe lexeme) lexeme
    | DocReturn
    | DocRetval
    | DocSection lexeme
    | DocSecurityRank lexeme (Maybe lexeme) lexeme
    | DocSee lexeme
    | DocThread lexeme
    | DocGuardedBy lexeme
    | DocRequires lexeme lexeme
    | DocSubsection lexeme

    | DocPrivate

    | DocLine [a]
    | DocCode lexeme [a] lexeme

    | DocWord lexeme
    | DocRef lexeme
    | DocP lexeme
    deriving (Int -> CommentF lexeme a -> ShowS
[CommentF lexeme a] -> ShowS
CommentF lexeme a -> String
(Int -> CommentF lexeme a -> ShowS)
-> (CommentF lexeme a -> String)
-> ([CommentF lexeme a] -> ShowS)
-> Show (CommentF lexeme a)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall lexeme a.
(Show a, Show lexeme) =>
Int -> CommentF lexeme a -> ShowS
forall lexeme a.
(Show a, Show lexeme) =>
[CommentF lexeme a] -> ShowS
forall lexeme a.
(Show a, Show lexeme) =>
CommentF lexeme a -> String
$cshowsPrec :: forall lexeme a.
(Show a, Show lexeme) =>
Int -> CommentF lexeme a -> ShowS
showsPrec :: Int -> CommentF lexeme a -> ShowS
$cshow :: forall lexeme a.
(Show a, Show lexeme) =>
CommentF lexeme a -> String
show :: CommentF lexeme a -> String
$cshowList :: forall lexeme a.
(Show a, Show lexeme) =>
[CommentF lexeme a] -> ShowS
showList :: [CommentF lexeme a] -> ShowS
Show, ReadPrec [CommentF lexeme a]
ReadPrec (CommentF lexeme a)
Int -> ReadS (CommentF lexeme a)
ReadS [CommentF lexeme a]
(Int -> ReadS (CommentF lexeme a))
-> ReadS [CommentF lexeme a]
-> ReadPrec (CommentF lexeme a)
-> ReadPrec [CommentF lexeme a]
-> Read (CommentF lexeme a)
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
forall lexeme a.
(Read a, Read lexeme) =>
ReadPrec [CommentF lexeme a]
forall lexeme a.
(Read a, Read lexeme) =>
ReadPrec (CommentF lexeme a)
forall lexeme a.
(Read a, Read lexeme) =>
Int -> ReadS (CommentF lexeme a)
forall lexeme a. (Read a, Read lexeme) => ReadS [CommentF lexeme a]
$creadsPrec :: forall lexeme a.
(Read a, Read lexeme) =>
Int -> ReadS (CommentF lexeme a)
readsPrec :: Int -> ReadS (CommentF lexeme a)
$creadList :: forall lexeme a. (Read a, Read lexeme) => ReadS [CommentF lexeme a]
readList :: ReadS [CommentF lexeme a]
$creadPrec :: forall lexeme a.
(Read a, Read lexeme) =>
ReadPrec (CommentF lexeme a)
readPrec :: ReadPrec (CommentF lexeme a)
$creadListPrec :: forall lexeme a.
(Read a, Read lexeme) =>
ReadPrec [CommentF lexeme a]
readListPrec :: ReadPrec [CommentF lexeme a]
Read, CommentF lexeme a -> CommentF lexeme a -> Bool
(CommentF lexeme a -> CommentF lexeme a -> Bool)
-> (CommentF lexeme a -> CommentF lexeme a -> Bool)
-> Eq (CommentF lexeme a)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall lexeme a.
(Eq a, Eq lexeme) =>
CommentF lexeme a -> CommentF lexeme a -> Bool
$c== :: forall lexeme a.
(Eq a, Eq lexeme) =>
CommentF lexeme a -> CommentF lexeme a -> Bool
== :: CommentF lexeme a -> CommentF lexeme a -> Bool
$c/= :: forall lexeme a.
(Eq a, Eq lexeme) =>
CommentF lexeme a -> CommentF lexeme a -> Bool
/= :: CommentF lexeme a -> CommentF lexeme a -> Bool
Eq, Eq (CommentF lexeme a)
Eq (CommentF lexeme a) =>
(CommentF lexeme a -> CommentF lexeme a -> Ordering)
-> (CommentF lexeme a -> CommentF lexeme a -> Bool)
-> (CommentF lexeme a -> CommentF lexeme a -> Bool)
-> (CommentF lexeme a -> CommentF lexeme a -> Bool)
-> (CommentF lexeme a -> CommentF lexeme a -> Bool)
-> (CommentF lexeme a -> CommentF lexeme a -> CommentF lexeme a)
-> (CommentF lexeme a -> CommentF lexeme a -> CommentF lexeme a)
-> Ord (CommentF lexeme a)
CommentF lexeme a -> CommentF lexeme a -> Bool
CommentF lexeme a -> CommentF lexeme a -> Ordering
CommentF lexeme a -> CommentF lexeme a -> CommentF lexeme a
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
forall lexeme a. (Ord a, Ord lexeme) => Eq (CommentF lexeme a)
forall lexeme a.
(Ord a, Ord lexeme) =>
CommentF lexeme a -> CommentF lexeme a -> Bool
forall lexeme a.
(Ord a, Ord lexeme) =>
CommentF lexeme a -> CommentF lexeme a -> Ordering
forall lexeme a.
(Ord a, Ord lexeme) =>
CommentF lexeme a -> CommentF lexeme a -> CommentF lexeme a
$ccompare :: forall lexeme a.
(Ord a, Ord lexeme) =>
CommentF lexeme a -> CommentF lexeme a -> Ordering
compare :: CommentF lexeme a -> CommentF lexeme a -> Ordering
$c< :: forall lexeme a.
(Ord a, Ord lexeme) =>
CommentF lexeme a -> CommentF lexeme a -> Bool
< :: CommentF lexeme a -> CommentF lexeme a -> Bool
$c<= :: forall lexeme a.
(Ord a, Ord lexeme) =>
CommentF lexeme a -> CommentF lexeme a -> Bool
<= :: CommentF lexeme a -> CommentF lexeme a -> Bool
$c> :: forall lexeme a.
(Ord a, Ord lexeme) =>
CommentF lexeme a -> CommentF lexeme a -> Bool
> :: CommentF lexeme a -> CommentF lexeme a -> Bool
$c>= :: forall lexeme a.
(Ord a, Ord lexeme) =>
CommentF lexeme a -> CommentF lexeme a -> Bool
>= :: CommentF lexeme a -> CommentF lexeme a -> Bool
$cmax :: forall lexeme a.
(Ord a, Ord lexeme) =>
CommentF lexeme a -> CommentF lexeme a -> CommentF lexeme a
max :: CommentF lexeme a -> CommentF lexeme a -> CommentF lexeme a
$cmin :: forall lexeme a.
(Ord a, Ord lexeme) =>
CommentF lexeme a -> CommentF lexeme a -> CommentF lexeme a
min :: CommentF lexeme a -> CommentF lexeme a -> CommentF lexeme a
Ord, (forall x. CommentF lexeme a -> Rep (CommentF lexeme a) x)
-> (forall x. Rep (CommentF lexeme a) x -> CommentF lexeme a)
-> Generic (CommentF lexeme a)
forall x. Rep (CommentF lexeme a) x -> CommentF lexeme a
forall x. CommentF lexeme a -> Rep (CommentF lexeme a) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall lexeme a x. Rep (CommentF lexeme a) x -> CommentF lexeme a
forall lexeme a x. CommentF lexeme a -> Rep (CommentF lexeme a) x
$cfrom :: forall lexeme a x. CommentF lexeme a -> Rep (CommentF lexeme a) x
from :: forall x. CommentF lexeme a -> Rep (CommentF lexeme a) x
$cto :: forall lexeme a x. Rep (CommentF lexeme a) x -> CommentF lexeme a
to :: forall x. Rep (CommentF lexeme a) x -> CommentF lexeme a
Generic, (forall a. CommentF lexeme a -> Rep1 (CommentF lexeme) a)
-> (forall a. Rep1 (CommentF lexeme) a -> CommentF lexeme a)
-> Generic1 (CommentF lexeme)
forall a. Rep1 (CommentF lexeme) a -> CommentF lexeme a
forall a. CommentF lexeme a -> Rep1 (CommentF lexeme) a
forall lexeme a. Rep1 (CommentF lexeme) a -> CommentF lexeme a
forall lexeme a. CommentF lexeme a -> Rep1 (CommentF lexeme) a
forall k (f :: k -> *).
(forall (a :: k). f a -> Rep1 f a)
-> (forall (a :: k). Rep1 f a -> f a) -> Generic1 f
$cfrom1 :: forall lexeme a. CommentF lexeme a -> Rep1 (CommentF lexeme) a
from1 :: forall a. CommentF lexeme a -> Rep1 (CommentF lexeme) a
$cto1 :: forall lexeme a. Rep1 (CommentF lexeme) a -> CommentF lexeme a
to1 :: forall a. Rep1 (CommentF lexeme) a -> CommentF lexeme a
Generic1, (forall a b. (a -> b) -> CommentF lexeme a -> CommentF lexeme b)
-> (forall a b. a -> CommentF lexeme b -> CommentF lexeme a)
-> Functor (CommentF lexeme)
forall a b. a -> CommentF lexeme b -> CommentF lexeme a
forall a b. (a -> b) -> CommentF lexeme a -> CommentF lexeme b
forall lexeme a b. a -> CommentF lexeme b -> CommentF lexeme a
forall lexeme a b.
(a -> b) -> CommentF lexeme a -> CommentF lexeme b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall lexeme a b.
(a -> b) -> CommentF lexeme a -> CommentF lexeme b
fmap :: forall a b. (a -> b) -> CommentF lexeme a -> CommentF lexeme b
$c<$ :: forall lexeme a b. a -> CommentF lexeme b -> CommentF lexeme a
<$ :: forall a b. a -> CommentF lexeme b -> CommentF lexeme a
Functor, (forall m. Monoid m => CommentF lexeme m -> m)
-> (forall m a. Monoid m => (a -> m) -> CommentF lexeme a -> m)
-> (forall m a. Monoid m => (a -> m) -> CommentF lexeme a -> m)
-> (forall a b. (a -> b -> b) -> b -> CommentF lexeme a -> b)
-> (forall a b. (a -> b -> b) -> b -> CommentF lexeme a -> b)
-> (forall b a. (b -> a -> b) -> b -> CommentF lexeme a -> b)
-> (forall b a. (b -> a -> b) -> b -> CommentF lexeme a -> b)
-> (forall a. (a -> a -> a) -> CommentF lexeme a -> a)
-> (forall a. (a -> a -> a) -> CommentF lexeme a -> a)
-> (forall a. CommentF lexeme a -> [a])
-> (forall a. CommentF lexeme a -> Bool)
-> (forall a. CommentF lexeme a -> Int)
-> (forall a. Eq a => a -> CommentF lexeme a -> Bool)
-> (forall a. Ord a => CommentF lexeme a -> a)
-> (forall a. Ord a => CommentF lexeme a -> a)
-> (forall a. Num a => CommentF lexeme a -> a)
-> (forall a. Num a => CommentF lexeme a -> a)
-> Foldable (CommentF lexeme)
forall a. Eq a => a -> CommentF lexeme a -> Bool
forall a. Num a => CommentF lexeme a -> a
forall a. Ord a => CommentF lexeme a -> a
forall m. Monoid m => CommentF lexeme m -> m
forall a. CommentF lexeme a -> Bool
forall a. CommentF lexeme a -> Int
forall a. CommentF lexeme a -> [a]
forall a. (a -> a -> a) -> CommentF lexeme a -> a
forall lexeme a. Eq a => a -> CommentF lexeme a -> Bool
forall lexeme a. Num a => CommentF lexeme a -> a
forall lexeme a. Ord a => CommentF lexeme a -> a
forall lexeme m. Monoid m => CommentF lexeme m -> m
forall m a. Monoid m => (a -> m) -> CommentF lexeme a -> m
forall lexeme a. CommentF lexeme a -> Bool
forall lexeme a. CommentF lexeme a -> Int
forall lexeme a. CommentF lexeme a -> [a]
forall b a. (b -> a -> b) -> b -> CommentF lexeme a -> b
forall a b. (a -> b -> b) -> b -> CommentF lexeme a -> b
forall lexeme a. (a -> a -> a) -> CommentF lexeme a -> a
forall lexeme m a. Monoid m => (a -> m) -> CommentF lexeme a -> m
forall lexeme b a. (b -> a -> b) -> b -> CommentF lexeme a -> b
forall lexeme a b. (a -> b -> b) -> b -> CommentF lexeme a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
$cfold :: forall lexeme m. Monoid m => CommentF lexeme m -> m
fold :: forall m. Monoid m => CommentF lexeme m -> m
$cfoldMap :: forall lexeme m a. Monoid m => (a -> m) -> CommentF lexeme a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> CommentF lexeme a -> m
$cfoldMap' :: forall lexeme m a. Monoid m => (a -> m) -> CommentF lexeme a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> CommentF lexeme a -> m
$cfoldr :: forall lexeme a b. (a -> b -> b) -> b -> CommentF lexeme a -> b
foldr :: forall a b. (a -> b -> b) -> b -> CommentF lexeme a -> b
$cfoldr' :: forall lexeme a b. (a -> b -> b) -> b -> CommentF lexeme a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> CommentF lexeme a -> b
$cfoldl :: forall lexeme b a. (b -> a -> b) -> b -> CommentF lexeme a -> b
foldl :: forall b a. (b -> a -> b) -> b -> CommentF lexeme a -> b
$cfoldl' :: forall lexeme b a. (b -> a -> b) -> b -> CommentF lexeme a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> CommentF lexeme a -> b
$cfoldr1 :: forall lexeme a. (a -> a -> a) -> CommentF lexeme a -> a
foldr1 :: forall a. (a -> a -> a) -> CommentF lexeme a -> a
$cfoldl1 :: forall lexeme a. (a -> a -> a) -> CommentF lexeme a -> a
foldl1 :: forall a. (a -> a -> a) -> CommentF lexeme a -> a
$ctoList :: forall lexeme a. CommentF lexeme a -> [a]
toList :: forall a. CommentF lexeme a -> [a]
$cnull :: forall lexeme a. CommentF lexeme a -> Bool
null :: forall a. CommentF lexeme a -> Bool
$clength :: forall lexeme a. CommentF lexeme a -> Int
length :: forall a. CommentF lexeme a -> Int
$celem :: forall lexeme a. Eq a => a -> CommentF lexeme a -> Bool
elem :: forall a. Eq a => a -> CommentF lexeme a -> Bool
$cmaximum :: forall lexeme a. Ord a => CommentF lexeme a -> a
maximum :: forall a. Ord a => CommentF lexeme a -> a
$cminimum :: forall lexeme a. Ord a => CommentF lexeme a -> a
minimum :: forall a. Ord a => CommentF lexeme a -> a
$csum :: forall lexeme a. Num a => CommentF lexeme a -> a
sum :: forall a. Num a => CommentF lexeme a -> a
$cproduct :: forall lexeme a. Num a => CommentF lexeme a -> a
product :: forall a. Num a => CommentF lexeme a -> a
Foldable, Functor (CommentF lexeme)
Foldable (CommentF lexeme)
(Functor (CommentF lexeme), Foldable (CommentF lexeme)) =>
(forall (f :: * -> *) a b.
 Applicative f =>
 (a -> f b) -> CommentF lexeme a -> f (CommentF lexeme b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    CommentF lexeme (f a) -> f (CommentF lexeme a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> CommentF lexeme a -> m (CommentF lexeme b))
-> (forall (m :: * -> *) a.
    Monad m =>
    CommentF lexeme (m a) -> m (CommentF lexeme a))
-> Traversable (CommentF lexeme)
forall lexeme. Functor (CommentF lexeme)
forall lexeme. Foldable (CommentF lexeme)
forall lexeme (m :: * -> *) a.
Monad m =>
CommentF lexeme (m a) -> m (CommentF lexeme a)
forall lexeme (f :: * -> *) a.
Applicative f =>
CommentF lexeme (f a) -> f (CommentF lexeme a)
forall lexeme (m :: * -> *) a b.
Monad m =>
(a -> m b) -> CommentF lexeme a -> m (CommentF lexeme b)
forall lexeme (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> CommentF lexeme a -> f (CommentF lexeme b)
forall (t :: * -> *).
(Functor t, Foldable t) =>
(forall (f :: * -> *) a b.
 Applicative f =>
 (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
CommentF lexeme (m a) -> m (CommentF lexeme a)
forall (f :: * -> *) a.
Applicative f =>
CommentF lexeme (f a) -> f (CommentF lexeme a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> CommentF lexeme a -> m (CommentF lexeme b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> CommentF lexeme a -> f (CommentF lexeme b)
$ctraverse :: forall lexeme (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> CommentF lexeme a -> f (CommentF lexeme b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> CommentF lexeme a -> f (CommentF lexeme b)
$csequenceA :: forall lexeme (f :: * -> *) a.
Applicative f =>
CommentF lexeme (f a) -> f (CommentF lexeme a)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
CommentF lexeme (f a) -> f (CommentF lexeme a)
$cmapM :: forall lexeme (m :: * -> *) a b.
Monad m =>
(a -> m b) -> CommentF lexeme a -> m (CommentF lexeme b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> CommentF lexeme a -> m (CommentF lexeme b)
$csequence :: forall lexeme (m :: * -> *) a.
Monad m =>
CommentF lexeme (m a) -> m (CommentF lexeme a)
sequence :: forall (m :: * -> *) a.
Monad m =>
CommentF lexeme (m a) -> m (CommentF lexeme a)
Traversable)
    deriving ((forall a. Show a => Show (CommentF lexeme a)) =>
(forall a.
 (Int -> a -> ShowS)
 -> ([a] -> ShowS) -> Int -> CommentF lexeme a -> ShowS)
-> (forall a.
    (Int -> a -> ShowS)
    -> ([a] -> ShowS) -> [CommentF lexeme a] -> ShowS)
-> Show1 (CommentF lexeme)
forall a. Show a => Show (CommentF lexeme a)
forall lexeme a. (Show lexeme, Show a) => Show (CommentF lexeme a)
forall lexeme a.
Show lexeme =>
(Int -> a -> ShowS)
-> ([a] -> ShowS) -> Int -> CommentF lexeme a -> ShowS
forall lexeme a.
Show lexeme =>
(Int -> a -> ShowS)
-> ([a] -> ShowS) -> [CommentF lexeme a] -> ShowS
forall a.
(Int -> a -> ShowS)
-> ([a] -> ShowS) -> Int -> CommentF lexeme a -> ShowS
forall a.
(Int -> a -> ShowS)
-> ([a] -> ShowS) -> [CommentF lexeme a] -> ShowS
forall (f :: * -> *).
(forall a. Show a => Show (f a)) =>
(forall a.
 (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> f a -> ShowS)
-> (forall a.
    (Int -> a -> ShowS) -> ([a] -> ShowS) -> [f a] -> ShowS)
-> Show1 f
$cliftShowsPrec :: forall lexeme a.
Show lexeme =>
(Int -> a -> ShowS)
-> ([a] -> ShowS) -> Int -> CommentF lexeme a -> ShowS
liftShowsPrec :: forall a.
(Int -> a -> ShowS)
-> ([a] -> ShowS) -> Int -> CommentF lexeme a -> ShowS
$cliftShowList :: forall lexeme a.
Show lexeme =>
(Int -> a -> ShowS)
-> ([a] -> ShowS) -> [CommentF lexeme a] -> ShowS
liftShowList :: forall a.
(Int -> a -> ShowS)
-> ([a] -> ShowS) -> [CommentF lexeme a] -> ShowS
Show1, (forall a. Read a => Read (CommentF lexeme a)) =>
(forall a.
 (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (CommentF lexeme a))
-> (forall a.
    (Int -> ReadS a) -> ReadS [a] -> ReadS [CommentF lexeme a])
-> (forall a.
    ReadPrec a -> ReadPrec [a] -> ReadPrec (CommentF lexeme a))
-> (forall a.
    ReadPrec a -> ReadPrec [a] -> ReadPrec [CommentF lexeme a])
-> Read1 (CommentF lexeme)
forall a. Read a => Read (CommentF lexeme a)
forall lexeme a. (Read lexeme, Read a) => Read (CommentF lexeme a)
forall lexeme a.
Read lexeme =>
ReadPrec a -> ReadPrec [a] -> ReadPrec [CommentF lexeme a]
forall lexeme a.
Read lexeme =>
ReadPrec a -> ReadPrec [a] -> ReadPrec (CommentF lexeme a)
forall lexeme a.
Read lexeme =>
(Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (CommentF lexeme a)
forall lexeme a.
Read lexeme =>
(Int -> ReadS a) -> ReadS [a] -> ReadS [CommentF lexeme a]
forall a.
ReadPrec a -> ReadPrec [a] -> ReadPrec [CommentF lexeme a]
forall a.
ReadPrec a -> ReadPrec [a] -> ReadPrec (CommentF lexeme a)
forall a.
(Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (CommentF lexeme a)
forall a.
(Int -> ReadS a) -> ReadS [a] -> ReadS [CommentF lexeme a]
forall (f :: * -> *).
(forall a. Read a => Read (f a)) =>
(forall a. (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (f a))
-> (forall a. (Int -> ReadS a) -> ReadS [a] -> ReadS [f a])
-> (forall a. ReadPrec a -> ReadPrec [a] -> ReadPrec (f a))
-> (forall a. ReadPrec a -> ReadPrec [a] -> ReadPrec [f a])
-> Read1 f
$cliftReadsPrec :: forall lexeme a.
Read lexeme =>
(Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (CommentF lexeme a)
liftReadsPrec :: forall a.
(Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (CommentF lexeme a)
$cliftReadList :: forall lexeme a.
Read lexeme =>
(Int -> ReadS a) -> ReadS [a] -> ReadS [CommentF lexeme a]
liftReadList :: forall a.
(Int -> ReadS a) -> ReadS [a] -> ReadS [CommentF lexeme a]
$cliftReadPrec :: forall lexeme a.
Read lexeme =>
ReadPrec a -> ReadPrec [a] -> ReadPrec (CommentF lexeme a)
liftReadPrec :: forall a.
ReadPrec a -> ReadPrec [a] -> ReadPrec (CommentF lexeme a)
$cliftReadListPrec :: forall lexeme a.
Read lexeme =>
ReadPrec a -> ReadPrec [a] -> ReadPrec [CommentF lexeme a]
liftReadListPrec :: forall a.
ReadPrec a -> ReadPrec [a] -> ReadPrec [CommentF lexeme a]
Read1, (forall a. Eq a => Eq (CommentF lexeme a)) =>
(forall a b.
 (a -> b -> Bool) -> CommentF lexeme a -> CommentF lexeme b -> Bool)
-> Eq1 (CommentF lexeme)
forall a. Eq a => Eq (CommentF lexeme a)
forall lexeme a. (Eq lexeme, Eq a) => Eq (CommentF lexeme a)
forall lexeme a b.
Eq lexeme =>
(a -> b -> Bool) -> CommentF lexeme a -> CommentF lexeme b -> Bool
forall a b.
(a -> b -> Bool) -> CommentF lexeme a -> CommentF lexeme b -> Bool
forall (f :: * -> *).
(forall a. Eq a => Eq (f a)) =>
(forall a b. (a -> b -> Bool) -> f a -> f b -> Bool) -> Eq1 f
$cliftEq :: forall lexeme a b.
Eq lexeme =>
(a -> b -> Bool) -> CommentF lexeme a -> CommentF lexeme b -> Bool
liftEq :: forall a b.
(a -> b -> Bool) -> CommentF lexeme a -> CommentF lexeme b -> Bool
Eq1, Eq1 (CommentF lexeme)
(Eq1 (CommentF lexeme),
 forall a. Ord a => Ord (CommentF lexeme a)) =>
(forall a b.
 (a -> b -> Ordering)
 -> CommentF lexeme a -> CommentF lexeme b -> Ordering)
-> Ord1 (CommentF lexeme)
forall a. Ord a => Ord (CommentF lexeme a)
forall lexeme. Ord lexeme => Eq1 (CommentF lexeme)
forall lexeme a. (Ord lexeme, Ord a) => Ord (CommentF lexeme a)
forall lexeme a b.
Ord lexeme =>
(a -> b -> Ordering)
-> CommentF lexeme a -> CommentF lexeme b -> Ordering
forall a b.
(a -> b -> Ordering)
-> CommentF lexeme a -> CommentF lexeme b -> Ordering
forall (f :: * -> *).
(Eq1 f, forall a. Ord a => Ord (f a)) =>
(forall a b. (a -> b -> Ordering) -> f a -> f b -> Ordering)
-> Ord1 f
$cliftCompare :: forall lexeme a b.
Ord lexeme =>
(a -> b -> Ordering)
-> CommentF lexeme a -> CommentF lexeme b -> Ordering
liftCompare :: forall a b.
(a -> b -> Ordering)
-> CommentF lexeme a -> CommentF lexeme b -> Ordering
Ord1) via FunctorClassesDefault (CommentF lexeme)

instance Bifunctor CommentF where
    bimap :: forall a b c d.
(a -> b) -> (c -> d) -> CommentF a c -> CommentF b d
bimap a -> b
f c -> d
g CommentF a c
n = case CommentF a c
n of
        DocComment [c]
as           -> [d] -> CommentF b d
forall lexeme a. [a] -> CommentF lexeme a
DocComment ((c -> d) -> [c] -> [d]
forall a b. (a -> b) -> [a] -> [b]
map c -> d
g [c]
as)
        CommentF a c
DocAttention            -> CommentF b d
forall lexeme a. CommentF lexeme a
DocAttention
        CommentF a c
DocBrief                -> CommentF b d
forall lexeme a. CommentF lexeme a
DocBrief
        CommentF a c
DocDeprecated           -> CommentF b d
forall lexeme a. CommentF lexeme a
DocDeprecated
        DocExtends a
l            -> b -> CommentF b d
forall lexeme a. lexeme -> CommentF lexeme a
DocExtends (a -> b
f a
l)
        CommentF a c
DocFile                 -> CommentF b d
forall lexeme a. CommentF lexeme a
DocFile
        DocImplements a
l         -> b -> CommentF b d
forall lexeme a. lexeme -> CommentF lexeme a
DocImplements (a -> b
f a
l)
        CommentF a c
DocNote                 -> CommentF b d
forall lexeme a. CommentF lexeme a
DocNote
        DocParam Maybe a
ml a
l           -> Maybe b -> b -> CommentF b d
forall lexeme a. Maybe lexeme -> lexeme -> CommentF lexeme a
DocParam ((a -> b) -> Maybe a -> Maybe b
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
f Maybe a
ml) (a -> b
f a
l)
        CommentF a c
DocReturn               -> CommentF b d
forall lexeme a. CommentF lexeme a
DocReturn
        CommentF a c
DocRetval               -> CommentF b d
forall lexeme a. CommentF lexeme a
DocRetval
        DocSection a
l            -> b -> CommentF b d
forall lexeme a. lexeme -> CommentF lexeme a
DocSection (a -> b
f a
l)
        DocSecurityRank a
l Maybe a
ml a
l' -> b -> Maybe b -> b -> CommentF b d
forall lexeme a.
lexeme -> Maybe lexeme -> lexeme -> CommentF lexeme a
DocSecurityRank (a -> b
f a
l) ((a -> b) -> Maybe a -> Maybe b
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
f Maybe a
ml) (a -> b
f a
l')
        DocSee a
l                -> b -> CommentF b d
forall lexeme a. lexeme -> CommentF lexeme a
DocSee (a -> b
f a
l)
        DocThread a
l             -> b -> CommentF b d
forall lexeme a. lexeme -> CommentF lexeme a
DocThread (a -> b
f a
l)
        DocGuardedBy a
l          -> b -> CommentF b d
forall lexeme a. lexeme -> CommentF lexeme a
DocGuardedBy (a -> b
f a
l)
        DocRequires a
l a
l'        -> b -> b -> CommentF b d
forall lexeme a. lexeme -> lexeme -> CommentF lexeme a
DocRequires (a -> b
f a
l) (a -> b
f a
l')
        DocSubsection a
l         -> b -> CommentF b d
forall lexeme a. lexeme -> CommentF lexeme a
DocSubsection (a -> b
f a
l)
        CommentF a c
DocPrivate              -> CommentF b d
forall lexeme a. CommentF lexeme a
DocPrivate
        DocLine [c]
as              -> [d] -> CommentF b d
forall lexeme a. [a] -> CommentF lexeme a
DocLine ((c -> d) -> [c] -> [d]
forall a b. (a -> b) -> [a] -> [b]
map c -> d
g [c]
as)
        DocCode a
l [c]
as a
l'         -> b -> [d] -> b -> CommentF b d
forall lexeme a. lexeme -> [a] -> lexeme -> CommentF lexeme a
DocCode (a -> b
f a
l) ((c -> d) -> [c] -> [d]
forall a b. (a -> b) -> [a] -> [b]
map c -> d
g [c]
as) (a -> b
f a
l')
        DocWord a
l               -> b -> CommentF b d
forall lexeme a. lexeme -> CommentF lexeme a
DocWord (a -> b
f a
l)
        DocRef a
l                -> b -> CommentF b d
forall lexeme a. lexeme -> CommentF lexeme a
DocRef (a -> b
f a
l)
        DocP a
l                  -> b -> CommentF b d
forall lexeme a. lexeme -> CommentF lexeme a
DocP (a -> b
f a
l)

mapCommentLexeme :: (l -> l') -> Comment l -> Comment l'
mapCommentLexeme :: forall l l'. (l -> l') -> Comment l -> Comment l'
mapCommentLexeme l -> l'
f (Fix CommentF l (Fix (CommentF l))
n) = CommentF l' (Fix (CommentF l')) -> Fix (CommentF l')
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (CommentF l' (Fix (CommentF l')) -> Fix (CommentF l'))
-> CommentF l' (Fix (CommentF l')) -> Fix (CommentF l')
forall a b. (a -> b) -> a -> b
$ (l -> l')
-> (Fix (CommentF l) -> Fix (CommentF l'))
-> CommentF l (Fix (CommentF l))
-> CommentF l' (Fix (CommentF l'))
forall a b c d.
(a -> b) -> (c -> d) -> CommentF a c -> CommentF b d
forall (p :: * -> * -> *) a b c d.
Bifunctor p =>
(a -> b) -> (c -> d) -> p a c -> p b d
bimap l -> l'
f ((l -> l') -> Fix (CommentF l) -> Fix (CommentF l')
forall l l'. (l -> l') -> Comment l -> Comment l'
mapCommentLexeme l -> l'
f) CommentF l (Fix (CommentF l))
n

type Comment lexeme = Fix (CommentF lexeme)

instance FromJSON lexeme => FromJSON1 (CommentF lexeme)
instance ToJSON lexeme => ToJSON1 (CommentF lexeme)
instance Hashable lexeme => Hashable1 (CommentF lexeme)

data AssignOp
    = AopEq
    | AopMul
    | AopDiv
    | AopPlus
    | AopMinus
    | AopBitAnd
    | AopBitOr
    | AopBitXor
    | AopMod
    | AopLsh
    | AopRsh
    deriving (Int -> AssignOp
AssignOp -> Int
AssignOp -> [AssignOp]
AssignOp -> AssignOp
AssignOp -> AssignOp -> [AssignOp]
AssignOp -> AssignOp -> AssignOp -> [AssignOp]
(AssignOp -> AssignOp)
-> (AssignOp -> AssignOp)
-> (Int -> AssignOp)
-> (AssignOp -> Int)
-> (AssignOp -> [AssignOp])
-> (AssignOp -> AssignOp -> [AssignOp])
-> (AssignOp -> AssignOp -> [AssignOp])
-> (AssignOp -> AssignOp -> AssignOp -> [AssignOp])
-> Enum AssignOp
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 :: AssignOp -> AssignOp
succ :: AssignOp -> AssignOp
$cpred :: AssignOp -> AssignOp
pred :: AssignOp -> AssignOp
$ctoEnum :: Int -> AssignOp
toEnum :: Int -> AssignOp
$cfromEnum :: AssignOp -> Int
fromEnum :: AssignOp -> Int
$cenumFrom :: AssignOp -> [AssignOp]
enumFrom :: AssignOp -> [AssignOp]
$cenumFromThen :: AssignOp -> AssignOp -> [AssignOp]
enumFromThen :: AssignOp -> AssignOp -> [AssignOp]
$cenumFromTo :: AssignOp -> AssignOp -> [AssignOp]
enumFromTo :: AssignOp -> AssignOp -> [AssignOp]
$cenumFromThenTo :: AssignOp -> AssignOp -> AssignOp -> [AssignOp]
enumFromThenTo :: AssignOp -> AssignOp -> AssignOp -> [AssignOp]
Enum, AssignOp
AssignOp -> AssignOp -> Bounded AssignOp
forall a. a -> a -> Bounded a
$cminBound :: AssignOp
minBound :: AssignOp
$cmaxBound :: AssignOp
maxBound :: AssignOp
Bounded, Eq AssignOp
Eq AssignOp =>
(AssignOp -> AssignOp -> Ordering)
-> (AssignOp -> AssignOp -> Bool)
-> (AssignOp -> AssignOp -> Bool)
-> (AssignOp -> AssignOp -> Bool)
-> (AssignOp -> AssignOp -> Bool)
-> (AssignOp -> AssignOp -> AssignOp)
-> (AssignOp -> AssignOp -> AssignOp)
-> Ord AssignOp
AssignOp -> AssignOp -> Bool
AssignOp -> AssignOp -> Ordering
AssignOp -> AssignOp -> AssignOp
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 :: AssignOp -> AssignOp -> Ordering
compare :: AssignOp -> AssignOp -> Ordering
$c< :: AssignOp -> AssignOp -> Bool
< :: AssignOp -> AssignOp -> Bool
$c<= :: AssignOp -> AssignOp -> Bool
<= :: AssignOp -> AssignOp -> Bool
$c> :: AssignOp -> AssignOp -> Bool
> :: AssignOp -> AssignOp -> Bool
$c>= :: AssignOp -> AssignOp -> Bool
>= :: AssignOp -> AssignOp -> Bool
$cmax :: AssignOp -> AssignOp -> AssignOp
max :: AssignOp -> AssignOp -> AssignOp
$cmin :: AssignOp -> AssignOp -> AssignOp
min :: AssignOp -> AssignOp -> AssignOp
Ord, Int -> AssignOp -> ShowS
[AssignOp] -> ShowS
AssignOp -> String
(Int -> AssignOp -> ShowS)
-> (AssignOp -> String) -> ([AssignOp] -> ShowS) -> Show AssignOp
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AssignOp -> ShowS
showsPrec :: Int -> AssignOp -> ShowS
$cshow :: AssignOp -> String
show :: AssignOp -> String
$cshowList :: [AssignOp] -> ShowS
showList :: [AssignOp] -> ShowS
Show, ReadPrec [AssignOp]
ReadPrec AssignOp
Int -> ReadS AssignOp
ReadS [AssignOp]
(Int -> ReadS AssignOp)
-> ReadS [AssignOp]
-> ReadPrec AssignOp
-> ReadPrec [AssignOp]
-> Read AssignOp
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS AssignOp
readsPrec :: Int -> ReadS AssignOp
$creadList :: ReadS [AssignOp]
readList :: ReadS [AssignOp]
$creadPrec :: ReadPrec AssignOp
readPrec :: ReadPrec AssignOp
$creadListPrec :: ReadPrec [AssignOp]
readListPrec :: ReadPrec [AssignOp]
Read, AssignOp -> AssignOp -> Bool
(AssignOp -> AssignOp -> Bool)
-> (AssignOp -> AssignOp -> Bool) -> Eq AssignOp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AssignOp -> AssignOp -> Bool
== :: AssignOp -> AssignOp -> Bool
$c/= :: AssignOp -> AssignOp -> Bool
/= :: AssignOp -> AssignOp -> Bool
Eq, (forall x. AssignOp -> Rep AssignOp x)
-> (forall x. Rep AssignOp x -> AssignOp) -> Generic AssignOp
forall x. Rep AssignOp x -> AssignOp
forall x. AssignOp -> Rep AssignOp x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. AssignOp -> Rep AssignOp x
from :: forall x. AssignOp -> Rep AssignOp x
$cto :: forall x. Rep AssignOp x -> AssignOp
to :: forall x. Rep AssignOp x -> AssignOp
Generic)

instance FromJSON AssignOp
instance ToJSON AssignOp

data BinaryOp
    = BopNe
    | BopEq
    | BopOr
    | BopBitXor
    | BopBitOr
    | BopAnd
    | BopBitAnd
    | BopDiv
    | BopMul
    | BopMod
    | BopPlus
    | BopMinus
    | BopLt
    | BopLe
    | BopLsh
    | BopGt
    | BopGe
    | BopRsh
    deriving (Int -> BinaryOp
BinaryOp -> Int
BinaryOp -> [BinaryOp]
BinaryOp -> BinaryOp
BinaryOp -> BinaryOp -> [BinaryOp]
BinaryOp -> BinaryOp -> BinaryOp -> [BinaryOp]
(BinaryOp -> BinaryOp)
-> (BinaryOp -> BinaryOp)
-> (Int -> BinaryOp)
-> (BinaryOp -> Int)
-> (BinaryOp -> [BinaryOp])
-> (BinaryOp -> BinaryOp -> [BinaryOp])
-> (BinaryOp -> BinaryOp -> [BinaryOp])
-> (BinaryOp -> BinaryOp -> BinaryOp -> [BinaryOp])
-> Enum BinaryOp
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 :: BinaryOp -> BinaryOp
succ :: BinaryOp -> BinaryOp
$cpred :: BinaryOp -> BinaryOp
pred :: BinaryOp -> BinaryOp
$ctoEnum :: Int -> BinaryOp
toEnum :: Int -> BinaryOp
$cfromEnum :: BinaryOp -> Int
fromEnum :: BinaryOp -> Int
$cenumFrom :: BinaryOp -> [BinaryOp]
enumFrom :: BinaryOp -> [BinaryOp]
$cenumFromThen :: BinaryOp -> BinaryOp -> [BinaryOp]
enumFromThen :: BinaryOp -> BinaryOp -> [BinaryOp]
$cenumFromTo :: BinaryOp -> BinaryOp -> [BinaryOp]
enumFromTo :: BinaryOp -> BinaryOp -> [BinaryOp]
$cenumFromThenTo :: BinaryOp -> BinaryOp -> BinaryOp -> [BinaryOp]
enumFromThenTo :: BinaryOp -> BinaryOp -> BinaryOp -> [BinaryOp]
Enum, BinaryOp
BinaryOp -> BinaryOp -> Bounded BinaryOp
forall a. a -> a -> Bounded a
$cminBound :: BinaryOp
minBound :: BinaryOp
$cmaxBound :: BinaryOp
maxBound :: BinaryOp
Bounded, Eq BinaryOp
Eq BinaryOp =>
(BinaryOp -> BinaryOp -> Ordering)
-> (BinaryOp -> BinaryOp -> Bool)
-> (BinaryOp -> BinaryOp -> Bool)
-> (BinaryOp -> BinaryOp -> Bool)
-> (BinaryOp -> BinaryOp -> Bool)
-> (BinaryOp -> BinaryOp -> BinaryOp)
-> (BinaryOp -> BinaryOp -> BinaryOp)
-> Ord BinaryOp
BinaryOp -> BinaryOp -> Bool
BinaryOp -> BinaryOp -> Ordering
BinaryOp -> BinaryOp -> BinaryOp
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 :: BinaryOp -> BinaryOp -> Ordering
compare :: BinaryOp -> BinaryOp -> Ordering
$c< :: BinaryOp -> BinaryOp -> Bool
< :: BinaryOp -> BinaryOp -> Bool
$c<= :: BinaryOp -> BinaryOp -> Bool
<= :: BinaryOp -> BinaryOp -> Bool
$c> :: BinaryOp -> BinaryOp -> Bool
> :: BinaryOp -> BinaryOp -> Bool
$c>= :: BinaryOp -> BinaryOp -> Bool
>= :: BinaryOp -> BinaryOp -> Bool
$cmax :: BinaryOp -> BinaryOp -> BinaryOp
max :: BinaryOp -> BinaryOp -> BinaryOp
$cmin :: BinaryOp -> BinaryOp -> BinaryOp
min :: BinaryOp -> BinaryOp -> BinaryOp
Ord, Int -> BinaryOp -> ShowS
[BinaryOp] -> ShowS
BinaryOp -> String
(Int -> BinaryOp -> ShowS)
-> (BinaryOp -> String) -> ([BinaryOp] -> ShowS) -> Show BinaryOp
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> BinaryOp -> ShowS
showsPrec :: Int -> BinaryOp -> ShowS
$cshow :: BinaryOp -> String
show :: BinaryOp -> String
$cshowList :: [BinaryOp] -> ShowS
showList :: [BinaryOp] -> ShowS
Show, ReadPrec [BinaryOp]
ReadPrec BinaryOp
Int -> ReadS BinaryOp
ReadS [BinaryOp]
(Int -> ReadS BinaryOp)
-> ReadS [BinaryOp]
-> ReadPrec BinaryOp
-> ReadPrec [BinaryOp]
-> Read BinaryOp
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS BinaryOp
readsPrec :: Int -> ReadS BinaryOp
$creadList :: ReadS [BinaryOp]
readList :: ReadS [BinaryOp]
$creadPrec :: ReadPrec BinaryOp
readPrec :: ReadPrec BinaryOp
$creadListPrec :: ReadPrec [BinaryOp]
readListPrec :: ReadPrec [BinaryOp]
Read, BinaryOp -> BinaryOp -> Bool
(BinaryOp -> BinaryOp -> Bool)
-> (BinaryOp -> BinaryOp -> Bool) -> Eq BinaryOp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BinaryOp -> BinaryOp -> Bool
== :: BinaryOp -> BinaryOp -> Bool
$c/= :: BinaryOp -> BinaryOp -> Bool
/= :: BinaryOp -> BinaryOp -> Bool
Eq, (forall x. BinaryOp -> Rep BinaryOp x)
-> (forall x. Rep BinaryOp x -> BinaryOp) -> Generic BinaryOp
forall x. Rep BinaryOp x -> BinaryOp
forall x. BinaryOp -> Rep BinaryOp x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. BinaryOp -> Rep BinaryOp x
from :: forall x. BinaryOp -> Rep BinaryOp x
$cto :: forall x. Rep BinaryOp x -> BinaryOp
to :: forall x. Rep BinaryOp x -> BinaryOp
Generic)

instance FromJSON BinaryOp
instance ToJSON BinaryOp

data UnaryOp
    = UopNot
    | UopNeg
    | UopMinus
    | UopAddress
    | UopDeref
    | UopIncr
    | UopDecr
    deriving (Int -> UnaryOp
UnaryOp -> Int
UnaryOp -> [UnaryOp]
UnaryOp -> UnaryOp
UnaryOp -> UnaryOp -> [UnaryOp]
UnaryOp -> UnaryOp -> UnaryOp -> [UnaryOp]
(UnaryOp -> UnaryOp)
-> (UnaryOp -> UnaryOp)
-> (Int -> UnaryOp)
-> (UnaryOp -> Int)
-> (UnaryOp -> [UnaryOp])
-> (UnaryOp -> UnaryOp -> [UnaryOp])
-> (UnaryOp -> UnaryOp -> [UnaryOp])
-> (UnaryOp -> UnaryOp -> UnaryOp -> [UnaryOp])
-> Enum UnaryOp
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 :: UnaryOp -> UnaryOp
succ :: UnaryOp -> UnaryOp
$cpred :: UnaryOp -> UnaryOp
pred :: UnaryOp -> UnaryOp
$ctoEnum :: Int -> UnaryOp
toEnum :: Int -> UnaryOp
$cfromEnum :: UnaryOp -> Int
fromEnum :: UnaryOp -> Int
$cenumFrom :: UnaryOp -> [UnaryOp]
enumFrom :: UnaryOp -> [UnaryOp]
$cenumFromThen :: UnaryOp -> UnaryOp -> [UnaryOp]
enumFromThen :: UnaryOp -> UnaryOp -> [UnaryOp]
$cenumFromTo :: UnaryOp -> UnaryOp -> [UnaryOp]
enumFromTo :: UnaryOp -> UnaryOp -> [UnaryOp]
$cenumFromThenTo :: UnaryOp -> UnaryOp -> UnaryOp -> [UnaryOp]
enumFromThenTo :: UnaryOp -> UnaryOp -> UnaryOp -> [UnaryOp]
Enum, UnaryOp
UnaryOp -> UnaryOp -> Bounded UnaryOp
forall a. a -> a -> Bounded a
$cminBound :: UnaryOp
minBound :: UnaryOp
$cmaxBound :: UnaryOp
maxBound :: UnaryOp
Bounded, Eq UnaryOp
Eq UnaryOp =>
(UnaryOp -> UnaryOp -> Ordering)
-> (UnaryOp -> UnaryOp -> Bool)
-> (UnaryOp -> UnaryOp -> Bool)
-> (UnaryOp -> UnaryOp -> Bool)
-> (UnaryOp -> UnaryOp -> Bool)
-> (UnaryOp -> UnaryOp -> UnaryOp)
-> (UnaryOp -> UnaryOp -> UnaryOp)
-> Ord UnaryOp
UnaryOp -> UnaryOp -> Bool
UnaryOp -> UnaryOp -> Ordering
UnaryOp -> UnaryOp -> UnaryOp
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 :: UnaryOp -> UnaryOp -> Ordering
compare :: UnaryOp -> UnaryOp -> Ordering
$c< :: UnaryOp -> UnaryOp -> Bool
< :: UnaryOp -> UnaryOp -> Bool
$c<= :: UnaryOp -> UnaryOp -> Bool
<= :: UnaryOp -> UnaryOp -> Bool
$c> :: UnaryOp -> UnaryOp -> Bool
> :: UnaryOp -> UnaryOp -> Bool
$c>= :: UnaryOp -> UnaryOp -> Bool
>= :: UnaryOp -> UnaryOp -> Bool
$cmax :: UnaryOp -> UnaryOp -> UnaryOp
max :: UnaryOp -> UnaryOp -> UnaryOp
$cmin :: UnaryOp -> UnaryOp -> UnaryOp
min :: UnaryOp -> UnaryOp -> UnaryOp
Ord, Int -> UnaryOp -> ShowS
[UnaryOp] -> ShowS
UnaryOp -> String
(Int -> UnaryOp -> ShowS)
-> (UnaryOp -> String) -> ([UnaryOp] -> ShowS) -> Show UnaryOp
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> UnaryOp -> ShowS
showsPrec :: Int -> UnaryOp -> ShowS
$cshow :: UnaryOp -> String
show :: UnaryOp -> String
$cshowList :: [UnaryOp] -> ShowS
showList :: [UnaryOp] -> ShowS
Show, ReadPrec [UnaryOp]
ReadPrec UnaryOp
Int -> ReadS UnaryOp
ReadS [UnaryOp]
(Int -> ReadS UnaryOp)
-> ReadS [UnaryOp]
-> ReadPrec UnaryOp
-> ReadPrec [UnaryOp]
-> Read UnaryOp
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS UnaryOp
readsPrec :: Int -> ReadS UnaryOp
$creadList :: ReadS [UnaryOp]
readList :: ReadS [UnaryOp]
$creadPrec :: ReadPrec UnaryOp
readPrec :: ReadPrec UnaryOp
$creadListPrec :: ReadPrec [UnaryOp]
readListPrec :: ReadPrec [UnaryOp]
Read, UnaryOp -> UnaryOp -> Bool
(UnaryOp -> UnaryOp -> Bool)
-> (UnaryOp -> UnaryOp -> Bool) -> Eq UnaryOp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: UnaryOp -> UnaryOp -> Bool
== :: UnaryOp -> UnaryOp -> Bool
$c/= :: UnaryOp -> UnaryOp -> Bool
/= :: UnaryOp -> UnaryOp -> Bool
Eq, (forall x. UnaryOp -> Rep UnaryOp x)
-> (forall x. Rep UnaryOp x -> UnaryOp) -> Generic UnaryOp
forall x. Rep UnaryOp x -> UnaryOp
forall x. UnaryOp -> Rep UnaryOp x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. UnaryOp -> Rep UnaryOp x
from :: forall x. UnaryOp -> Rep UnaryOp x
$cto :: forall x. Rep UnaryOp x -> UnaryOp
to :: forall x. Rep UnaryOp x -> UnaryOp
Generic)

instance FromJSON UnaryOp
instance ToJSON UnaryOp

data LiteralType
    = Char
    | Int
    | Float
    | Bool
    | String
    | ConstId
    deriving (Int -> LiteralType
LiteralType -> Int
LiteralType -> [LiteralType]
LiteralType -> LiteralType
LiteralType -> LiteralType -> [LiteralType]
LiteralType -> LiteralType -> LiteralType -> [LiteralType]
(LiteralType -> LiteralType)
-> (LiteralType -> LiteralType)
-> (Int -> LiteralType)
-> (LiteralType -> Int)
-> (LiteralType -> [LiteralType])
-> (LiteralType -> LiteralType -> [LiteralType])
-> (LiteralType -> LiteralType -> [LiteralType])
-> (LiteralType -> LiteralType -> LiteralType -> [LiteralType])
-> Enum LiteralType
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 :: LiteralType -> LiteralType
succ :: LiteralType -> LiteralType
$cpred :: LiteralType -> LiteralType
pred :: LiteralType -> LiteralType
$ctoEnum :: Int -> LiteralType
toEnum :: Int -> LiteralType
$cfromEnum :: LiteralType -> Int
fromEnum :: LiteralType -> Int
$cenumFrom :: LiteralType -> [LiteralType]
enumFrom :: LiteralType -> [LiteralType]
$cenumFromThen :: LiteralType -> LiteralType -> [LiteralType]
enumFromThen :: LiteralType -> LiteralType -> [LiteralType]
$cenumFromTo :: LiteralType -> LiteralType -> [LiteralType]
enumFromTo :: LiteralType -> LiteralType -> [LiteralType]
$cenumFromThenTo :: LiteralType -> LiteralType -> LiteralType -> [LiteralType]
enumFromThenTo :: LiteralType -> LiteralType -> LiteralType -> [LiteralType]
Enum, LiteralType
LiteralType -> LiteralType -> Bounded LiteralType
forall a. a -> a -> Bounded a
$cminBound :: LiteralType
minBound :: LiteralType
$cmaxBound :: LiteralType
maxBound :: LiteralType
Bounded, Eq LiteralType
Eq LiteralType =>
(LiteralType -> LiteralType -> Ordering)
-> (LiteralType -> LiteralType -> Bool)
-> (LiteralType -> LiteralType -> Bool)
-> (LiteralType -> LiteralType -> Bool)
-> (LiteralType -> LiteralType -> Bool)
-> (LiteralType -> LiteralType -> LiteralType)
-> (LiteralType -> LiteralType -> LiteralType)
-> Ord LiteralType
LiteralType -> LiteralType -> Bool
LiteralType -> LiteralType -> Ordering
LiteralType -> LiteralType -> LiteralType
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 :: LiteralType -> LiteralType -> Ordering
compare :: LiteralType -> LiteralType -> Ordering
$c< :: LiteralType -> LiteralType -> Bool
< :: LiteralType -> LiteralType -> Bool
$c<= :: LiteralType -> LiteralType -> Bool
<= :: LiteralType -> LiteralType -> Bool
$c> :: LiteralType -> LiteralType -> Bool
> :: LiteralType -> LiteralType -> Bool
$c>= :: LiteralType -> LiteralType -> Bool
>= :: LiteralType -> LiteralType -> Bool
$cmax :: LiteralType -> LiteralType -> LiteralType
max :: LiteralType -> LiteralType -> LiteralType
$cmin :: LiteralType -> LiteralType -> LiteralType
min :: LiteralType -> LiteralType -> LiteralType
Ord, Int -> LiteralType -> ShowS
[LiteralType] -> ShowS
LiteralType -> String
(Int -> LiteralType -> ShowS)
-> (LiteralType -> String)
-> ([LiteralType] -> ShowS)
-> Show LiteralType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> LiteralType -> ShowS
showsPrec :: Int -> LiteralType -> ShowS
$cshow :: LiteralType -> String
show :: LiteralType -> String
$cshowList :: [LiteralType] -> ShowS
showList :: [LiteralType] -> ShowS
Show, ReadPrec [LiteralType]
ReadPrec LiteralType
Int -> ReadS LiteralType
ReadS [LiteralType]
(Int -> ReadS LiteralType)
-> ReadS [LiteralType]
-> ReadPrec LiteralType
-> ReadPrec [LiteralType]
-> Read LiteralType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS LiteralType
readsPrec :: Int -> ReadS LiteralType
$creadList :: ReadS [LiteralType]
readList :: ReadS [LiteralType]
$creadPrec :: ReadPrec LiteralType
readPrec :: ReadPrec LiteralType
$creadListPrec :: ReadPrec [LiteralType]
readListPrec :: ReadPrec [LiteralType]
Read, LiteralType -> LiteralType -> Bool
(LiteralType -> LiteralType -> Bool)
-> (LiteralType -> LiteralType -> Bool) -> Eq LiteralType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: LiteralType -> LiteralType -> Bool
== :: LiteralType -> LiteralType -> Bool
$c/= :: LiteralType -> LiteralType -> Bool
/= :: LiteralType -> LiteralType -> Bool
Eq, (forall x. LiteralType -> Rep LiteralType x)
-> (forall x. Rep LiteralType x -> LiteralType)
-> Generic LiteralType
forall x. Rep LiteralType x -> LiteralType
forall x. LiteralType -> Rep LiteralType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. LiteralType -> Rep LiteralType x
from :: forall x. LiteralType -> Rep LiteralType x
$cto :: forall x. Rep LiteralType x -> LiteralType
to :: forall x. Rep LiteralType x -> LiteralType
Generic)

instance FromJSON LiteralType
instance ToJSON LiteralType

data Scope
    = Global
    | Static
    | Local
    deriving (Int -> Scope
Scope -> Int
Scope -> [Scope]
Scope -> Scope
Scope -> Scope -> [Scope]
Scope -> Scope -> Scope -> [Scope]
(Scope -> Scope)
-> (Scope -> Scope)
-> (Int -> Scope)
-> (Scope -> Int)
-> (Scope -> [Scope])
-> (Scope -> Scope -> [Scope])
-> (Scope -> Scope -> [Scope])
-> (Scope -> Scope -> Scope -> [Scope])
-> Enum Scope
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 :: Scope -> Scope
succ :: Scope -> Scope
$cpred :: Scope -> Scope
pred :: Scope -> Scope
$ctoEnum :: Int -> Scope
toEnum :: Int -> Scope
$cfromEnum :: Scope -> Int
fromEnum :: Scope -> Int
$cenumFrom :: Scope -> [Scope]
enumFrom :: Scope -> [Scope]
$cenumFromThen :: Scope -> Scope -> [Scope]
enumFromThen :: Scope -> Scope -> [Scope]
$cenumFromTo :: Scope -> Scope -> [Scope]
enumFromTo :: Scope -> Scope -> [Scope]
$cenumFromThenTo :: Scope -> Scope -> Scope -> [Scope]
enumFromThenTo :: Scope -> Scope -> Scope -> [Scope]
Enum, Scope
Scope -> Scope -> Bounded Scope
forall a. a -> a -> Bounded a
$cminBound :: Scope
minBound :: Scope
$cmaxBound :: Scope
maxBound :: Scope
Bounded, Eq Scope
Eq Scope =>
(Scope -> Scope -> Ordering)
-> (Scope -> Scope -> Bool)
-> (Scope -> Scope -> Bool)
-> (Scope -> Scope -> Bool)
-> (Scope -> Scope -> Bool)
-> (Scope -> Scope -> Scope)
-> (Scope -> Scope -> Scope)
-> Ord Scope
Scope -> Scope -> Bool
Scope -> Scope -> Ordering
Scope -> Scope -> Scope
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 :: Scope -> Scope -> Ordering
compare :: Scope -> Scope -> Ordering
$c< :: Scope -> Scope -> Bool
< :: Scope -> Scope -> Bool
$c<= :: Scope -> Scope -> Bool
<= :: Scope -> Scope -> Bool
$c> :: Scope -> Scope -> Bool
> :: Scope -> Scope -> Bool
$c>= :: Scope -> Scope -> Bool
>= :: Scope -> Scope -> Bool
$cmax :: Scope -> Scope -> Scope
max :: Scope -> Scope -> Scope
$cmin :: Scope -> Scope -> Scope
min :: Scope -> Scope -> Scope
Ord, Int -> Scope -> ShowS
[Scope] -> ShowS
Scope -> String
(Int -> Scope -> ShowS)
-> (Scope -> String) -> ([Scope] -> ShowS) -> Show Scope
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Scope -> ShowS
showsPrec :: Int -> Scope -> ShowS
$cshow :: Scope -> String
show :: Scope -> String
$cshowList :: [Scope] -> ShowS
showList :: [Scope] -> ShowS
Show, ReadPrec [Scope]
ReadPrec Scope
Int -> ReadS Scope
ReadS [Scope]
(Int -> ReadS Scope)
-> ReadS [Scope]
-> ReadPrec Scope
-> ReadPrec [Scope]
-> Read Scope
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS Scope
readsPrec :: Int -> ReadS Scope
$creadList :: ReadS [Scope]
readList :: ReadS [Scope]
$creadPrec :: ReadPrec Scope
readPrec :: ReadPrec Scope
$creadListPrec :: ReadPrec [Scope]
readListPrec :: ReadPrec [Scope]
Read, Scope -> Scope -> Bool
(Scope -> Scope -> Bool) -> (Scope -> Scope -> Bool) -> Eq Scope
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Scope -> Scope -> Bool
== :: Scope -> Scope -> Bool
$c/= :: Scope -> Scope -> Bool
/= :: Scope -> Scope -> Bool
Eq, (forall x. Scope -> Rep Scope x)
-> (forall x. Rep Scope x -> Scope) -> Generic Scope
forall x. Rep Scope x -> Scope
forall x. Scope -> Rep Scope x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Scope -> Rep Scope x
from :: forall x. Scope -> Rep Scope x
$cto :: forall x. Rep Scope x -> Scope
to :: forall x. Rep Scope x -> Scope
Generic)

instance FromJSON Scope
instance ToJSON Scope

data CommentStyle
    = Regular
    | Doxygen
    | Section
    | Block
    | Ignore
    deriving (Int -> CommentStyle
CommentStyle -> Int
CommentStyle -> [CommentStyle]
CommentStyle -> CommentStyle
CommentStyle -> CommentStyle -> [CommentStyle]
CommentStyle -> CommentStyle -> CommentStyle -> [CommentStyle]
(CommentStyle -> CommentStyle)
-> (CommentStyle -> CommentStyle)
-> (Int -> CommentStyle)
-> (CommentStyle -> Int)
-> (CommentStyle -> [CommentStyle])
-> (CommentStyle -> CommentStyle -> [CommentStyle])
-> (CommentStyle -> CommentStyle -> [CommentStyle])
-> (CommentStyle -> CommentStyle -> CommentStyle -> [CommentStyle])
-> Enum CommentStyle
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 :: CommentStyle -> CommentStyle
succ :: CommentStyle -> CommentStyle
$cpred :: CommentStyle -> CommentStyle
pred :: CommentStyle -> CommentStyle
$ctoEnum :: Int -> CommentStyle
toEnum :: Int -> CommentStyle
$cfromEnum :: CommentStyle -> Int
fromEnum :: CommentStyle -> Int
$cenumFrom :: CommentStyle -> [CommentStyle]
enumFrom :: CommentStyle -> [CommentStyle]
$cenumFromThen :: CommentStyle -> CommentStyle -> [CommentStyle]
enumFromThen :: CommentStyle -> CommentStyle -> [CommentStyle]
$cenumFromTo :: CommentStyle -> CommentStyle -> [CommentStyle]
enumFromTo :: CommentStyle -> CommentStyle -> [CommentStyle]
$cenumFromThenTo :: CommentStyle -> CommentStyle -> CommentStyle -> [CommentStyle]
enumFromThenTo :: CommentStyle -> CommentStyle -> CommentStyle -> [CommentStyle]
Enum, CommentStyle
CommentStyle -> CommentStyle -> Bounded CommentStyle
forall a. a -> a -> Bounded a
$cminBound :: CommentStyle
minBound :: CommentStyle
$cmaxBound :: CommentStyle
maxBound :: CommentStyle
Bounded, Eq CommentStyle
Eq CommentStyle =>
(CommentStyle -> CommentStyle -> Ordering)
-> (CommentStyle -> CommentStyle -> Bool)
-> (CommentStyle -> CommentStyle -> Bool)
-> (CommentStyle -> CommentStyle -> Bool)
-> (CommentStyle -> CommentStyle -> Bool)
-> (CommentStyle -> CommentStyle -> CommentStyle)
-> (CommentStyle -> CommentStyle -> CommentStyle)
-> Ord CommentStyle
CommentStyle -> CommentStyle -> Bool
CommentStyle -> CommentStyle -> Ordering
CommentStyle -> CommentStyle -> CommentStyle
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 :: CommentStyle -> CommentStyle -> Ordering
compare :: CommentStyle -> CommentStyle -> Ordering
$c< :: CommentStyle -> CommentStyle -> Bool
< :: CommentStyle -> CommentStyle -> Bool
$c<= :: CommentStyle -> CommentStyle -> Bool
<= :: CommentStyle -> CommentStyle -> Bool
$c> :: CommentStyle -> CommentStyle -> Bool
> :: CommentStyle -> CommentStyle -> Bool
$c>= :: CommentStyle -> CommentStyle -> Bool
>= :: CommentStyle -> CommentStyle -> Bool
$cmax :: CommentStyle -> CommentStyle -> CommentStyle
max :: CommentStyle -> CommentStyle -> CommentStyle
$cmin :: CommentStyle -> CommentStyle -> CommentStyle
min :: CommentStyle -> CommentStyle -> CommentStyle
Ord, Int -> CommentStyle -> ShowS
[CommentStyle] -> ShowS
CommentStyle -> String
(Int -> CommentStyle -> ShowS)
-> (CommentStyle -> String)
-> ([CommentStyle] -> ShowS)
-> Show CommentStyle
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CommentStyle -> ShowS
showsPrec :: Int -> CommentStyle -> ShowS
$cshow :: CommentStyle -> String
show :: CommentStyle -> String
$cshowList :: [CommentStyle] -> ShowS
showList :: [CommentStyle] -> ShowS
Show, ReadPrec [CommentStyle]
ReadPrec CommentStyle
Int -> ReadS CommentStyle
ReadS [CommentStyle]
(Int -> ReadS CommentStyle)
-> ReadS [CommentStyle]
-> ReadPrec CommentStyle
-> ReadPrec [CommentStyle]
-> Read CommentStyle
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS CommentStyle
readsPrec :: Int -> ReadS CommentStyle
$creadList :: ReadS [CommentStyle]
readList :: ReadS [CommentStyle]
$creadPrec :: ReadPrec CommentStyle
readPrec :: ReadPrec CommentStyle
$creadListPrec :: ReadPrec [CommentStyle]
readListPrec :: ReadPrec [CommentStyle]
Read, CommentStyle -> CommentStyle -> Bool
(CommentStyle -> CommentStyle -> Bool)
-> (CommentStyle -> CommentStyle -> Bool) -> Eq CommentStyle
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CommentStyle -> CommentStyle -> Bool
== :: CommentStyle -> CommentStyle -> Bool
$c/= :: CommentStyle -> CommentStyle -> Bool
/= :: CommentStyle -> CommentStyle -> Bool
Eq, (forall x. CommentStyle -> Rep CommentStyle x)
-> (forall x. Rep CommentStyle x -> CommentStyle)
-> Generic CommentStyle
forall x. Rep CommentStyle x -> CommentStyle
forall x. CommentStyle -> Rep CommentStyle x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. CommentStyle -> Rep CommentStyle x
from :: forall x. CommentStyle -> Rep CommentStyle x
$cto :: forall x. Rep CommentStyle x -> CommentStyle
to :: forall x. Rep CommentStyle x -> CommentStyle
Generic)

instance FromJSON CommentStyle
instance ToJSON CommentStyle

data Nullability
    = NullabilityUnspecified
    | Nullable
    | Nonnull
    deriving (Int -> Nullability
Nullability -> Int
Nullability -> [Nullability]
Nullability -> Nullability
Nullability -> Nullability -> [Nullability]
Nullability -> Nullability -> Nullability -> [Nullability]
(Nullability -> Nullability)
-> (Nullability -> Nullability)
-> (Int -> Nullability)
-> (Nullability -> Int)
-> (Nullability -> [Nullability])
-> (Nullability -> Nullability -> [Nullability])
-> (Nullability -> Nullability -> [Nullability])
-> (Nullability -> Nullability -> Nullability -> [Nullability])
-> Enum Nullability
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 :: Nullability -> Nullability
succ :: Nullability -> Nullability
$cpred :: Nullability -> Nullability
pred :: Nullability -> Nullability
$ctoEnum :: Int -> Nullability
toEnum :: Int -> Nullability
$cfromEnum :: Nullability -> Int
fromEnum :: Nullability -> Int
$cenumFrom :: Nullability -> [Nullability]
enumFrom :: Nullability -> [Nullability]
$cenumFromThen :: Nullability -> Nullability -> [Nullability]
enumFromThen :: Nullability -> Nullability -> [Nullability]
$cenumFromTo :: Nullability -> Nullability -> [Nullability]
enumFromTo :: Nullability -> Nullability -> [Nullability]
$cenumFromThenTo :: Nullability -> Nullability -> Nullability -> [Nullability]
enumFromThenTo :: Nullability -> Nullability -> Nullability -> [Nullability]
Enum, Nullability
Nullability -> Nullability -> Bounded Nullability
forall a. a -> a -> Bounded a
$cminBound :: Nullability
minBound :: Nullability
$cmaxBound :: Nullability
maxBound :: Nullability
Bounded, Eq Nullability
Eq Nullability =>
(Nullability -> Nullability -> Ordering)
-> (Nullability -> Nullability -> Bool)
-> (Nullability -> Nullability -> Bool)
-> (Nullability -> Nullability -> Bool)
-> (Nullability -> Nullability -> Bool)
-> (Nullability -> Nullability -> Nullability)
-> (Nullability -> Nullability -> Nullability)
-> Ord Nullability
Nullability -> Nullability -> Bool
Nullability -> Nullability -> Ordering
Nullability -> Nullability -> Nullability
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 :: Nullability -> Nullability -> Ordering
compare :: Nullability -> Nullability -> Ordering
$c< :: Nullability -> Nullability -> Bool
< :: Nullability -> Nullability -> Bool
$c<= :: Nullability -> Nullability -> Bool
<= :: Nullability -> Nullability -> Bool
$c> :: Nullability -> Nullability -> Bool
> :: Nullability -> Nullability -> Bool
$c>= :: Nullability -> Nullability -> Bool
>= :: Nullability -> Nullability -> Bool
$cmax :: Nullability -> Nullability -> Nullability
max :: Nullability -> Nullability -> Nullability
$cmin :: Nullability -> Nullability -> Nullability
min :: Nullability -> Nullability -> Nullability
Ord, Int -> Nullability -> ShowS
[Nullability] -> ShowS
Nullability -> String
(Int -> Nullability -> ShowS)
-> (Nullability -> String)
-> ([Nullability] -> ShowS)
-> Show Nullability
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Nullability -> ShowS
showsPrec :: Int -> Nullability -> ShowS
$cshow :: Nullability -> String
show :: Nullability -> String
$cshowList :: [Nullability] -> ShowS
showList :: [Nullability] -> ShowS
Show, ReadPrec [Nullability]
ReadPrec Nullability
Int -> ReadS Nullability
ReadS [Nullability]
(Int -> ReadS Nullability)
-> ReadS [Nullability]
-> ReadPrec Nullability
-> ReadPrec [Nullability]
-> Read Nullability
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS Nullability
readsPrec :: Int -> ReadS Nullability
$creadList :: ReadS [Nullability]
readList :: ReadS [Nullability]
$creadPrec :: ReadPrec Nullability
readPrec :: ReadPrec Nullability
$creadListPrec :: ReadPrec [Nullability]
readListPrec :: ReadPrec [Nullability]
Read, Nullability -> Nullability -> Bool
(Nullability -> Nullability -> Bool)
-> (Nullability -> Nullability -> Bool) -> Eq Nullability
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Nullability -> Nullability -> Bool
== :: Nullability -> Nullability -> Bool
$c/= :: Nullability -> Nullability -> Bool
/= :: Nullability -> Nullability -> Bool
Eq, (forall x. Nullability -> Rep Nullability x)
-> (forall x. Rep Nullability x -> Nullability)
-> Generic Nullability
forall x. Rep Nullability x -> Nullability
forall x. Nullability -> Rep Nullability x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Nullability -> Rep Nullability x
from :: forall x. Nullability -> Rep Nullability x
$cto :: forall x. Rep Nullability x -> Nullability
to :: forall x. Rep Nullability x -> Nullability
Generic)

instance FromJSON Nullability
instance ToJSON Nullability

instance (Hashable lexeme, Hashable a) => Hashable (NodeF lexeme a) where
instance (Hashable lexeme, Hashable a) => Hashable (CommentF lexeme a) where
instance Hashable AssignOp where
instance Hashable BinaryOp where
instance Hashable UnaryOp where
instance Hashable LiteralType where
instance Hashable Scope where
instance Hashable CommentStyle where
instance Hashable Nullability where

instance Arbitrary AssignOp where
    arbitrary :: Gen AssignOp
arbitrary = Gen AssignOp
forall a. (Bounded a, Enum a) => Gen a
arbitraryBoundedEnum

instance Arbitrary BinaryOp where
    arbitrary :: Gen BinaryOp
arbitrary = Gen BinaryOp
forall a. (Bounded a, Enum a) => Gen a
arbitraryBoundedEnum

instance Arbitrary UnaryOp where
    arbitrary :: Gen UnaryOp
arbitrary = Gen UnaryOp
forall a. (Bounded a, Enum a) => Gen a
arbitraryBoundedEnum

instance Arbitrary LiteralType where
    arbitrary :: Gen LiteralType
arbitrary = Gen LiteralType
forall a. (Bounded a, Enum a) => Gen a
arbitraryBoundedEnum

instance Arbitrary Scope where
    arbitrary :: Gen Scope
arbitrary = Gen Scope
forall a. (Bounded a, Enum a) => Gen a
arbitraryBoundedEnum

instance Arbitrary CommentStyle where
    arbitrary :: Gen CommentStyle
arbitrary = Gen CommentStyle
forall a. (Bounded a, Enum a) => Gen a
arbitraryBoundedEnum

instance Arbitrary Nullability where
    arbitrary :: Gen Nullability
arbitrary = Gen Nullability
forall a. (Bounded a, Enum a) => Gen a
arbitraryBoundedEnum