Safe Haskell | None |
---|---|
Language | Haskell2010 |
- 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
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 #
precedence :: a -> Precedence Source #
Type Associativity
data Associativity Source #