Ormolu.Printer.Meat.Declaration.OpTree

fourmolu-0.17.0.0: A formatter for Haskell source code

Safe Haskell | None
Language | GHC2021

Ormolu.Printer.Meat.Declaration.OpTree

Description

Printing of operator trees.

Synopsis

- p_exprOpTree :: BracketStyle -> OpTree (LHsExpr GhcPs) (OpInfo (LHsExpr GhcPs)) -> R ()
- exprOpTree :: LHsExpr GhcPs -> OpTree (LHsExpr GhcPs) (LHsExpr GhcPs)
- p_cmdOpTree :: BracketStyle -> OpTree (LHsCmdTop GhcPs) (OpInfo (LHsExpr GhcPs)) -> R ()
- cmdOpTree :: LHsCmdTop GhcPs -> OpTree (LHsCmdTop GhcPs) (LHsExpr GhcPs)
- p_tyOpTree :: OpTree (LHsType GhcPs) (OpInfo (LocatedN RdrName)) -> R ()
- tyOpTree :: LHsType GhcPs -> OpTree (LHsType GhcPs) (LocatedN RdrName)
- getOpName :: HsExpr GhcPs -> Maybe RdrName
- getOpNameStr :: RdrName -> String

# Documentation

p_exprOpTree #

Arguments

:: BracketStyle | Bracket style to use
-> OpTree (LHsExpr GhcPs) (OpInfo (LHsExpr GhcPs)) | N-ary `OpTree` to render, enhanced with information regarding operator fixity
-> R () |

Print an operator tree where leaves are values.

exprOpTree :: LHsExpr GhcPs -> OpTree (LHsExpr GhcPs) (LHsExpr GhcPs) #

Convert a `LHsExpr` containing an operator tree to the `OpTree` intermediate representation.

p_cmdOpTree #

Arguments

:: BracketStyle | Bracket style to use
-> OpTree (LHsCmdTop GhcPs) (OpInfo (LHsExpr GhcPs)) | N-ary OpTree to render, enhanced with information regarding operator fixity
-> R () |

Print an operator tree where leaves are commands.

cmdOpTree :: LHsCmdTop GhcPs -> OpTree (LHsCmdTop GhcPs) (LHsExpr GhcPs) #

Convert a `LHsCmdTop` containing an operator tree to the `OpTree` intermediate representation.

p_tyOpTree #

Arguments

:: OpTree (LHsType GhcPs) (OpInfo (LocatedN RdrName)) | N-ary `OpTree` to render, enhanced with information regarding operator fixity
-> R () |

Print an operator tree where leaves are types.

tyOpTree :: LHsType GhcPs -> OpTree (LHsType GhcPs) (LocatedN RdrName) #

Convert a LHsType containing an operator tree to the `OpTree` intermediate representation.

getOpName :: HsExpr GhcPs -> Maybe RdrName #

Extract the operator name of the specified `HsExpr` if this expression corresponds to an operator.

getOpNameStr :: RdrName -> String #

Convert an operator name to a `String`.