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

Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Language.Egison.Parser.Pattern

Contents

Description

A parser for Egison patterns.

Synopsis

Documentation

parseExprL :: (Source s, MonadError (Errors s) m) => ParseMode n v e s -> FilePath -> s -> m (ExprL n v e) Source #

Parse Expr with locations annotated.

parseExpr :: (Source s, MonadError (Errors s) m) => ParseMode n v e s -> FilePath -> s -> m (Expr n v e) Source #

Parse Expr.

Re-exports

data Location Source #

Location, a range of positions in source code.

Constructors

Location 

Fields

Instances
Eq Location Source # 
Instance details

Defined in Language.Egison.Parser.Pattern.Prim.Location

Data Location Source # 
Instance details

Defined in Language.Egison.Parser.Pattern.Prim.Location

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Location -> c Location #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Location #

toConstr :: Location -> Constr #

dataTypeOf :: Location -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Location) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Location) #

gmapT :: (forall b. Data b => b -> b) -> Location -> Location #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Location -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Location -> r #

gmapQ :: (forall d. Data d => d -> u) -> Location -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Location -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Location -> m Location #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Location -> m Location #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Location -> m Location #

Show Location Source # 
Instance details

Defined in Language.Egison.Parser.Pattern.Prim.Location

Generic Location Source # 
Instance details

Defined in Language.Egison.Parser.Pattern.Prim.Location

Associated Types

type Rep Location :: Type -> Type #

Methods

from :: Location -> Rep Location x #

to :: Rep Location x -> Location #

type Rep Location Source # 
Instance details

Defined in Language.Egison.Parser.Pattern.Prim.Location

type Rep Location = D1 (MetaData "Location" "Language.Egison.Parser.Pattern.Prim.Location" "egison-pattern-src-0.1.0.0-EKV87hBGG8O2A8pHnh2PbK" False) (C1 (MetaCons "Location" PrefixI True) (S1 (MetaSel (Just "begin") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Position) :*: S1 (MetaSel (Just "end") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Position)))

data Position Source #

Position in source code.

Constructors

Position 

Fields

Instances
Eq Position Source # 
Instance details

Defined in Language.Egison.Parser.Pattern.Prim.Location

Data Position Source # 
Instance details

Defined in Language.Egison.Parser.Pattern.Prim.Location

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Position -> c Position #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Position #

toConstr :: Position -> Constr #

dataTypeOf :: Position -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Position) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Position) #

gmapT :: (forall b. Data b => b -> b) -> Position -> Position #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Position -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Position -> r #

gmapQ :: (forall d. Data d => d -> u) -> Position -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Position -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Position -> m Position #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Position -> m Position #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Position -> m Position #

Show Position Source # 
Instance details

Defined in Language.Egison.Parser.Pattern.Prim.Location

Generic Position Source # 
Instance details

Defined in Language.Egison.Parser.Pattern.Prim.Location

Associated Types

type Rep Position :: Type -> Type #

Methods

from :: Position -> Rep Position x #

to :: Rep Position x -> Position #

type Rep Position Source # 
Instance details

Defined in Language.Egison.Parser.Pattern.Prim.Location

type Rep Position = D1 (MetaData "Position" "Language.Egison.Parser.Pattern.Prim.Location" "egison-pattern-src-0.1.0.0-EKV87hBGG8O2A8pHnh2PbK" False) (C1 (MetaCons "Position" PrefixI True) (S1 (MetaSel (Just "line") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int) :*: S1 (MetaSel (Just "column") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int)))

type Tokens s = Tokens s Source #

Type of tokens in the source.

type Token s = Token s Source #

Type of token in the source.

type Source s = (Stream s, IsToken (Token s)) Source #

Constraint for the source of parser.

type Errors s = NonEmpty (Error s) Source #

Type synonym for an error list.

data Error s Source #

Parse error.

Instances
Eq (Tokens s) => Eq (Error s) Source # 
Instance details

Defined in Language.Egison.Parser.Pattern.Prim.Error

Methods

(==) :: Error s -> Error s -> Bool #

(/=) :: Error s -> Error s -> Bool #

Show (Tokens s) => Show (Error s) Source # 
Instance details

Defined in Language.Egison.Parser.Pattern.Prim.Error

Methods

showsPrec :: Int -> Error s -> ShowS #

