HORIZON HASKELLDocslts/ghc-10.0.x77a86622026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 77a8662 · 2026-10-31

ModuleAgda-2.8.0.2Haskell2010

Agda.Syntax.Fixity

Definitions for fixity, precedence levels, and declared syntax.

Contents
  1. Precendence
Synopsis
  • PackageAgda-2.8.0.2
  • Exports17
  • LanguageHaskell2010
  • LicenceMIT
  • SourceFixity.hs
datadata ThingWithFixity x

Decorating something with Fixity'.

Constructors

Instances8Functor, Foldable, Traversable, Show, Pretty, KillRange, …

Do we prefer parens around arguments like λ x → x or not? See lamBrackets.

Instances7Eq, Ord, Show, Generic, NFData, EmbPrj, …

Precendence

datadata Precedence
Instances7Eq, Show, Generic, NFData, Pretty, EmbPrj, …

When printing we keep track of a stack of precedences in order to be able to decide whether it's safe to leave out parens around lambdas. An empty stack is equivalent to TopCtx. Invariant: `notElem TopCtx`.

Does a lambda-like thing (lambda, let or pi) need brackets in the given context? A peculiar thing with lambdas is that they don't need brackets in certain right operand contexts. To decide we need to look at the stack of precedences and not just the current precedence. Example: m₁ >>= (λ x → x) >>= m₂ (for _>>=_ left associative).