Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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
- desugarSignedLiterals :: Module -> Module
- data RebracketCaller
- rebracket :: forall m. MonadError MultipleErrors m => MonadSupply m => [ExternsFile] -> Module -> m Module
- rebracketFiltered :: forall m. MonadError MultipleErrors m => MonadSupply m => RebracketCaller -> (Declaration -> Bool) -> [ExternsFile] -> Module -> m Module
- checkFixityExports :: forall m. MonadError MultipleErrors m => Module -> m Module
Documentation
desugarSignedLiterals :: Module -> Module Source #
Removes unary negation operators and replaces them with calls to negate
.
data RebracketCaller Source #
Indicates whether the rebracketModule
is being called with the full desugar pass
run via `purs compile` or whether
only the partial desguar pass is run
via `purs docs`.
This indication is needed to prevent
a `purs docs` error when using
`case _ of` syntax in a type class instance.
Instances
Show RebracketCaller Source # | |
Defined in Language.PureScript.Sugar.Operators showsPrec :: Int -> RebracketCaller -> ShowS # show :: RebracketCaller -> String # showList :: [RebracketCaller] -> ShowS # | |
Eq RebracketCaller Source # | |
Defined in Language.PureScript.Sugar.Operators (==) :: RebracketCaller -> RebracketCaller -> Bool # (/=) :: RebracketCaller -> RebracketCaller -> Bool # |
rebracket :: forall m. MonadError MultipleErrors m => MonadSupply 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 => MonadSupply m => RebracketCaller -> (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.