egison-pattern-src-0.1.0.0: Manipulating Egison patterns: abstract syntax, parser, and pretty-printer

Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Language.Egison.Syntax.Pattern.Base

Contents

Description

This module defines a base functor of Expr that is useful to abstract recursive computations on Expr.

Synopsis

Documentation

data ExprF (n :: Type) (v :: Type) (e :: Type) r Source #

Base functor of Expr.

Constructors

WildcardF 
VariableF v 
ValueF e 
PredicateF e 
AndF r r 
OrF r r 
NotF r 
InfixF n r r 
PatternF n [r] 
Instances
Functor (ExprF n v e) Source # 
Instance details

Defined in Language.Egison.Syntax.Pattern.Base

Methods

fmap :: (a -> b) -> ExprF n v e a -> ExprF n v e b #

(<$) :: a -> ExprF n v e b -> ExprF n v e a #

Foldable (ExprF n v e) Source # 
Instance details

Defined in Language.Egison.Syntax.Pattern.Base

Methods

fold :: Monoid m => ExprF n v e m -> m #

foldMap :: Monoid m => (a -> m) -> ExprF n v e a -> m #

foldr :: (a -> b -> b) -> b -> ExprF n v e a -> b #

foldr' :: (a -> b -> b) -> b -> ExprF n v e a -> b #

foldl :: (b -> a -> b) -> b -> ExprF n v e a -> b #

foldl' :: (b -> a -> b) -> b -> ExprF n v e a -> b #

foldr1 :: (a -> a -> a) -> ExprF n v e a -> a #

foldl1 :: (a -> a -> a) -> ExprF n v e a -> a #

toList :: ExprF n v e a -> [a] #

null :: ExprF n v e a -> Bool #

length :: ExprF n v e a -> Int #

elem :: Eq a => a -> ExprF n v e a -> Bool #

maximum :: Ord a => ExprF n v e a -> a #

minimum :: Ord a => ExprF n v e a -> a #

sum :: Num a => ExprF n v e a -> a #

product :: Num a => ExprF n v e a -> a #

Traversable (ExprF n v e) Source # 
Instance details

Defined in Language.Egison.Syntax.Pattern.Base

Methods

traverse :: Applicative f => (a -> f b) -> ExprF n v e a -> f (ExprF n v e b) #

sequenceA :: Applicative f => ExprF n v e (f a) -> f (ExprF n v e a) #

mapM :: Monad m => (a -> m b) -> ExprF n v e a -> m (ExprF n v e b) #

sequence :: Monad m => ExprF n v e (m a) -> m (ExprF n v e a) #

Orphan instances

Recursive (Expr n v e) Source # 
Instance details

Methods

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 # 
Instance details

Methods

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 #