ghc-7.6.3: The GHC API

Safe Haskell | None

Avail

Synopsis

- type Avails = [AvailInfo]
- data AvailInfo
  - = Avail Name
  - | AvailTC Name [Name]
- availsToNameSet :: [AvailInfo] -> NameSet
- availsToNameEnv :: [AvailInfo] -> NameEnv AvailInfo
- availName :: AvailInfo -> Name
- availNames :: AvailInfo -> [Name]
- stableAvailCmp :: AvailInfo -> AvailInfo -> Ordering
- gresFromAvails :: Provenance -> [AvailInfo] -> [GlobalRdrElt]
- gresFromAvail :: (Name -> Provenance) -> AvailInfo -> [GlobalRdrElt]

# Documentation

type Avails = [AvailInfo]

A collection of `AvailInfo` - several things that are "available"

data AvailInfo

Records what things are available, i.e. in scope

Constructors

Avail Name | An ordinary identifier in scope
AvailTC Name [Name] | A type or class in scope. Parameters: 1) The name of the type or class 2) The available pieces of type or class. 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, ==, /=]`

Instances

Eq AvailInfo |
Outputable AvailInfo |
Binary AvailInfo |

availsToNameSet :: [AvailInfo] -> NameSet

availsToNameEnv :: [AvailInfo] -> NameEnv AvailInfo

availName :: AvailInfo -> Name

Just the main name made available, i.e. not the available pieces of type or class brought into scope by the `GenAvailInfo`

availNames :: AvailInfo -> [Name]

All names made available by the availability information

stableAvailCmp :: AvailInfo -> AvailInfo -> Ordering

Compare lexicographically

gresFromAvails :: Provenance -> [AvailInfo] -> [GlobalRdrElt]

make a `GlobalRdrEnv` where all the elements point to the same Provenance (useful for hiding imports, or imports with no details).

gresFromAvail :: (Name -> Provenance) -> AvailInfo -> [GlobalRdrElt]