Stability | experimental |
---|---|
Safe Haskell | None |
Language | Haskell2010 |
This module defines an AST (Abstract Syntax Tree) for Egison pattern expression.
Documentation
Egison pattern expressions.
n
is a type for name references in patterns, such as them in pattern constructors.
v
is a type for name bindings in patterns, such as them in pattern variables.
e
is a type for expressions in patterns, such as them in value patterns.
Wildcard | Wildcard pattern. Match with everything. |
Variable v | Pattern variable. The matched term is bound to the name. |
Value e | Value pattern. Match with equal terms. |
Predicate e | Predicate pattern. Match with terms that satisfy the given predicate. |
And (Expr n v e) (Expr n v e) | And pattern. Match when both patterns matches. |
Or (Expr n v e) (Expr n v e) | Or pattern. Match when one of given patterns matches. |
Not (Expr n v e) | Not pattern. Match when the given pattern does not match. |
Infix n (Expr n v e) (Expr n v e) | User-defined infix pattern. |
Pattern n [Expr n v e] | User-defined normal pattern. |
Instances
(Eq v, Eq e, Eq n) => Eq (Expr n v e) Source # | |
(Data n, Data v, Data e) => Data (Expr n v e) Source # | |
Defined in Language.Egison.Syntax.Pattern.Expr gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Expr n v e -> c (Expr n v e) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Expr n v e) # toConstr :: Expr n v e -> Constr # dataTypeOf :: Expr n v e -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Expr n v e)) # dataCast2 :: Typeable t => (forall d e0. (Data d, Data e0) => c (t d e0)) -> Maybe (c (Expr n v e)) # gmapT :: (forall b. Data b => b -> b) -> Expr n v e -> Expr n v e # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Expr n v e -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Expr n v e -> r # gmapQ :: (forall d. Data d => d -> u) -> Expr n v e -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Expr n v e -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Expr n v e -> m (Expr n v e) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Expr n v e -> m (Expr n v e) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Expr n v e -> m (Expr n v e) # | |
(Ord v, Ord e, Ord n) => Ord (Expr n v e) Source # | |
Defined in Language.Egison.Syntax.Pattern.Expr | |
(Show v, Show e, Show n) => Show (Expr n v e) Source # | |
Generic (Expr n v e) Source # | |
Recursive (Expr n v e) Source # | |
Defined in Language.Egison.Syntax.Pattern.Base project :: Expr n v e -> Base (Expr n v e) (Expr n v e) # cata :: (Base (Expr n v e) a -> a) -> Expr n v e -> a # para :: (Base (Expr n v e) (Expr n v e, a) -> a) -> Expr n v e -> a # gpara :: (Corecursive (Expr n v e), Comonad w) => (forall b. Base (Expr n v e) (w b) -> w (Base (Expr n v e) b)) -> (Base (Expr n v e) (EnvT (Expr n v e) w a) -> a) -> Expr n v e -> a # prepro :: Corecursive (Expr n v e) => (forall b. Base (Expr n v e) b -> Base (Expr n v e) b) -> (Base (Expr n v e) a -> a) -> Expr n v e -> a # gprepro :: (Corecursive (Expr n v e), Comonad w) => (forall b. Base (Expr n v e) (w b) -> w (Base (Expr n v e) b)) -> (forall c. Base (Expr n v e) c -> Base (Expr n v e) c) -> (Base (Expr n v e) (w a) -> a) -> Expr n v e -> a # | |
Corecursive (Expr n v e) Source # | |
Defined in Language.Egison.Syntax.Pattern.Base embed :: Base (Expr n v e) (Expr n v e) -> Expr n v e # ana :: (a -> Base (Expr n v e) a) -> a -> Expr n v e # apo :: (a -> Base (Expr n v e) (Either (Expr n v e) a)) -> a -> Expr n v e # postpro :: Recursive (Expr n v e) => (forall b. Base (Expr n v e) b -> Base (Expr n v e) b) -> (a -> Base (Expr n v e) a) -> a -> Expr n v e # gpostpro :: (Recursive (Expr n v e), Monad m) => (forall b. m (Base (Expr n v e) b) -> Base (Expr n v e) (m b)) -> (forall c. Base (Expr n v e) c -> Base (Expr n v e) c) -> (a -> Base (Expr n v e) (m a)) -> a -> Expr n v e # | |
type Rep (Expr n v e) Source # | |
Defined in Language.Egison.Syntax.Pattern.Expr type Rep (Expr n v e) = D1 (MetaData "Expr" "Language.Egison.Syntax.Pattern.Expr" "egison-pattern-src-0.1.0.0-EKV87hBGG8O2A8pHnh2PbK" False) (((C1 (MetaCons "Wildcard" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Variable" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 v))) :+: (C1 (MetaCons "Value" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 e)) :+: C1 (MetaCons "Predicate" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 e)))) :+: ((C1 (MetaCons "And" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Expr n v e)) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Expr n v e))) :+: C1 (MetaCons "Or" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Expr n v e)) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Expr n v e)))) :+: (C1 (MetaCons "Not" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Expr n v e))) :+: (C1 (MetaCons "Infix" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 n) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Expr n v e)) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Expr n v e)))) :+: C1 (MetaCons "Pattern" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 n) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Expr n v e])))))) | |
type Base (Expr n v e) Source # | |
Defined in Language.Egison.Syntax.Pattern.Base |