Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Definitions for fixity analysis.
Synopsis
- data OpName
- pattern OpName :: Text -> OpName
- unOpName :: OpName -> Text
- occOpName :: OccName -> OpName
- data FixityDirection
- data FixityInfo = FixityInfo {}
- type FixityMap = Map OpName FixityInfo
- data LazyFixityMap
- lookupFixity :: OpName -> LazyFixityMap -> Maybe FixityInfo
- data HackageInfo = HackageInfo (Map PackageName FixityMap) (Map PackageName Int)
- defaultStrategyThreshold :: Float
- defaultFixityInfo :: FixityInfo
- buildFixityMap :: Float -> Set PackageName -> LazyFixityMap
- buildFixityMap' :: Map PackageName FixityMap -> Map PackageName Int -> Set PackageName -> Float -> Set PackageName -> LazyFixityMap
- bootPackages :: Set PackageName
- packageToOps :: Map PackageName FixityMap
- packageToPopularity :: Map PackageName Int
Documentation
An operator name.
data FixityDirection Source #
Fixity direction.
Instances
data FixityInfo Source #
Fixity information about an infix operator that takes the uncertainty that can arise from conflicting definitions into account.
FixityInfo | |
|
Instances
type FixityMap = Map OpName FixityInfo Source #
Map from the operator name to its FixityInfo
.
data LazyFixityMap Source #
Instances
Show LazyFixityMap Source # | |
Defined in Ormolu.Fixity.Internal showsPrec :: Int -> LazyFixityMap -> ShowS # show :: LazyFixityMap -> String # showList :: [LazyFixityMap] -> ShowS # |
lookupFixity :: OpName -> LazyFixityMap -> Maybe FixityInfo Source #
Lookup a FixityInfo
of an operator. This might have drastically
different performance depending on whether this is an "unusual" operator.
data HackageInfo Source #
The map of operators declared by each package and the popularity of each package, if available.
HackageInfo | |
|
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 | |
type Rep HackageInfo Source # | |
Defined in Ormolu.Fixity.Internal type Rep HackageInfo = D1 ('MetaData "HackageInfo" "Ormolu.Fixity.Internal" "ormolu-0.5.3.0-AnPnPiffES06d3yqkU3KCH" 'False) (C1 ('MetaCons "HackageInfo" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map PackageName FixityMap)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map PackageName Int)))) |
defaultStrategyThreshold :: Float Source #
The default value for the popularity ratio threshold, after which a very popular definition from packageToOps will completely rule out conflicting definitions instead of being merged with them.
defaultFixityInfo :: FixityInfo Source #
The lowest level of information we can have about an operator.
:: Float | Popularity ratio threshold, after which a very popular package will completely rule out conflicting definitions coming from other packages instead of being merged with them |
-> Set PackageName | Explicitly known dependencies |
-> LazyFixityMap | Resulting map |
Build a fixity map using the given popularity threshold and a list of cabal dependencies. Dependencies from the list have higher priority than other packages.
:: Map PackageName FixityMap | Map from package to fixity map for operators defined in this package |
-> Map PackageName Int | Map from package to popularity |
-> Set PackageName | Higher priority packages |
-> Float | Popularity ratio threshold, after which a very popular package will completely rule out conflicting definitions coming from other packages instead of being merged with them |
-> Set PackageName | Explicitly known dependencies |
-> LazyFixityMap | Resulting map |
Build a fixity map using the given popularity threshold and a list of cabal dependencies. Dependencies from the list have higher priority than other packages. This specific version of the function allows the user to specify the package databases used to build the final fixity map.
bootPackages :: Set PackageName Source #
List of packages shipped with GHC, for which the download count from Hackage does not reflect their high popularity. See https://github.com/tweag/ormolu/pull/830#issuecomment-986609572. "base" is not is this list, because it is already whitelisted by buildFixityMap'.