happy-arbitrary-0.0.2: Token list generator for arbitrary Happy grammars.
Safe HaskellNone
LanguageHaskell2010

Language.Happy.Ast

Documentation

type Node lexeme = Fix (NodeF lexeme) Source #

data NodeF lexeme a Source #

Constructors

Grammar [lexeme] [a] [a] [lexeme] 
PragmaExpect lexeme 
PragmaName lexeme lexeme 
PragmaErrorHandlerType lexeme 
PragmaError lexeme 
PragmaLexer lexeme lexeme 
PragmaMonad lexeme 
PragmaTokenType lexeme 
PragmaToken [a] 
PragmaLeft [lexeme] 
PragmaRight [lexeme] 
Token lexeme lexeme 
Rule a a 
RuleType lexeme lexeme 
RuleDefn lexeme [a] 
RuleLine [lexeme] lexeme 

Instances

Instances details
Functor (NodeF lexeme) Source # 
Instance details

Defined in Language.Happy.Ast

Methods

fmap :: (a -> b) -> NodeF lexeme a -> NodeF lexeme b #

(<$) :: a -> NodeF lexeme b -> NodeF lexeme a #

Foldable (NodeF lexeme) Source # 
Instance details

Defined in Language.Happy.Ast

Methods

fold :: Monoid m => NodeF lexeme m -> m #

foldMap :: Monoid m => (a -> m) -> NodeF lexeme a -> m #

foldMap' :: Monoid m => (a -> m) -> NodeF lexeme a -> m #

foldr :: (a -> b -> b) -> b -> NodeF lexeme a -> b #

foldr' :: (a -> b -> b) -> b -> NodeF lexeme a -> b #

foldl :: (b -> a -> b) -> b -> NodeF lexeme a -> b #

foldl' :: (b -> a -> b) -> b -> NodeF lexeme a -> b #

foldr1 :: (a -> a -> a) -> NodeF lexeme a -> a #

foldl1 :: (a -> a -> a) -> NodeF lexeme a -> a #

toList :: NodeF lexeme a -> [a] #

null :: NodeF lexeme a -> Bool #

length :: NodeF lexeme a -> Int #

elem :: Eq a => a -> NodeF lexeme a -> Bool #

maximum :: Ord a => NodeF lexeme a -> a #

minimum :: Ord a => NodeF lexeme a -> a #

sum :: Num a => NodeF lexeme a -> a #

product :: Num a => NodeF lexeme a -> a #

Traversable (NodeF lexeme) Source # 
Instance details

Defined in Language.Happy.Ast

Methods

traverse :: Applicative f => (a -> f b) -> NodeF lexeme a -> f (NodeF lexeme b) #

sequenceA :: Applicative f => NodeF lexeme (f a) -> f (NodeF lexeme a) #

mapM :: Monad m => (a -> m b) -> NodeF lexeme a -> m (NodeF lexeme b) #

sequence :: Monad m => NodeF lexeme (m a) -> m (NodeF lexeme a) #

ToJSON lexeme => ToJSON1 (NodeF lexeme) Source # 
Instance details

Defined in Language.Happy.Ast

Methods

liftToJSON :: (a -> Bool) -> (a -> Value) -> ([a] -> Value) -> NodeF lexeme a -> Value #

liftToJSONList :: (a -> Bool) -> (a -> Value) -> ([a] -> Value) -> [NodeF lexeme a] -> Value #

liftToEncoding :: (a -> Bool) -> (a -> Encoding) -> ([a] -> Encoding) -> NodeF lexeme a -> Encoding #

liftToEncodingList :: (a -> Bool) -> (a -> Encoding) -> ([a] -> Encoding) -> [NodeF lexeme a] -> Encoding #

liftOmitField :: (a -> Bool) -> NodeF lexeme a -> Bool #

FromJSON lexeme => FromJSON1 (NodeF lexeme) Source # 
Instance details

Defined in Language.Happy.Ast

Methods

liftParseJSON :: Maybe a -> (Value -> Parser a) -> (Value -> Parser [a]) -> Value -> Parser (NodeF lexeme a) #

liftParseJSONList :: Maybe a -> (Value -> Parser a) -> (Value -> Parser [a]) -> Value -> Parser [NodeF lexeme a] #

liftOmittedField :: Maybe a -> Maybe (NodeF lexeme a) #

Eq lexeme => Eq1 (NodeF lexeme) Source # 
Instance details

Defined in Language.Happy.Ast

Methods

liftEq :: (a -> b -> Bool) -> NodeF lexeme a -> NodeF lexeme b -> Bool #

Ord lexeme => Ord1 (NodeF lexeme) Source # 
Instance details

Defined in Language.Happy.Ast

Methods

liftCompare :: (a -> b -> Ordering) -> NodeF lexeme a -> NodeF lexeme b -> Ordering #

Read lexeme => Read1 (NodeF lexeme) Source # 
Instance details

