Avail

ghc-8.0.0.20160204: The GHC API

Safe Haskell | None
Language | Haskell2010

Avail

Synopsis

- type Avails = [AvailInfo]
- data AvailInfo
  - = Avail IsPatSyn Name
  - | AvailTC Name [Name] [FieldLabel]
- data IsPatSyn
  - = NotPatSyn
  - | IsPatSyn
- avail :: Name -> AvailInfo
- patSynAvail :: Name -> AvailInfo
- availsToNameSet :: [AvailInfo] -> NameSet
- availsToNameSetWithSelectors :: [AvailInfo] -> NameSet
- availsToNameEnv :: [AvailInfo] -> NameEnv AvailInfo
- availName :: AvailInfo -> Name
- availNames :: AvailInfo -> [Name]
- availNonFldNames :: AvailInfo -> [Name]
- availNamesWithSelectors :: AvailInfo -> [Name]
- availFlds :: AvailInfo -> [FieldLabel]
- stableAvailCmp :: AvailInfo -> AvailInfo -> Ordering

# Documentation

type Avails = [AvailInfo] Source

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

data AvailInfo Source

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

Constructors

Avail IsPatSyn Name | An ordinary identifier in scope
AvailTC Name [Name] [FieldLabel] | A type or class in scope. Parameters: 1) The name of the type or class 2) The available pieces of type or class, excluding field selectors. 3) The record fields of the type (see Note [Representing fields in AvailInfo]). 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 |
Methods (==) :: AvailInfo -> AvailInfo -> Bool (/=) :: AvailInfo -> AvailInfo -> Bool
Outputable AvailInfo |
Methods ppr :: AvailInfo -> SDoc Source pprPrec :: Rational -> AvailInfo -> SDoc Source
Binary AvailInfo |
Methods put_ :: BinHandle -> AvailInfo -> IO () Source put :: BinHandle -> AvailInfo -> IO (Bin AvailInfo) Source get :: BinHandle -> IO AvailInfo Source

data IsPatSyn Source

Constructors

NotPatSyn |
IsPatSyn |

Instances

Eq IsPatSyn |
Methods (==) :: IsPatSyn -> IsPatSyn -> Bool (/=) :: IsPatSyn -> IsPatSyn -> Bool
Binary IsPatSyn |
Methods put_ :: BinHandle -> IsPatSyn -> IO () Source put :: BinHandle -> IsPatSyn -> IO (Bin IsPatSyn) Source get :: BinHandle -> IO IsPatSyn Source

avail :: Name -> AvailInfo Source

patSynAvail :: Name -> AvailInfo Source

availsToNameSet :: [AvailInfo] -> NameSet Source

availsToNameSetWithSelectors :: [AvailInfo] -> NameSet Source

availsToNameEnv :: [AvailInfo] -> NameEnv AvailInfo Source

availName :: AvailInfo -> Name Source

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] Source

All names made available by the availability information (excluding overloaded selectors)

availNonFldNames :: AvailInfo -> [Name] Source

Names for non-fields made available by the availability information

availNamesWithSelectors :: AvailInfo -> [Name] Source

All names made available by the availability information (including overloaded selectors)

availFlds :: AvailInfo -> [FieldLabel] Source

Fields made available by the availability information

stableAvailCmp :: AvailInfo -> AvailInfo -> Ordering Source

Compare lexicographically