idris-1.0: Functional Programming Language with Dependent Types

Copyright | License : BSD3
Maintainer | The Idris Community.
Safe Haskell | None
Language | Haskell98

Idris.Parser.Ops

Description

Synopsis

- table :: [FixDecl] -> OperatorTable IdrisParser PTerm
- toTable :: [FixDecl] -> OperatorTable IdrisParser PTerm
- binary :: String -> (FC -> PTerm -> PTerm -> PTerm) -> Assoc -> Operator IdrisParser PTerm
- prefix :: String -> (FC -> PTerm -> PTerm) -> Operator IdrisParser PTerm
- backtick :: Operator IdrisParser PTerm
- nofixityoperator :: Operator IdrisParser PTerm
- operatorFront :: IdrisParser (Name, FC)
- fnName :: IdrisParser (Name, FC)
- fixity :: IdrisParser PDecl
- checkDeclFixity :: IdrisParser PDecl -> IdrisParser PDecl
- checkNameFixity :: Name -> IdrisParser ()
- fixityType :: IdrisParser (Int -> Fixity)

# Documentation

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

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

toTable :: [FixDecl] -> OperatorTable IdrisParser PTerm #

Calculates table for fixity declarations

binary :: String -> (FC -> PTerm -> PTerm -> PTerm) -> Assoc -> Operator IdrisParser PTerm #

Binary operator

prefix :: String -> (FC -> PTerm -> PTerm) -> Operator IdrisParser PTerm #

Prefix operator

backtick :: Operator IdrisParser PTerm #

Backtick operator

nofixityoperator :: Operator IdrisParser PTerm #

Operator without fixity (throws an error)

operatorFront :: IdrisParser (Name, FC) #

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

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

fnName :: IdrisParser (Name, FC) #

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` ;`