Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Definitions for fixity analysis.
Synopsis
- data OpName
- pattern OpName :: Text -> OpName
- unOpName :: OpName -> Text
- occOpName :: OccName -> OpName
- data FixityDirection
- data FixityInfo = FixityInfo {}
- defaultFixityInfo :: FixityInfo
- data FixityApproximation = FixityApproximation {}
- defaultFixityApproximation :: FixityApproximation
- newtype FixityOverrides = FixityOverrides {}
- defaultFixityOverrides :: FixityOverrides
- newtype ModuleReexports = ModuleReexports {}
- defaultModuleReexports :: ModuleReexports
- newtype PackageFixityMap = PackageFixityMap (Map OpName (NonEmpty (PackageName, ModuleName, FixityInfo)))
- newtype ModuleFixityMap = ModuleFixityMap (Map OpName FixityProvenance)
- inferFixity :: RdrName -> ModuleFixityMap -> FixityApproximation
- newtype HackageInfo = HackageInfo (Map PackageName (Map ModuleName (Map OpName FixityInfo)))
- hackageInfo :: HackageInfo
- defaultDependencies :: Set PackageName
- packageFixityMap :: Set PackageName -> PackageFixityMap
- packageFixityMap' :: HackageInfo -> Set PackageName -> PackageFixityMap
- moduleFixityMap :: PackageFixityMap -> [FixityImport] -> ModuleFixityMap
- applyFixityOverrides :: FixityOverrides -> ModuleFixityMap -> ModuleFixityMap
Documentation
An operator name.
data FixityDirection Source #
Fixity direction.
Instances
data FixityInfo Source #
Fixity information about an infix operator. This type provides precise
information as opposed to FixityApproximation
.
FixityInfo | |
|
Instances
defaultFixityInfo :: FixityInfo Source #
Fixity that is implicitly assumed if no fixity declaration is present.
data FixityApproximation Source #
Approximation of fixity information that takes the uncertainty that can arise from conflicting definitions into account.
FixityApproximation | |
|
Instances
defaultFixityApproximation :: FixityApproximation Source #
The lowest level of information we can have about an operator.
newtype FixityOverrides Source #
Map from the operator name to its FixityInfo
.
Instances
Show FixityOverrides Source # | |
Defined in Ormolu.Fixity.Internal showsPrec :: Int -> FixityOverrides -> ShowS # show :: FixityOverrides -> String # showList :: [FixityOverrides] -> ShowS # | |
Eq FixityOverrides Source # | |
Defined in Ormolu.Fixity.Internal (==) :: FixityOverrides -> FixityOverrides -> Bool # (/=) :: FixityOverrides -> FixityOverrides -> Bool # |
defaultFixityOverrides :: FixityOverrides Source #
Fixity overrides to use by default.
newtype ModuleReexports Source #
Module re-exports
Instances
Show ModuleReexports Source # | |
Defined in Ormolu.Fixity.Internal showsPrec :: Int -> ModuleReexports -> ShowS # show :: ModuleReexports -> String # showList :: [ModuleReexports] -> ShowS # | |
Eq ModuleReexports Source # | |
Defined in Ormolu.Fixity.Internal (==) :: ModuleReexports -> ModuleReexports -> Bool # (/=) :: ModuleReexports -> ModuleReexports -> Bool # |
defaultModuleReexports :: ModuleReexports Source #
Module re-exports to apply by default.
newtype PackageFixityMap Source #
Fixity information that is specific to a package being formatted. It requires module-specific imports in order to be usable.
Instances
Show PackageFixityMap Source # | |
Defined in Ormolu.Fixity.Internal showsPrec :: Int -> PackageFixityMap -> ShowS # show :: PackageFixityMap -> String # showList :: [PackageFixityMap] -> ShowS # | |
Eq PackageFixityMap Source # | |
Defined in Ormolu.Fixity.Internal (==) :: PackageFixityMap -> PackageFixityMap -> Bool # (/=) :: PackageFixityMap -> PackageFixityMap -> Bool # |
newtype ModuleFixityMap Source #
Fixity map that takes into account imports in a particular module.
Instances
Show ModuleFixityMap Source # | |
Defined in Ormolu.Fixity.Internal showsPrec :: Int -> ModuleFixityMap -> ShowS # show :: ModuleFixityMap -> String # showList :: [ModuleFixityMap] -> ShowS # | |
Eq ModuleFixityMap Source # | |
Defined in Ormolu.Fixity.Internal (==) :: ModuleFixityMap -> ModuleFixityMap -> Bool # (/=) :: ModuleFixityMap -> ModuleFixityMap -> Bool # |
inferFixity :: RdrName -> ModuleFixityMap -> FixityApproximation Source #
Get a FixityApproximation
of an operator.
newtype HackageInfo Source #
The map of operators declared by each package grouped by module name.
Instances
Generic HackageInfo Source # | |
Defined in Ormolu.Fixity.Internal type Rep HackageInfo :: Type -> Type # from :: HackageInfo -> Rep HackageInfo x # to :: Rep HackageInfo x -> HackageInfo # | |
Binary HackageInfo Source # | |
Defined in Ormolu.Fixity.Internal | |
NFData HackageInfo Source # | |
Defined in Ormolu.Fixity.Internal rnf :: HackageInfo -> () # | |
type Rep HackageInfo Source # | |
Defined in Ormolu.Fixity.Internal type Rep HackageInfo = D1 ('MetaData "HackageInfo" "Ormolu.Fixity.Internal" "fourmolu-0.13.0.0-8hEPiIbey584qr9aIJ6Seh" 'True) (C1 ('MetaCons "HackageInfo" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map PackageName (Map ModuleName (Map OpName FixityInfo)))))) |
hackageInfo :: HackageInfo Source #
The built-in HackageInfo
used by Ormolu.
defaultDependencies :: Set PackageName Source #
Default set of packages to assume as dependencies e.g. when no Cabal file is found or taken into consideration.
:: Set PackageName | Set of packages to select |
-> PackageFixityMap | Package fixity map |
Compute the fixity map that is specific to the package we are formatting.
:: HackageInfo | Hackage info |
-> Set PackageName | Set of packages to select |
-> PackageFixityMap | Package fixity map |
The same as packageFixityMap
, except this specific version of the
function allows the user to specify HackageInfo
used to build the final
fixity map.
:: PackageFixityMap | Fixity information selected from dependencies of this package |
-> [FixityImport] | A simplified representation of the import list in this module |
-> ModuleFixityMap | Fixity map specific to this module |
Compute the fixity map that is specific to the module we are formatting.
:: FixityOverrides | User overrides |
-> ModuleFixityMap | Module fixity map |
-> ModuleFixityMap | Module fixity map with overrides applied |
Apply fixity overrides.