GHC.Rename.Fixity

ghc-9.14.0.20251028: The GHC API

Safe Haskell | None
Language | GHC2021

GHC.Rename.Fixity

Synopsis

- data MiniFixityEnv = MFE {
  - mfe_data_level_names :: FastStringEnv (Located Fixity)
  - mfe_type_level_names :: FastStringEnv (Located Fixity)
  }
- addLocalFixities :: MiniFixityEnv -> [Name] -> RnM a -> RnM a
- lookupMiniFixityEnv :: MiniFixityEnv -> Name -> Maybe (Located Fixity)
- emptyMiniFixityEnv :: MiniFixityEnv
- lookupFixityRn :: Name -> RnM Fixity
- lookupFixityRn_help :: Name -> RnM (Bool, Fixity)
- lookupFieldFixityRn :: FieldOcc GhcRn -> RnM Fixity
- lookupTyFixityRn :: LocatedN Name -> RnM Fixity

# Documentation

data MiniFixityEnv Source #

Mini fixity env for the names we're about to bind, in a single binding group

It is keyed by the *FastString*, not the *OccName*, because the single fixity decl `infix 3 T` affects both the data constructor T and the type constructor T

We keep the location so that if we find a duplicate, we can report it sensibly

Fixity declarations may influence names in a single namespace by using a type or data specifier, e.g. in:

     data a :*: b = a :*: b
     infix 3 type :*:

To handle that correctly, MiniFixityEnv contains separate fields for type-level and data-level names. If no namespace specifier is provided, the declaration will populate both the type-level and data-level fields.

Constructors

MFE |
Fields mfe_data_level_names :: FastStringEnv (Located Fixity) mfe_type_level_names :: FastStringEnv (Located Fixity)

addLocalFixities :: MiniFixityEnv -> [Name] -> RnM a -> RnM a Source #

lookupMiniFixityEnv :: MiniFixityEnv -> Name -> Maybe (Located Fixity) Source #

emptyMiniFixityEnv :: MiniFixityEnv Source #

lookupFixityRn :: Name -> RnM Fixity Source #

lookupFixityRn_help :: Name -> RnM (Bool, Fixity) Source #

`lookupFixityRn_help` returns `(True, fixity)` if it finds a `Fixity` in a local environment or from an interface file. Otherwise, it returns `(False, fixity)` (e.g., for unbound `Name`s or `Name`s without user-supplied fixity declarations).

lookupFieldFixityRn :: FieldOcc GhcRn -> RnM Fixity Source #

lookupTyFixityRn :: LocatedN Name -> RnM Fixity Source #