purescript-0.15.12: PureScript Programming Language Compiler

Safe Haskell | Safe-Inferred
Language | Haskell2010

Language.PureScript.Names

Description

Data types for names

Synopsis

- data Name
  - = IdentName Ident
  - | ValOpName (OpName 'ValueOpName)
  - | TyName (ProperName 'TypeName)
  - | TyOpName (OpName 'TypeOpName)
  - | DctorName (ProperName 'ConstructorName)
  - | TyClassName (ProperName 'ClassName)
  - | ModName ModuleName
- getIdentName :: Name -> Maybe Ident
- getValOpName :: Name -> Maybe (OpName 'ValueOpName)
- getTypeName :: Name -> Maybe (ProperName 'TypeName)
- getTypeOpName :: Name -> Maybe (OpName 'TypeOpName)
- getDctorName :: Name -> Maybe (ProperName 'ConstructorName)
- getClassName :: Name -> Maybe (ProperName 'ClassName)
- data InternalIdentData
  - = RuntimeLazyFactory
  - | Lazy !Text
- data Ident
  - = Ident Text
  - | GenIdent (Maybe Text) Integer
  - | UnusedIdent
  - | InternalIdent !InternalIdentData
- unusedIdent :: Text
- runIdent :: Ident -> Text
- showIdent :: Ident -> Text
- freshIdent :: MonadSupply m => Text -> m Ident
- freshIdent' :: MonadSupply m => m Ident
- isPlainIdent :: Ident -> Bool
- newtype OpName (a :: OpNameType) = OpName {
  - runOpName :: Text
  }
- showOp :: OpName a -> Text
- data OpNameType
  - = ValueOpName
  - | TypeOpName
  - | AnyOpName
- eraseOpName :: OpName a -> OpName 'AnyOpName
- coerceOpName :: OpName a -> OpName b
- newtype ProperName (a :: ProperNameType) = ProperName {
  - runProperName :: Text
  }
- data ProperNameType
  - = TypeName
  - | ConstructorName
  - | ClassName
  - | Namespace
- coerceProperName :: ProperName a -> ProperName b
- newtype ModuleName = ModuleName Text
- runModuleName :: ModuleName -> Text
- moduleNameFromString :: Text -> ModuleName
- isBuiltinModuleName :: ModuleName -> Bool
- data QualifiedBy
  - = BySourcePos SourcePos
  - | ByModuleName ModuleName
- pattern ByNullSourcePos :: QualifiedBy
- isBySourcePos :: QualifiedBy -> Bool
- byMaybeModuleName :: Maybe ModuleName -> QualifiedBy
- toMaybeModuleName :: QualifiedBy -> Maybe ModuleName
- data Qualified a = Qualified QualifiedBy 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

data Name #

A sum of the possible name types, useful for error and lint messages.

Constructors

IdentName Ident |
ValOpName (OpName 'ValueOpName) |
TyName (ProperName 'TypeName) |
TyOpName (OpName 'TypeOpName) |
DctorName (ProperName 'ConstructorName) |
TyClassName (ProperName 'ClassName) |
ModName ModuleName |

#### Instances

Instances details

Generic Name # |
Instance details Defined in Language.PureScript.Names Associated Types type Rep Name :: Type -> Type # Methods from :: Name -> Rep Name x # to :: Rep Name x -> Name #
Show Name # |
Instance details Defined in Language.PureScript.Names Methods showsPrec :: Int -> Name -> ShowS # show :: Name -> String # showList :: [Name] -> ShowS #
NFData Name # |
Instance details Defined in Language.PureScript.Names Methods rnf :: Name -> () #
Eq Name # |
Instance details Defined in Language.PureScript.Names Methods (==) :: Name -> Name -> Bool # (/=) :: Name -> Name -> Bool #
Ord Name # |
Instance details Defined in Language.PureScript.Names Methods compare :: Name -> Name -> Ordering # (<) :: Name -> Name -> Bool # (<=) :: Name -> Name -> Bool # (>) :: Name -> Name -> Bool # (>=) :: Name -> Name -> Bool # max :: Name -> Name -> Name # min :: Name -> Name -> Name #
Serialise Name # |
Instance details Defined in Language.PureScript.Names Methods encode :: Name -> Encoding # decode :: Decoder s Name # encodeList :: [Name] -> Encoding # decodeList :: Decoder s [Name] #
type Rep Name # |
Instance details Defined in Language.PureScript.Names type Rep Name = D1 ('MetaData "Name" "Language.PureScript.Names" "purescript-0.15.12-5l1zT9m1jq0GgrLEUvYibC" 'False) ((C1 ('MetaCons "IdentName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Ident)) :+: (C1 ('MetaCons "ValOpName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (OpName 'ValueOpName))) :+: C1 ('MetaCons "TyName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ProperName 'TypeName))))) :+: ((C1 ('MetaCons "TyOpName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (OpName 'TypeOpName))) :+: C1 ('MetaCons "DctorName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ProperName 'ConstructorName)))) :+: (C1 ('MetaCons "TyClassName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ProperName 'ClassName))) :+: C1 ('MetaCons "ModName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ModuleName)))))

getIdentName :: Name -> Maybe Ident #

getValOpName :: Name -> Maybe (OpName 'ValueOpName) #

getTypeName :: Name -> Maybe (ProperName 'TypeName) #

getTypeOpName :: Name -> Maybe (OpName 'TypeOpName) #

getDctorName :: Name -> Maybe (ProperName 'ConstructorName) #

getClassName :: Name -> Maybe (ProperName 'ClassName) #

data InternalIdentData #

This type is meant to be extended with any new uses for idents that come along. Adding constructors to this type is cheaper than adding them to `Ident` because functions that match on `Ident` can ignore all `InternalIdent`s with a single pattern, and thus don't have to change if a new `InternalIdentData` constructor is created.

Constructors

RuntimeLazyFactory |
Lazy !Text |

#### Instances

Instances details

FromJSON InternalIdentData # |
Instance details Defined in Language.PureScript.Names Methods parseJSON :: Value -> Parser InternalIdentData # parseJSONList :: Value -> Parser [InternalIdentData] # omittedField :: Maybe InternalIdentData #
ToJSON InternalIdentData # |
Instance details Defined in Language.PureScript.Names Methods toJSON :: InternalIdentData -> Value # toEncoding :: InternalIdentData -> Encoding # toJSONList :: [InternalIdentData] -> Value # toEncodingList :: [InternalIdentData] -> Encoding # omitField :: InternalIdentData -> Bool #
Generic InternalIdentData # |
Instance details Defined in Language.PureScript.Names Associated Types type Rep InternalIdentData :: Type -> Type # Methods from :: InternalIdentData -> Rep InternalIdentData x # to :: Rep InternalIdentData x -> InternalIdentData #
Show InternalIdentData # |
Instance details Defined in Language.PureScript.Names Methods showsPrec :: Int -> InternalIdentData -> ShowS # show :: InternalIdentData -> String # showList :: [InternalIdentData] -> ShowS #
NFData InternalIdentData # |
Instance details Defined in Language.PureScript.Names Methods rnf :: InternalIdentData -> () #
Eq InternalIdentData # |
Instance details Defined in Language.PureScript.Names Methods (==) :: InternalIdentData -> InternalIdentData -> Bool # (/=) :: InternalIdentData -> InternalIdentData -> Bool #
Ord InternalIdentData # |
Instance details Defined in Language.PureScript.Names Methods compare :: InternalIdentData -> InternalIdentData -> Ordering # (<) :: InternalIdentData -> InternalIdentData -> Bool # (<=) :: InternalIdentData -> InternalIdentData -> Bool # (>) :: InternalIdentData -> InternalIdentData -> Bool # (>=) :: InternalIdentData -> InternalIdentData -> Bool # max :: InternalIdentData -> InternalIdentData -> InternalIdentData # min :: InternalIdentData -> InternalIdentData -> InternalIdentData #
Serialise InternalIdentData # |
Instance details Defined in Language.PureScript.Names Methods encode :: InternalIdentData -> Encoding # decode :: Decoder s InternalIdentData # encodeList :: [InternalIdentData] -> Encoding # decodeList :: Decoder s [InternalIdentData] #
type Rep InternalIdentData # |
Instance details Defined in Language.PureScript.Names type Rep InternalIdentData = D1 ('MetaData "InternalIdentData" "Language.PureScript.Names" "purescript-0.15.12-5l1zT9m1jq0GgrLEUvYibC" 'False) (C1 ('MetaCons "RuntimeLazyFactory" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Lazy" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text)))

data Ident #

Names for value identifiers

Constructors

Ident Text | An alphanumeric identifier
GenIdent (Maybe Text) Integer | A generated name for an identifier
UnusedIdent | A generated name used only for type-checking
InternalIdent !InternalIdentData | A generated name used only for internal transformations

#### Instances

Instances details

FromJSON Ident # |
Instance details Defined in Language.PureScript.Names Methods parseJSON :: Value -> Parser Ident # parseJSONList :: Value -> Parser [Ident] # omittedField :: Maybe Ident #
ToJSON Ident # |
Instance details Defined in Language.PureScript.Names Methods toJSON :: Ident -> Value # toEncoding :: Ident -> Encoding # toJSONList :: [Ident] -> Value # toEncodingList :: [Ident] -> Encoding # omitField :: Ident -> Bool #
Generic Ident # |
Instance details Defined in Language.PureScript.Names Associated Types type Rep Ident :: Type -> Type # Methods from :: Ident -> Rep Ident x # to :: Rep Ident x -> Ident #
Show Ident # |
Instance details Defined in Language.PureScript.Names Methods showsPrec :: Int -> Ident -> ShowS # show :: Ident -> String # showList :: [Ident] -> ShowS #
NFData Ident # |
Instance details Defined in Language.PureScript.Names Methods rnf :: Ident -> () #
Eq Ident # |
Instance details Defined in Language.PureScript.Names Methods (==) :: Ident -> Ident -> Bool # (/=) :: Ident -> Ident -> Bool #
Ord Ident # |
Instance details Defined in Language.PureScript.Names Methods compare :: Ident -> Ident -> Ordering # (<) :: Ident -> Ident -> Bool # (<=) :: Ident -> Ident -> Bool # (>) :: Ident -> Ident -> Bool # (>=) :: Ident -> Ident -> Bool # max :: Ident -> Ident -> Ident # min :: Ident -> Ident -> Ident #
Serialise Ident # |
Instance details Defined in Language.PureScript.Names Methods encode :: Ident -> Encoding # decode :: Decoder s Ident # encodeList :: [Ident] -> Encoding # decodeList :: Decoder s [Ident] #
type Rep Ident # |
Instance details Defined in Language.PureScript.Names type Rep Ident = D1 ('MetaData "Ident" "Language.PureScript.Names" "purescript-0.15.12-5l1zT9m1jq0GgrLEUvYibC" '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) :+: C1 ('MetaCons "InternalIdent" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 InternalIdentData))))

unusedIdent :: Text #

runIdent :: Ident -> Text #

showIdent :: Ident -> Text #

freshIdent :: MonadSupply m => Text -> m Ident #

freshIdent' :: MonadSupply m => m Ident #

isPlainIdent :: Ident -> Bool #

newtype OpName (a :: OpNameType) #

Operator alias names.

Constructors

OpName |
Fields runOpName :: Text

#### Instances

Instances details

FromJSON (OpName a) # |
Instance details Defined in Language.PureScript.Names Methods parseJSON :: Value -> Parser (OpName a) # parseJSONList :: Value -> Parser [OpName a] # omittedField :: Maybe (OpName a) #
ToJSON (OpName a) # |
Instance details Defined in Language.PureScript.Names Methods toJSON :: OpName a -> Value # toEncoding :: OpName a -> Encoding # toJSONList :: [OpName a] -> Value # toEncodingList :: [OpName a] -> Encoding # omitField :: OpName a -> Bool #
Generic (OpName a) # |
Instance details Defined in Language.PureScript.Names Associated Types type Rep (OpName a) :: Type -> Type # Methods from :: OpName a -> Rep (OpName a) x # to :: Rep (OpName a) x -> OpName a #
Show (OpName a) # |
Instance details Defined in Language.PureScript.Names Methods showsPrec :: Int -> OpName a -> ShowS # show :: OpName a -> String # showList :: [OpName a] -> ShowS #
NFData (OpName a) # |
Instance details Defined in Language.PureScript.Names Methods rnf :: OpName a -> () #
Eq (OpName a) # |
Instance details Defined in Language.PureScript.Names Methods (==) :: OpName a -> OpName a -> Bool # (/=) :: OpName a -> OpName a -> Bool #
Ord (OpName a) # |
Instance details Defined in Language.PureScript.Names Methods compare :: OpName a -> OpName a -> Ordering # (<) :: OpName a -> OpName a -> Bool # (<=) :: OpName a -> OpName a -> Bool # (>) :: OpName a -> OpName a -> Bool # (>=) :: OpName a -> OpName a -> Bool # max :: OpName a -> OpName a -> OpName a # min :: OpName a -> OpName a -> OpName a #
Serialise (OpName a) # |
Instance details Defined in Language.PureScript.Names Methods encode :: OpName a -> Encoding # decode :: Decoder s (OpName a) # encodeList :: [OpName a] -> Encoding # decodeList :: Decoder s [OpName a] #
type Rep (OpName a) # |
Instance details Defined in Language.PureScript.Names type Rep (OpName a) = D1 ('MetaData "OpName" "Language.PureScript.Names" "purescript-0.15.12-5l1zT9m1jq0GgrLEUvYibC" 'True) (C1 ('MetaCons "OpName" 'PrefixI 'True) (S1 ('MetaSel ('Just "runOpName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

showOp :: OpName a -> Text #

data OpNameType #

The closed set of operator alias types.

Constructors

ValueOpName |
TypeOpName |
AnyOpName |

eraseOpName :: OpName a -> OpName 'AnyOpName #

coerceOpName :: OpName a -> OpName b #

newtype ProperName (a :: ProperNameType) #

Proper names, i.e. capitalized names for e.g. module names, type//data constructors.

Constructors

ProperName |
Fields runProperName :: Text

#### Instances

Instances details

FromJSON (ProperName a) # |
Instance details Defined in Language.PureScript.Names Methods parseJSON :: Value -> Parser (ProperName a) # parseJSONList :: Value -> Parser [ProperName a] # omittedField :: Maybe (ProperName a) #
ToJSON (ProperName a) # |
Instance details Defined in Language.PureScript.Names Methods toJSON :: ProperName a -> Value # toEncoding :: ProperName a -> Encoding # toJSONList :: [ProperName a] -> Value # toEncodingList :: [ProperName a] -> Encoding # omitField :: ProperName a -> Bool #
Generic (ProperName a) # |
Instance details Defined in Language.PureScript.Names Associated Types type Rep (ProperName a) :: Type -> Type # Methods from :: ProperName a -> Rep (ProperName a) x # to :: Rep (ProperName a) x -> ProperName a #
Show (ProperName a) # |
Instance details Defined in Language.PureScript.Names Methods showsPrec :: Int -> ProperName a -> ShowS # show :: ProperName a -> String # showList :: [ProperName a] -> ShowS #
NFData (ProperName a) # |
Instance details Defined in Language.PureScript.Names Methods rnf :: ProperName a -> () #
Eq (ProperName a) # |
Instance details Defined in Language.PureScript.Names Methods (==) :: ProperName a -> ProperName a -> Bool # (/=) :: ProperName a -> ProperName a -> Bool #
Ord (ProperName a) # |
Instance details Defined in Language.PureScript.Names Methods compare :: ProperName a -> ProperName a -> Ordering # (<) :: ProperName a -> ProperName a -> Bool # (<=) :: ProperName a -> ProperName a -> Bool # (>) :: ProperName a -> ProperName a -> Bool # (>=) :: ProperName a -> ProperName a -> Bool # max :: ProperName a -> ProperName a -> ProperName a # min :: ProperName a -> ProperName a -> ProperName a #
Serialise (ProperName a) # |
Instance details Defined in Language.PureScript.Names Methods encode :: ProperName a -> Encoding # decode :: Decoder s (ProperName a) # encodeList :: [ProperName a] -> Encoding # decodeList :: Decoder s [ProperName a] #
type Rep (ProperName a) # |
Instance details Defined in Language.PureScript.Names type Rep (ProperName a) = D1 ('MetaData "ProperName" "Language.PureScript.Names" "purescript-0.15.12-5l1zT9m1jq0GgrLEUvYibC" 'True) (C1 ('MetaCons "ProperName" 'PrefixI 'True) (S1 ('MetaSel ('Just "runProperName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

data ProperNameType #

The closed set of proper name types.

Constructors

TypeName |
ConstructorName |
ClassName |
Namespace |

coerceProperName :: ProperName a -> ProperName b #

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 #

Module names

Constructors

ModuleName Text |

#### Instances

Instances details

FromJSON ModuleName # |
Instance details Defined in Language.PureScript.Names Methods parseJSON :: Value -> Parser ModuleName # parseJSONList :: Value -> Parser [ModuleName] # omittedField :: Maybe ModuleName #
FromJSONKey ModuleName # |
Instance details Defined in Language.PureScript.Names Methods fromJSONKey :: FromJSONKeyFunction ModuleName # fromJSONKeyList :: FromJSONKeyFunction [ModuleName] #
ToJSON ModuleName # |
Instance details Defined in Language.PureScript.Names Methods toJSON :: ModuleName -> Value # toEncoding :: ModuleName -> Encoding # toJSONList :: [ModuleName] -> Value # toEncodingList :: [ModuleName] -> Encoding # omitField :: ModuleName -> Bool #
ToJSONKey ModuleName # |
Instance details Defined in Language.PureScript.Names Methods toJSONKey :: ToJSONKeyFunction ModuleName # toJSONKeyList :: ToJSONKeyFunction [ModuleName] #
Generic ModuleName # |
Instance details Defined in Language.PureScript.Names Associated Types type Rep ModuleName :: Type -> Type # Methods from :: ModuleName -> Rep ModuleName x # to :: Rep ModuleName x -> ModuleName #
Show ModuleName # |
Instance details Defined in Language.PureScript.Names Methods showsPrec :: Int -> ModuleName -> ShowS # show :: ModuleName -> String # showList :: [ModuleName] -> ShowS #
NFData ModuleName # |
Instance details Defined in Language.PureScript.Names Methods rnf :: ModuleName -> () #
Eq ModuleName # |
Instance details Defined in Language.PureScript.Names Methods (==) :: ModuleName -> ModuleName -> Bool # (/=) :: ModuleName -> ModuleName -> Bool #
Ord ModuleName # |
Instance details Defined in Language.PureScript.Names Methods compare :: ModuleName -> ModuleName -> Ordering # (<) :: ModuleName -> ModuleName -> Bool # (<=) :: ModuleName -> ModuleName -> Bool # (>) :: ModuleName -> ModuleName -> Bool # (>=) :: ModuleName -> ModuleName -> Bool # max :: ModuleName -> ModuleName -> ModuleName # min :: ModuleName -> ModuleName -> ModuleName #
Serialise ModuleName # |
Instance details Defined in Language.PureScript.Names Methods encode :: ModuleName -> Encoding # decode :: Decoder s ModuleName # encodeList :: [ModuleName] -> Encoding # decodeList :: Decoder s [ModuleName] #
type Rep ModuleName # |
Instance details Defined in Language.PureScript.Names type Rep ModuleName = D1 ('MetaData "ModuleName" "Language.PureScript.Names" "purescript-0.15.12-5l1zT9m1jq0GgrLEUvYibC" 'True) (C1 ('MetaCons "ModuleName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

runModuleName :: ModuleName -> Text #

moduleNameFromString :: Text -> ModuleName #

isBuiltinModuleName :: ModuleName -> Bool #

data QualifiedBy #

Constructors

BySourcePos SourcePos |
ByModuleName ModuleName |

#### Instances

Instances details

Generic QualifiedBy # |
Instance details Defined in Language.PureScript.Names Associated Types type Rep QualifiedBy :: Type -> Type # Methods from :: QualifiedBy -> Rep QualifiedBy x # to :: Rep QualifiedBy x -> QualifiedBy #
Show QualifiedBy # |
Instance details Defined in Language.PureScript.Names Methods showsPrec :: Int -> QualifiedBy -> ShowS # show :: QualifiedBy -> String # showList :: [QualifiedBy] -> ShowS #
NFData QualifiedBy # |
Instance details Defined in Language.PureScript.Names Methods rnf :: QualifiedBy -> () #
Eq QualifiedBy # |
Instance details Defined in Language.PureScript.Names Methods (==) :: QualifiedBy -> QualifiedBy -> Bool # (/=) :: QualifiedBy -> QualifiedBy -> Bool #
Ord QualifiedBy # |
Instance details Defined in Language.PureScript.Names Methods compare :: QualifiedBy -> QualifiedBy -> Ordering # (<) :: QualifiedBy -> QualifiedBy -> Bool # (<=) :: QualifiedBy -> QualifiedBy -> Bool # (>) :: QualifiedBy -> QualifiedBy -> Bool # (>=) :: QualifiedBy -> QualifiedBy -> Bool # max :: QualifiedBy -> QualifiedBy -> QualifiedBy # min :: QualifiedBy -> QualifiedBy -> QualifiedBy #
Serialise QualifiedBy # |
Instance details Defined in Language.PureScript.Names Methods encode :: QualifiedBy -> Encoding # decode :: Decoder s QualifiedBy # encodeList :: [QualifiedBy] -> Encoding # decodeList :: Decoder s [QualifiedBy] #
type Rep QualifiedBy # |
Instance details Defined in Language.PureScript.Names type Rep QualifiedBy = D1 ('MetaData "QualifiedBy" "Language.PureScript.Names" "purescript-0.15.12-5l1zT9m1jq0GgrLEUvYibC" 'False) (C1 ('MetaCons "BySourcePos" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SourcePos)) :+: C1 ('MetaCons "ByModuleName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ModuleName)))

pattern ByNullSourcePos :: QualifiedBy #

isBySourcePos :: QualifiedBy -> Bool #

byMaybeModuleName :: Maybe ModuleName -> QualifiedBy #

toMaybeModuleName :: QualifiedBy -> Maybe ModuleName #

data Qualified a #

A qualified name, i.e. a name with an optional module name

Constructors

Qualified QualifiedBy a |

#### Instances

Instances details

Foldable Qualified # |
Instance details Defined in Language.PureScript.Names Methods fold :: Monoid m => Qualified m -> m # foldMap :: Monoid m => (a -> m) -> Qualified a -> m # foldMap' :: Monoid m => (a -> m) -> Qualified a -> m foldr :: (a -> b -> b) -> b -> Qualified a -> b # foldr' :: (a -> b -> b) -> b -> Qualified a -> b # foldl :: (b -> a -> b) -> b -> Qualified a -> b # foldl' :: (b -> a -> b) -> b -> Qualified a -> b # foldr1 :: (a -> a -> a) -> Qualified a -> a # foldl1 :: (a -> a -> a) -> Qualified a -> a # toList :: Qualified a -> [a] # null :: Qualified a -> Bool # length :: Qualified a -> Int # elem :: Eq a => a -> Qualified a -> Bool # maximum :: Ord a => Qualified a -> a # minimum :: Ord a => Qualified a -> a # sum :: Num a => Qualified a -> a # product :: Num a => Qualified a -> a #
Traversable Qualified # |
Instance details Defined in Language.PureScript.Names Methods traverse :: Applicative f => (a -> f b) -> Qualified a -> f (Qualified b) # sequenceA :: Applicative f => Qualified (f a) -> f (Qualified a) mapM :: Monad m => (a -> m b) -> Qualified a -> m (Qualified b) sequence :: Monad m => Qualified (m a) -> m (Qualified a)
Functor Qualified # |
Instance details Defined in Language.PureScript.Names Methods fmap :: (a -> b) -> Qualified a -> Qualified b # (<$) :: a -> Qualified b -> Qualified a #
FromJSON a => FromJSON (Qualified a) # |
Instance details Defined in Language.PureScript.Names Methods parseJSON :: Value -> Parser (Qualified a) # parseJSONList :: Value -> Parser [Qualified a] # omittedField :: Maybe (Qualified a) #
ToJSON a => ToJSON (Qualified a) # |
Instance details Defined in Language.PureScript.Names Methods toJSON :: Qualified a -> Value # toEncoding :: Qualified a -> Encoding # toJSONList :: [Qualified a] -> Value # toEncodingList :: [Qualified a] -> Encoding # omitField :: Qualified a -> Bool #
Generic (Qualified a) # |
Instance details Defined in Language.PureScript.Names Associated Types type Rep (Qualified a) :: Type -> Type # Methods from :: Qualified a -> Rep (Qualified a) x # to :: Rep (Qualified a) x -> Qualified a #
Show a => Show (Qualified a) # |
Instance details Defined in Language.PureScript.Names Methods showsPrec :: Int -> Qualified a -> ShowS # show :: Qualified a -> String # showList :: [Qualified a] -> ShowS #
NFData a => NFData (Qualified a) # |
Instance details Defined in Language.PureScript.Names Methods rnf :: Qualified a -> () #
Eq a => Eq (Qualified a) # |
Instance details Defined in Language.PureScript.Names Methods (==) :: Qualified a -> Qualified a -> Bool # (/=) :: Qualified a -> Qualified a -> Bool #
Ord a => Ord (Qualified a) # |
Instance details Defined in Language.PureScript.Names Methods compare :: Qualified a -> Qualified a -> Ordering # (<) :: Qualified a -> Qualified a -> Bool # (<=) :: Qualified a -> Qualified a -> Bool # (>) :: Qualified a -> Qualified a -> Bool # (>=) :: Qualified a -> Qualified a -> Bool # max :: Qualified a -> Qualified a -> Qualified a # min :: Qualified a -> Qualified a -> Qualified a #
Serialise a => Serialise (Qualified a) # |
Instance details Defined in Language.PureScript.Names Methods encode :: Qualified a -> Encoding # decode :: Decoder s (Qualified a) # encodeList :: [Qualified a] -> Encoding # decodeList :: Decoder s [Qualified a] #
type Rep (Qualified a) # |
Instance details Defined in Language.PureScript.Names type Rep (Qualified a) = D1 ('MetaData "Qualified" "Language.PureScript.Names" "purescript-0.15.12-5l1zT9m1jq0GgrLEUvYibC" 'False) (C1 ('MetaCons "Qualified" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 QualifiedBy) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))

showQualified :: (a -> Text) -> Qualified a -> Text #

getQual :: Qualified a -> Maybe ModuleName #

qualify :: ModuleName -> Qualified a -> (ModuleName, a) #

Provide a default module name, if a name is unqualified

mkQualified :: a -> ModuleName -> Qualified a #

Makes a qualified value from a name and module name.

disqualify :: Qualified a -> a #

Remove the module name from a qualified name

disqualifyFor :: Maybe ModuleName -> Qualified a -> Maybe a #

Remove the qualification from a value when it is qualified with a particular module name.

isQualified :: Qualified a -> Bool #

Checks whether a qualified value is actually qualified with a module reference

isUnqualified :: Qualified a -> Bool #

Checks whether a qualified value is not actually qualified with a module reference

isQualifiedWith :: ModuleName -> Qualified a -> Bool #

Checks whether a qualified value is qualified with a particular module