ormolu-0.5.3.0: A formatter for Haskell source code
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ormolu.Fixity.Internal

Synopsis

Documentation

data OpName Source #

An operator name.

Instances

Instances details
IsString OpName Source # 
Instance details

Defined in Ormolu.Fixity.Internal

Methods

fromString :: String -> OpName

Show OpName Source # 
Instance details

Defined in Ormolu.Fixity.Internal

Methods

showsPrec :: Int -> OpName -> ShowS

show :: OpName -> String

showList :: [OpName] -> ShowS

Binary OpName Source # 
Instance details

Defined in Ormolu.Fixity.Internal

Methods

put :: OpName -> Put

get :: Get OpName

putList :: [OpName] -> Put

Eq OpName Source # 
Instance details

Defined in Ormolu.Fixity.Internal

Methods

(==) :: OpName -> OpName -> Bool

(/=) :: OpName -> OpName -> Bool

Ord OpName Source # 
Instance details

Defined in Ormolu.Fixity.Internal

Methods

compare :: OpName -> OpName -> Ordering

(<) :: OpName -> OpName -> Bool

(<=) :: OpName -> OpName -> Bool

(>) :: OpName -> OpName -> Bool

(>=) :: OpName -> OpName -> Bool

max :: OpName -> OpName -> OpName

min :: OpName -> OpName -> OpName

pattern OpName :: Text -> OpName Source #

unOpName :: OpName -> Text Source #

Convert an OpName to Text.

occOpName :: OccName -> OpName Source #

Convert an 'OccName to an OpName.

data FixityDirection Source #

Fixity direction.

Constructors

InfixL 
InfixR 
InfixN 

Instances

Instances details
Generic FixityDirection Source # 
Instance details

Defined in Ormolu.Fixity.Internal

Associated Types

type Rep FixityDirection :: Type -> Type

Show FixityDirection Source # 
Instance details

Defined in Ormolu.Fixity.Internal

Methods

showsPrec :: Int -> FixityDirection -> ShowS

show :: FixityDirection -> String

showList :: [FixityDirection] -> ShowS

Binary FixityDirection Source # 
Instance details

Defined in Ormolu.Fixity.Internal

Methods

put :: FixityDirection -> Put

get :: Get FixityDirection

putList :: [FixityDirection] -> Put

Eq FixityDirection Source # 
Instance details

Defined in Ormolu.Fixity.Internal

Ord FixityDirection Source # 
Instance details

Defined in Ormolu.Fixity.Internal

type Rep FixityDirection Source # 
Instance details

Defined in Ormolu.Fixity.Internal

type Rep FixityDirection = D1 ('MetaData "FixityDirection" "Ormolu.Fixity.Internal" "ormolu-0.5.3.0-LSqmAwaUDYM2znHf8JMYPC" 'False) (C1 ('MetaCons "InfixL" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "InfixR" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "InfixN" 'PrefixI 'False) (U1 :: Type -> Type)))

data FixityInfo Source #

Fixity information about an infix operator that takes the uncertainty that can arise from conflicting definitions into account.

Constructors

FixityInfo 

Fields

  • fiDirection :: Maybe FixityDirection

    Fixity direction if it is known

  • fiMinPrecedence :: Int

    Minimum precedence level found in the (maybe conflicting) definitions for the operator (inclusive)

  • fiMaxPrecedence :: Int

    Maximum precedence level found in the (maybe conflicting) definitions for the operator (inclusive)

Instances

Instances details
Semigroup FixityInfo Source #

Gives the ability to merge two (maybe conflicting) definitions for an operator, keeping the higher level of compatible information from both.

Instance details

Defined in Ormolu.Fixity.Internal

Methods

(<>) :: FixityInfo -> FixityInfo -> FixityInfo

sconcat :: NonEmpty FixityInfo -> FixityInfo

stimes :: Integral b => b -> FixityInfo -> FixityInfo

Generic FixityInfo Source # 
Instance details

Defined in Ormolu.Fixity.Internal

Associated Types

type Rep FixityInfo :: Type -> Type

Methods

from :: FixityInfo -> Rep FixityInfo x

to :: Rep FixityInfo x -> FixityInfo

Show FixityInfo Source # 
Instance details

Defined in Ormolu.Fixity.Internal

Methods

showsPrec :: Int -> FixityInfo -> ShowS

show :: FixityInfo -> String

showList :: [FixityInfo] -> ShowS

Binary FixityInfo Source # 
Instance details

Defined in Ormolu.Fixity.Internal

Methods

put :: FixityInfo -> Put

get :: Get FixityInfo

putList :: [FixityInfo] -> Put

Eq FixityInfo Source # 
Instance details

Defined in Ormolu.Fixity.Internal

Methods

(==) :: FixityInfo -> FixityInfo -> Bool

(/=) :: FixityInfo -> FixityInfo -> Bool

Ord FixityInfo Source # 
Instance details

Defined in Ormolu.Fixity.Internal

type Rep FixityInfo Source # 
Instance details

Defined in Ormolu.Fixity.Internal

type Rep FixityInfo = D1 ('MetaData "FixityInfo" "Ormolu.Fixity.Internal" "ormolu-0.5.3.0-LSqmAwaUDYM2znHf8JMYPC" 'False) (C1 ('MetaCons "FixityInfo" 'PrefixI 'True) (S1 ('MetaSel ('Just "fiDirection") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe FixityDirection)) :*: (S1 ('MetaSel ('Just "fiMinPrecedence") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "fiMaxPrecedence") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))))

defaultFixityInfo :: FixityInfo Source #

The lowest level of information we can have about an operator.

colonFixityInfo :: FixityInfo Source #

Fixity info of the built-in colon data constructor.

data HackageInfo Source #

The map of operators declared by each package and the popularity of each package, if available.

Constructors

HackageInfo 

Fields

  • (Map PackageName FixityMap)

    Map from package name to a map from operator name to its fixity

  • (Map PackageName Int)

    Map from package name to its 30-days download count from Hackage

Instances

Instances details
Generic HackageInfo Source # 
Instance details

Defined in Ormolu.Fixity.Internal

Associated Types

type Rep HackageInfo :: Type -> Type

Methods

from :: HackageInfo -> Rep HackageInfo x

to :: Rep HackageInfo x -> HackageInfo

Binary HackageInfo Source # 
Instance details

Defined in Ormolu.Fixity.Internal

Methods

put :: HackageInfo -> Put

get :: Get HackageInfo

putList :: [HackageInfo] -> Put

type Rep HackageInfo Source # 
Instance details

Defined in Ormolu.Fixity.Internal

type Rep HackageInfo = D1 ('MetaData "HackageInfo" "Ormolu.Fixity.Internal" "ormolu-0.5.3.0-LSqmAwaUDYM2znHf8JMYPC" '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))))

type FixityMap = Map OpName FixityInfo Source #

Map from the operator name to its FixityInfo.

newtype LazyFixityMap Source #

A variant of FixityMap, represented as a lazy union of several FixityMaps.

Constructors

LazyFixityMap [FixityMap] 

Instances

Instances details
Show LazyFixityMap Source # 
Instance details

Defined in Ormolu.Fixity.Internal

Methods

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.