show :: Error s -> String #

showList :: [Error s] -> ShowS #

data ErrorItem s Source #

Token representation in Error.

Constructors

Tokens (Tokens s) 
Label String 
EndOfInput 
Instances
Eq (Tokens s) => Eq (ErrorItem s) Source # 
Instance details

Defined in Language.Egison.Parser.Pattern.Prim.Error

Methods

(==) :: ErrorItem s -> ErrorItem s -> Bool #

(/=) :: ErrorItem s -> ErrorItem s -> Bool #

Show (Tokens s) => Show (ErrorItem s) Source # 
Instance details

Defined in Language.Egison.Parser.Pattern.Prim.Error

data Associativity Source #

Associativity of infix operators.

Instances
Eq Associativity Source # 
Instance details

Defined in Language.Egison.Syntax.Pattern.Fixity.Associativity

Data Associativity Source # 
Instance details

Defined in Language.Egison.Syntax.Pattern.Fixity.Associativity

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Associativity -> c Associativity #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Associativity #

toConstr :: Associativity -> Constr #

dataTypeOf :: Associativity -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Associativity) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Associativity) #

gmapT :: (forall b. Data b => b -> b) -> Associativity -> Associativity #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Associativity -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Associativity -> r #

gmapQ :: (forall d. Data d => d -> u) -> Associativity -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Associativity -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Associativity -> m Associativity #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Associativity -> m Associativity #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Associativity -> m Associativity #

Show Associativity Source # 
Instance details

Defined in Language.Egison.Syntax.Pattern.Fixity.Associativity

Generic Associativity Source # 
Instance details

Defined in Language.Egison.Syntax.Pattern.Fixity.Associativity

Associated Types

type Rep Associativity :: Type -> Type #

type Rep Associativity Source # 
Instance details

Defined in Language.Egison.Syntax.Pattern.Fixity.Associativity

type Rep Associativity = D1 (MetaData "Associativity" "Language.Egison.Syntax.Pattern.Fixity.Associativity" "egison-pattern-src-0.1.0.0-EKV87hBGG8O2A8pHnh2PbK" False) (C1 (MetaCons "AssocLeft" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "AssocRight" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "AssocNone" PrefixI False) (U1 :: Type -> Type)))

newtype Precedence Source #

A precedence of infix operators.

Constructors

Precedence Int 
Instances
Eq Precedence Source # 
Instance details

Defined in Language.Egison.Syntax.Pattern.Fixity.Precedence

Data Precedence Source # 
Instance details

Defined in Language.Egison.Syntax.Pattern.Fixity.Precedence

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Precedence -> c Precedence #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Precedence #

toConstr :: Precedence -> Constr #

dataTypeOf :: Precedence -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Precedence) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Precedence) #

gmapT :: (forall b. Data b => b -> b) -> Precedence -> Precedence #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Precedence -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Precedence -> r #

gmapQ :: (forall d. Data d => d -> u) -> Precedence -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Precedence -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Precedence -> m Precedence #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Precedence -> m Precedence #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Precedence -> m Precedence #

Ord Precedence Source # 
Instance details

Defined in Language.Egison.Syntax.Pattern.Fixity.Precedence

Show Precedence Source # 
Instance details

Defined in Language.Egison.Syntax.Pattern.Fixity.Precedence

Generic Precedence Source # 
Instance details

Defined in Language.Egison.Syntax.Pattern.Fixity.Precedence

Associated Types

type Rep Precedence :: Type -> Type #

type Rep Precedence Source # 
Instance details

Defined in Language.Egison.Syntax.Pattern.Fixity.Precedence

type Rep Precedence = D1 (MetaData "Precedence" "Language.Egison.Syntax.Pattern.Fixity.Precedence" "egison-pattern-src-0.1.0.0-EKV87hBGG8O2A8pHnh2PbK" True) (C1 (MetaCons "Precedence" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int)))

data Fixity n Source #

Fixity of infix operators.

Constructors

Fixity 

data ParseMode n v e s Source #

Parser configuration.

data ParseFixity n s Source #

Fixity of infix operators.

Constructors

ParseFixity 

Fields

type ExtParser s a = Tokens s -> Either String a Source #

ExtParser s a is a type for externally provided parser of a.

type ExprL n v e = Cofree (ExprF n v e) Location Source #

Expr with locations annotated.