| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Symantic.Typed.Fixity
Synopsis
- data Fixity
- data Unifix
- data Infix = Infix {}
- infixL :: Precedence -> Infix
- infixR :: Precedence -> Infix
- infixB :: Side -> Precedence -> Infix
- infixN :: Precedence -> Infix
- infixN0 :: Infix
- infixN5 :: Infix
- isPairNeeded :: (Infix, Side) -> Infix -> Bool
- pairIfNeeded :: Semigroup s => IsString s => Pair -> (Infix, Side) -> Infix -> s -> s
- type Precedence = Int
- class PrecedenceOf a where
- precedence :: a -> Precedence
- data Associativity
- data Side
- type Pair = (String, String)
- pairAngle :: Pair
- pairBrace :: Pair
- pairBracket :: Pair
- pairParen :: Pair
Type Fixity
Instances
| Eq Fixity Source # | |
| Show Fixity Source # | |
| PrecedenceOf Fixity Source # | |
Defined in Symantic.Typed.Fixity Methods precedence :: Fixity -> Precedence Source # | |
Type Unifix
Instances
| Eq Unifix Source # | |
| Show Unifix Source # | |
| PrecedenceOf Unifix Source # | |
Defined in Symantic.Typed.Fixity Methods precedence :: Unifix -> Precedence Source # | |
Type Infix
Constructors
| Infix | |
Fields | |
Instances
| Eq Infix Source # | |
| Show Infix Source # | |
| PrecedenceOf Infix Source # | |
Defined in Symantic.Typed.Fixity Methods precedence :: Infix -> Precedence Source # | |
infixL :: Precedence -> Infix Source #
infixR :: Precedence -> Infix Source #
infixN :: Precedence -> Infix Source #
isPairNeeded :: (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 a Pair.
pairIfNeeded :: Semigroup s => IsString s => Pair -> (Infix, Side) -> Infix -> s -> s Source #
If isPairNeeded is True,
enclose the given IsString by given Pair,
otherwise returns the same IsString.
Type Precedence
type Precedence = Int Source #
Class PrecedenceOf
class PrecedenceOf a where Source #
Methods
precedence :: a -> Precedence Source #
Instances
| PrecedenceOf Infix Source # | |
Defined in Symantic.Typed.Fixity Methods precedence :: Infix -> Precedence Source # | |
| PrecedenceOf Unifix Source # | |
Defined in Symantic.Typed.Fixity Methods precedence :: Unifix -> Precedence Source # | |
| PrecedenceOf Fixity Source # | |
Defined in Symantic.Typed.Fixity Methods precedence :: Fixity -> Precedence Source # | |
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
| Eq Associativity Source # | |
Defined in Symantic.Typed.Fixity Methods (==) :: Associativity -> Associativity -> Bool # (/=) :: Associativity -> Associativity -> Bool # | |
| Show Associativity Source # | |
Defined in Symantic.Typed.Fixity Methods showsPrec :: Int -> Associativity -> ShowS # show :: Associativity -> String # showList :: [Associativity] -> ShowS # | |
Type Side
Type Pair
pairBracket :: Pair Source #