Defined in Language.Happy.Ast

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (NodeF lexeme a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [NodeF lexeme a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (NodeF lexeme a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [NodeF lexeme a] #

Show lexeme => Show1 (NodeF lexeme) Source # 
Instance details

Defined in Language.Happy.Ast

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> NodeF lexeme a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [NodeF lexeme a] -> ShowS #

Generic1 (NodeF lexeme :: Type -> Type) Source # 
Instance details

Defined in Language.Happy.Ast

Associated Types

type Rep1 (NodeF lexeme) :: k -> Type #

Methods

from1 :: forall (a :: k). NodeF lexeme a -> Rep1 (NodeF lexeme) a #

to1 :: forall (a :: k). Rep1 (NodeF lexeme) a -> NodeF lexeme a #

(Eq lexeme, Eq a) => Eq (NodeF lexeme a) Source # 
Instance details

Defined in Language.Happy.Ast

Methods

(==) :: NodeF lexeme a -> NodeF lexeme a -> Bool #

(/=) :: NodeF lexeme a -> NodeF lexeme a -> Bool #

(Ord lexeme, Ord a) => Ord (NodeF lexeme a) Source # 
Instance details

Defined in Language.Happy.Ast

Methods

compare :: 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 #

max :: NodeF lexeme a -> NodeF lexeme a -> NodeF lexeme a #

min :: NodeF lexeme a -> NodeF lexeme a -> NodeF lexeme a #

(Read lexeme, Read a) => Read (NodeF lexeme a) Source # 
Instance details

Defined in Language.Happy.Ast

Methods

readsPrec :: Int -> ReadS (NodeF lexeme a) #

readList :: ReadS [NodeF lexeme a] #

readPrec :: ReadPrec (NodeF lexeme a) #

readListPrec :: ReadPrec [NodeF lexeme a] #

(Show lexeme, Show a) => Show (NodeF lexeme a) Source # 
Instance details

Defined in Language.Happy.Ast

Methods

showsPrec :: Int -> NodeF lexeme a -> ShowS #

show :: NodeF lexeme a -> String #

showList :: [NodeF lexeme a] -> ShowS #

Generic (NodeF lexeme a) Source # 
Instance details

Defined in Language.Happy.Ast

Associated Types

type Rep (NodeF lexeme a) :: Type -> Type #

Methods

from :: NodeF lexeme a -> Rep (NodeF lexeme a) x #

to :: Rep (NodeF lexeme a) x -> NodeF lexeme a #

type Rep1 (NodeF lexeme :: Type -> Type) Source # 
Instance details

Defined in Language.Happy.Ast

type Rep1 (NodeF lexeme :: Type -> Type) = D1 ('MetaData "NodeF" "Language.Happy.Ast" "happy-arbitrary-0.0.2-inplace" 'False) ((((C1 ('MetaCons "Grammar" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [lexeme]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec1 [])) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec1 []) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [lexeme]))) :+: C1 ('MetaCons "PragmaExpect" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 lexeme))) :+: (C1 ('MetaCons "PragmaName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 lexeme) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 lexeme)) :+: C1 ('MetaCons "PragmaErrorHandlerType" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 lexeme)))) :+: ((C1 ('MetaCons "PragmaError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 lexeme)) :+: C1 ('MetaCons "PragmaLexer" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 lexeme) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 lexeme))) :+: (C1 ('MetaCons "PragmaMonad" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 lexeme)) :+: C1 ('MetaCons "PragmaTokenType" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 lexeme))))) :+: (((C1 ('MetaCons "PragmaToken" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec1 [])) :+: C1 ('MetaCons "PragmaLeft" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [lexeme]))) :+: (C1 ('MetaCons "PragmaRight" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [lexeme])) :+: C1 ('MetaCons "Token" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 lexeme) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 lexeme)))) :+: ((C1 ('MetaCons "Rule" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) Par1 :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) Par1) :+: C1 ('MetaCons "RuleType" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 lexeme) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 lexeme))) :+: (C1 ('MetaCons "RuleDefn" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 lexeme) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec1 [])) :+: C1 ('MetaCons "RuleLine" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [lexeme]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 lexeme))))))
type Rep (NodeF lexeme a) Source # 
Instance details

Defined in Language.Happy.Ast

type Rep (NodeF lexeme a) = D1 ('MetaData "NodeF" "Language.Happy.Ast" "happy-arbitrary-0.0.2-inplace" 'False) ((((C1 ('MetaCons "Grammar" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [lexeme]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [a])) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [a]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [lexeme]))) :+: C1 ('MetaCons "PragmaExpect" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 lexeme))) :+: (C1 ('MetaCons "PragmaName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 lexeme) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 lexeme)) :+: C1 ('MetaCons "PragmaErrorHandlerType" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 lexeme)))) :+: ((C1 ('MetaCons "PragmaError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 lexeme)) :+: C1 ('MetaCons "PragmaLexer" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 lexeme) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 lexeme))) :+: (C1 ('MetaCons "PragmaMonad" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 lexeme)) :+: C1 ('MetaCons "PragmaTokenType" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 lexeme))))) :+: (((C1 ('MetaCons "PragmaToken" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [a])) :+: C1 ('MetaCons "PragmaLeft" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [lexeme]))) :+: (C1 ('MetaCons "PragmaRight" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [lexeme])) :+: C1 ('MetaCons "Token" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 lexeme) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 lexeme)))) :+: ((C1 ('MetaCons "Rule" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 a) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 a)) :+: C1 ('MetaCons "RuleType" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 lexeme) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 lexeme))) :+: (C1 ('MetaCons "RuleDefn" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 lexeme) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [a])) :+: C1 ('MetaCons "RuleLine" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [lexeme]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 lexeme))))))