A collection of AvailInfo - several things that are "available"
Moduleghc-10.0.0.20260917GHC2024
GHC.Types.Avail
- 3 types
- 14 values
- Packageghc-10.0.0.20260917
- Exports18
- LanguageGHC2024
- LicenceBSD-3-Clause
- SourceAvail.hs
Records what things are "available", i.e. in scope
Constructors
Avail NameAn ordinary identifier in scope, or a field label without a parent type (see Note [Representing pattern synonym fields in AvailInfo]).
AvailTC Name [Name]A type or class in scope
The AvailTC Invariant: If the type or class is itself to be in scope, it must be first in this list. Thus, typically:
AvailTC Eq [Eq, ==, \/=]
Instances4Data, NFData, Outputable, Binary
Does this AvailInfo export the parent decl? This depends on the invariant that the parent is first if it appears at all.
Just the main name made available, i.e. not the available pieces of type or class brought into scope by the AvailInfo
Names and fields made available by the availability information.
Names and fields made available by the availability information, other than the main decl itself.
Compare lexicographically
trims an AvailInfo to keep only a single name
filters an AvailInfo by the given predicate
filters AvailInfos by the given predicate
Combines AvailInfos from the same family
avails may have several items with the same availName
E.g import Ix( Ix(..), index )
will give Ix(Ix,index,range) and Ix(index)
We want to combine these; plusAvail does that
Occurrences of Avails in interface files must be deterministically ordered to guarantee interface file determinism.
We guarantee a deterministic order by either using the order explicitly given by the user (e.g. in an explicit constructor export list) or instead by sorting the avails with sortAvails.
Constructors
Instances5Eq, Ord, NFData, Outputable, Binary
Eq DetOrdAvailsDefined in ghc-10.0.0.20260917 · GHC.Types.AvailOrd DetOrdAvailsDefined in ghc-10.0.0.20260917 · GHC.Types.AvailNFData DetOrdAvailsDefined in ghc-10.0.0.20260917 · GHC.Types.AvailOutputable DetOrdAvailsDefined in ghc-10.0.0.20260917 · GHC.Types.AvailBinary DetOrdAvailsDefined in ghc-10.0.0.20260917 · GHC.Types.Avail
It's always safe to match on DetOrdAvails
Create an empty DetOrdAvails