idris-1.3.4: Functional Programming Language with Dependent Types

License | BSD3
Maintainer | The Idris Community.
Safe Haskell | Safe-Inferred
Language | Haskell2010

Idris.Parser.Ops

Description

Synopsis

- table :: [FixDecl] -> [[Operator IdrisParser PTerm]]
- backtickOperator :: (Parsing m, MonadState IState m, MonadFail m) => m Name
- operatorName :: (Parsing m, MonadState IState m, MonadFail m) => m Name
- operatorFront :: (Parsing m, MonadFail m) => m Name
- fnName :: (Parsing m, MonadState IState m, MonadFail m) => m Name
- fixity :: IdrisParser PDecl
- checkDeclFixity :: IdrisParser PDecl -> IdrisParser PDecl
- checkNameFixity :: Name -> IdrisParser ()
- fixityType :: IdrisParser (Int -> Fixity)
- opChars :: String
- operatorLetter :: Parsing m => m Char
- commentMarkers :: [String]
- invalidOperators :: [String]
- symbolicOperator :: (Parsing m, MonadFail m) => m String
- reservedOp :: Parsing m => String -> m ()

# Documentation

table :: [FixDecl] -> [[Operator IdrisParser PTerm]] #

Creates table for fixity declarations to build expression parser using pre-build and user-defined operator/fixity declarations

backtickOperator :: (Parsing m, MonadState IState m, MonadFail m) => m Name #

Parses a function used as an operator -- enclosed in backticks

      BacktickOperator ::=
        '`' Name '`'
        ;

operatorName :: (Parsing m, MonadState IState m, MonadFail m) => m Name #

Parses an operator name (either a symbolic name or a backtick-quoted name)

      OperatorName ::=
          SymbolicOperator
        | BacktickOperator
        ;

operatorFront :: (Parsing m, MonadFail m) => m Name #

Parses an operator in function position i.e. enclosed by `()`, with an optional namespace

      OperatorFront ::=
        '(' '=' ')'
        | (Identifier_t .)? '(' Operator_t ')'
        ;

fnName :: (Parsing m, MonadState IState m, MonadFail m) => m Name #

Parses a function (either normal name or operator)

      FnName ::= Name | OperatorFront;

fixity :: IdrisParser PDecl #

Parses a fixity declaration `Fixity ::= FixityType Natural_t OperatorList Terminator ;`

checkDeclFixity :: IdrisParser PDecl -> IdrisParser PDecl #

Check that a declaration of an operator also has fixity declared

checkNameFixity :: Name -> IdrisParser () #

Checks that an operator name also has a fixity declaration

fixityType :: IdrisParser (Int -> Fixity) #

Parses a fixity declaration type (i.e. infix or prefix, associtavity) `FixityType ::= 'infixl' | 'infixr' | 'infix' | `prefix` ;`

opChars :: String #

operatorLetter :: Parsing m => m Char #

commentMarkers :: [String] #

invalidOperators :: [String] #

symbolicOperator :: (Parsing m, MonadFail m) => m String #

Parses an operator

reservedOp :: Parsing m => String -> m () #

Parses a reserved operator