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

Ormolu.Fixity.Internal

Synopsis

Documentation

data FixityDirection Source #

Fixity direction.

Constructors

InfixL 
InfixR 
InfixN 

Instances

Instances details
FromJSON FixityDirection Source # 
Instance details

Defined in Ormolu.Fixity.Internal

Methods

parseJSON :: Value -> Parser FixityDirection

parseJSONList :: Value -> Parser [FixityDirection]

ToJSON FixityDirection Source # 
Instance details

Defined in Ormolu.Fixity.Internal

Methods

toJSON :: FixityDirection -> Value

toEncoding :: FixityDirection -> Encoding

toJSONList :: [FixityDirection] -> Value

toEncodingList :: [FixityDirection] -> Encoding

Show FixityDirection Source # 
Instance details

Defined in Ormolu.Fixity.Internal

Methods

showsPrec :: Int -> FixityDirection -> ShowS

show :: FixityDirection -> String

showList :: [FixityDirection] -> ShowS

Eq FixityDirection Source # 
Instance details

Defined in Ormolu.Fixity.Internal

Ord FixityDirection Source # 
Instance details

Defined in Ormolu.Fixity.Internal

Lift FixityDirection Source # 
Instance details

Defined in Ormolu.Fixity.Internal

Methods

lift :: Quote m => FixityDirection -> m Exp

liftTyped :: forall (m :: Type -> Type). Quote m => FixityDirection -> Code m FixityDirection

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
FromJSON FixityInfo Source # 
Instance details

Defined in Ormolu.Fixity.Internal

Methods

parseJSON :: Value -> Parser FixityInfo

parseJSONList :: Value -> Parser [FixityInfo]

ToJSON FixityInfo Source # 
Instance details

Defined in Ormolu.Fixity.Internal

Methods

toJSON :: FixityInfo -> Value

toEncoding :: FixityInfo -> Encoding

toJSONList :: [FixityInfo] -> Value

toEncodingList :: [FixityInfo] -> Encoding

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

Show FixityInfo Source # 
Instance details

Defined in Ormolu.Fixity.Internal

Methods

showsPrec :: Int -> FixityInfo -> ShowS

show :: FixityInfo -> String

showList :: [FixityInfo] -> ShowS

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

Lift FixityInfo Source # 
Instance details

Defined in Ormolu.Fixity.Internal

Methods

lift :: Quote m => FixityInfo -> m Exp

liftTyped :: forall (m :: Type -> Type). Quote m => FixityInfo -> Code m FixityInfo

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 String FixityMap)

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

  • (Map String Int)

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

Instances

Instances details
FromJSON HackageInfo Source # 
Instance details

Defined in Ormolu.Fixity.Internal

Methods

parseJSON :: Value -> Parser HackageInfo

parseJSONList :: Value -> Parser [HackageInfo]

ToJSON HackageInfo Source # 
Instance details

Defined in Ormolu.Fixity.Internal

Methods

toJSON :: HackageInfo -> Value

toEncoding :: HackageInfo -> Encoding

toJSONList :: [HackageInfo] -> Value

toEncodingList :: [HackageInfo] -> Encoding

Lift HackageInfo Source # 
Instance details

Defined in Ormolu.Fixity.Internal

Methods

lift :: Quote m => HackageInfo -> m Exp

liftTyped :: forall (m :: Type -> Type). Quote m => HackageInfo -> Code m HackageInfo

type FixityMap = Map String 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 :: String -> LazyFixityMap -> Maybe FixityInfo Source #

Lookup a FixityInfo of an operator. This might have drastically different performance depending on whether this is an "unusal" operator.