Safe Haskell | None |
---|---|
Language | Haskell2010 |
Data types for names
Synopsis
- 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 :: OpNameType) = OpName {}
- showOp :: OpName a -> Text
- data OpNameType
- eraseOpName :: OpName a -> OpName AnyOpName
- newtype ProperName (a :: ProperNameType) = ProperName {}
- data ProperNameType
- coerceProperName :: ProperName a -> ProperName b
- newtype ModuleName = ModuleName [ProperName Namespace]
- runModuleName :: ModuleName -> Text
- moduleNameFromString :: Text -> ModuleName
- isBuiltinModuleName :: ModuleName -> Bool
- 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.
Instances
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
Ident Text | An alphanumeric identifier |
GenIdent (Maybe Text) Integer | A generated name for an identifier |
UnusedIdent | A generated name used only for type-checking |
Instances
Eq Ident Source # | |
Ord Ident Source # | |
Show Ident Source # | |
Generic Ident Source # | |
NFData Ident Source # | |
Defined in Language.PureScript.Names | |
ToJSON Ident Source # | |
Defined in Language.PureScript.Names | |
FromJSON Ident Source # | |
type Rep Ident Source # | |
Defined in Language.PureScript.Names type Rep Ident = D1 (MetaData "Ident" "Language.PureScript.Names" "purescript-0.13.0-1whdl2565Nb1wvlLK7uK18" False) (C1 (MetaCons "Ident" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)) :+: (C1 (MetaCons "GenIdent" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Text)) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Integer)) :+: C1 (MetaCons "UnusedIdent" PrefixI False) (U1 :: Type -> Type))) |
freshIdent :: MonadSupply m => Text -> m Ident Source #
freshIdent' :: MonadSupply m => m Ident Source #
newtype OpName (a :: OpNameType) Source #
Operator alias names.
Instances
Eq (OpName a) Source # | |
Ord (OpName a) Source # | |
Defined in Language.PureScript.Names | |
Show (OpName a) Source # | |
Generic (OpName a) Source # | |
NFData (OpName a) Source # | |
Defined in Language.PureScript.Names | |
ToJSON (OpName a) Source # | |
Defined in Language.PureScript.Names | |
FromJSON (OpName a) Source # | |
type Rep (OpName a) Source # | |
Defined in Language.PureScript.Names |
newtype ProperName (a :: ProperNameType) Source #
Proper names, i.e. capitalized names for e.g. module names, type//data constructors.
Instances
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
Instances
runModuleName :: ModuleName -> Text Source #
isBuiltinModuleName :: ModuleName -> Bool Source #
A qualified name, i.e. a name with an optional module name
Qualified (Maybe ModuleName) a |
Instances
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