Safe Haskell | None |
---|---|
Language | Haskell2010 |
Language.Symantic.Grammar.Fixity
Contents
- data Fixity
- data Unifix
- data Infix = Infix {}
- infixL :: Precedence -> Infix
- infixR :: Precedence -> Infix
- infixB :: Side -> Precedence -> Infix
- infixN :: Precedence -> Infix
- infixN0 :: Infix
- infixN5 :: Infix
- needsParenInfix :: (Infix, Side) -> Infix -> Bool
- parenInfix :: (Semigroup s, IsString s) => (Infix, Side) -> Infix -> s -> s
- type Precedence = Int
- class PrecedenceOf a where
- data Associativity
- data Side
Type Fixity
Type Unifix
Type Infix
Constructors
Infix | |
Fields |
infixL :: Precedence -> Infix Source #
infixR :: Precedence -> Infix Source #
infixN :: Precedence -> Infix Source #
needsParenInfix :: (Infix, Side) -> Infix -> Bool Source #
Given Precedence
and Associativity
of its parent operator,
and the operand Side
it is in,
return whether an Infix
operator
needs to be enclosed by parenthesis.
parenInfix :: (Semigroup s, IsString s) => (Infix, Side) -> Infix -> s -> s Source #
If needsParenInfix
is True
,
enclose the given IsString
by parenthesis,
otherwise returns the same IsString
.
Type Precedence
type Precedence = Int Source #
Class PrecedenceOf
class PrecedenceOf a where Source #
Minimal complete definition
Methods
precedence :: a -> Precedence Source #
Instances
Type Associativity
data Associativity Source #
Constructors
AssocL | Associate to the left: |
AssocR | Associate to the right: |
AssocB Side | Associate to both sides, but to |
Instances