purescript-0.13.0: PureScript Programming Language Compiler

Safe HaskellNone
LanguageHaskell2010

Language.PureScript.Sugar.Operators

Description

This module implements the desugaring pass which reapplies binary operators based on their fixity data and removes explicit parentheses.

The value parser ignores fixity data when parsing binary operator applications, so it is necessary to reorder them here.

Synopsis

Documentation

desugarSignedLiterals :: Module -> Module Source #

Removes unary negation operators and replaces them with calls to negate.

rebracket :: forall m. MonadError MultipleErrors m => [ExternsFile] -> [Module] -> m [Module] Source #

Remove explicit parentheses and reorder binary operator applications.

This pass requires name desugaring and export elaboration to have run first.

rebracketFiltered :: forall m. MonadError MultipleErrors m => (Declaration -> Bool) -> [ExternsFile] -> [Module] -> m [Module] Source #

A version of rebracket which allows you to choose which declarations should be affected. This is used in docs generation, where we want to desugar type operators in instance declarations to ensure that instances are paired up with their types correctly, but we don't want to desugar type operators in value declarations.

checkFixityExports :: forall m. MonadError MultipleErrors m => Module -> m Module Source #

Checks all the fixity exports within a module to ensure that members aliased by the operators are also exported from the module.

This pass requires name desugaring and export elaboration to have run first.