Safe Haskell | None |
---|---|
Language | Haskell98 |
Language.PureScript.Names
Description
Data types for names
- data Ident
- runIdent :: Ident -> String
- showIdent :: Ident -> String
- freshIdent :: MonadSupply m => String -> m Ident
- freshIdent' :: MonadSupply m => m Ident
- newtype ProperName a = ProperName {}
- data ProperNameType
- coerceProperName :: ProperName a -> ProperName b
- newtype ModuleName = ModuleName [ProperName Namespace]
- runModuleName :: ModuleName -> String
- moduleNameFromString :: String -> ModuleName
- data Qualified a = Qualified (Maybe ModuleName) a
- showQualified :: (a -> String) -> Qualified a -> String
- qualify :: ModuleName -> Qualified a -> (ModuleName, a)
- mkQualified :: a -> ModuleName -> Qualified a
- disqualify :: Qualified a -> a
- isQualified :: Qualified a -> Bool
- isUnqualified :: Qualified a -> Bool
- isQualifiedWith :: ModuleName -> Qualified a -> Bool
Documentation
Names for value identifiers
freshIdent :: MonadSupply m => String -> m Ident Source
freshIdent' :: MonadSupply m => m Ident Source
newtype ProperName a Source
Proper names, i.e. capitalized names for e.g. module names, type//data constructors.
Constructors
ProperName | |
Fields |
Instances
Eq (ProperName a) Source | |
Ord (ProperName a) Source | |
Read (ProperName a) Source | |
Show (ProperName a) Source | |
ToJSON (ProperName a) Source | |
FromJSON (ProperName a) Source |
data ProperNameType Source
The closed set of proper name types.
Constructors
TypeName | |
ConstructorName | |
ClassName | |
Namespace |
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.
runModuleName :: ModuleName -> String Source
A qualified name, i.e. a name with an optional module name
Constructors
Qualified (Maybe ModuleName) a |
showQualified :: (a -> String) -> Qualified a -> String 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
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