fourmolu-0.15.0.0: A formatter for Haskell source code

Safe Haskell | None
Language | GHC2021

Ormolu.Utils.Fixity

Synopsis

- getDotOrmoluForSourceFile :: MonadIO m => FilePath -> m (FixityOverrides, ModuleReexports)
- parseFixityDeclarationStr :: String -> Either String [(OpName, FixityInfo)]
- parseModuleReexportDeclarationStr :: String -> Either String (ModuleName, NonEmpty (Maybe PackageName, ModuleName))

# Documentation

getDotOrmoluForSourceFile #

Arguments

:: MonadIO m |
=> FilePath | `CabalInfo` already obtained for this source file
-> m (FixityOverrides, ModuleReexports) |

Attempt to locate and parse an `.ormolu` file. If it does not exist, default fixity map and module reexports are returned. This function maintains a cache of fixity overrides and module re-exports where cabal file paths act as keys.

parseFixityDeclarationStr #

Arguments

:: String | Input to parse
-> Either String [(OpName, FixityInfo)] | Parse result

A wrapper around `parseFixityDeclaration` for parsing individual fixity definitions.

parseModuleReexportDeclarationStr #

Arguments

:: String | Input to parse
-> Either String (ModuleName, NonEmpty (Maybe PackageName, ModuleName)) | Parse result

A wrapper around `parseModuleReexportDeclaration` for parsing a individual module reexport.