unison-parser-typechecker-0.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Unison.Syntax.Precedence

Synopsis

Documentation

isTopLevelPrecedence :: Precedence -> Bool Source #

Indicates this is the RHS of a top-level definition.

data Precedence Source #

Constructors

Basement

The lowest precedence, used for top-level bindings

Bottom

Used for terms that never need parentheses

Annotation

Type annotations

Statement

A statement in a block

Control

Control flow constructs like `if`, match, `case`

InfixOp InfixPrecedence

Infix operators

Application

Function application

Prefix

Prefix operators like `'`, !

Top

The highest precedence, used for let bindings and blocks

operatorPrecedence :: Text -> Maybe Precedence Source #

Returns the precedence of an infix operator, if it has one.