Safe Haskell | None |
---|---|
Language | Haskell2010 |
Data types for names
- data Name
- getIdentName :: Name -> Maybe Ident
- getValOpName :: Name -> Maybe (OpName ValueOpName)
- getTypeName :: Name -> Maybe (ProperName TypeName)
- getKindName :: Name -> Maybe (ProperName KindName)
- getTypeOpName :: Name -> Maybe (OpName TypeOpName)
- getDctorName :: Name -> Maybe (ProperName ConstructorName)
- getClassName :: Name -> Maybe (ProperName ClassName)
- getModName :: Name -> Maybe ModuleName
- data Ident
- runIdent :: Ident -> Text
- showIdent :: Ident -> Text
- freshIdent :: MonadSupply m => Text -> m Ident
- freshIdent' :: MonadSupply m => m Ident
- newtype OpName a = OpName {}
- showOp :: OpName a -> Text
- data OpNameType
- newtype ProperName a = ProperName {}
- data ProperNameType
- coerceProperName :: ProperName a -> ProperName b
- newtype ModuleName = ModuleName [ProperName Namespace]
- runModuleName :: ModuleName -> Text
- moduleNameFromString :: Text -> ModuleName
- data Qualified a = Qualified (Maybe ModuleName) a
- showQualified :: (a -> Text) -> Qualified a -> Text
- getQual :: Qualified a -> Maybe ModuleName
- qualify :: ModuleName -> Qualified a -> (ModuleName, a)
- mkQualified :: a -> ModuleName -> Qualified a
- disqualify :: Qualified a -> a
- disqualifyFor :: Maybe ModuleName -> Qualified a -> Maybe a
- isQualified :: Qualified a -> Bool
- isUnqualified :: Qualified a -> Bool
- isQualifiedWith :: ModuleName -> Qualified a -> Bool
Documentation
A sum of the possible name types, useful for error and lint messages.
getValOpName :: Name -> Maybe (OpName ValueOpName) Source #
getTypeName :: Name -> Maybe (ProperName TypeName) Source #
getKindName :: Name -> Maybe (ProperName KindName) Source #
getTypeOpName :: Name -> Maybe (OpName TypeOpName) Source #
getDctorName :: Name -> Maybe (ProperName ConstructorName) Source #
getClassName :: Name -> Maybe (ProperName ClassName) Source #
getModName :: Name -> Maybe ModuleName Source #
Names for value identifiers
freshIdent :: MonadSupply m => Text -> m Ident Source #
freshIdent' :: MonadSupply m => m Ident Source #
Operator alias names.
newtype ProperName a Source #
Proper names, i.e. capitalized names for e.g. module names, type//data constructors.
Eq (ProperName a) Source # | |
Ord (ProperName a) Source # | |
Show (ProperName a) Source # | |
Generic (ProperName a) Source # | |
FromJSON (ProperName a) Source # | |
ToJSON (ProperName a) Source # | |
NFData (ProperName a) Source # | |
type Rep (ProperName a) Source # | |
data ProperNameType Source #
The closed set of proper name types.
coerceProperName :: ProperName a -> ProperName b Source #
Coerces a ProperName from one ProperNameType to another. This should be used with care, and is primarily used to convert ClassNames into TypeNames after classes have been desugared.
newtype ModuleName Source #
Module names
runModuleName :: ModuleName -> Text Source #
A qualified name, i.e. a name with an optional module name
Qualified (Maybe ModuleName) a |
Functor Qualified Source # | |
Eq a => Eq (Qualified a) Source # | |
Ord a => Ord (Qualified a) Source # | |
Show a => Show (Qualified a) Source # | |
Generic (Qualified a) Source # | |
FromJSON a0 => FromJSON (Qualified a0) Source # | |
ToJSON a0 => ToJSON (Qualified a0) Source # | |
NFData a => NFData (Qualified a) Source # | |
type Rep (Qualified a) Source # | |
qualify :: ModuleName -> Qualified a -> (ModuleName, a) Source #
Provide a default module name, if a name is unqualified
mkQualified :: a -> ModuleName -> Qualified a Source #
Makes a qualified value from a name and module name.
disqualify :: Qualified a -> a Source #
Remove the module name from a qualified name
disqualifyFor :: Maybe ModuleName -> Qualified a -> Maybe a Source #
Remove the qualification from a value when it is qualified with a particular module name.
isQualified :: Qualified a -> Bool Source #
Checks whether a qualified value is actually qualified with a module reference
isUnqualified :: Qualified a -> Bool Source #
Checks whether a qualified value is not actually qualified with a module reference
isQualifiedWith :: ModuleName -> Qualified a -> Bool Source #
Checks whether a qualified value is qualified with a particular module