purescript-0.13.0: PureScript Programming Language Compiler

Safe HaskellNone
LanguageHaskell2010

Language.PureScript.Names

Description

Data types for names

Synopsis

Documentation

data Name Source #

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

Instances
Eq Name Source # 
Instance details

Defined in Language.PureScript.Names

Methods

(==) :: Name -> Name -> Bool #

(/=) :: Name -> Name -> Bool #

Ord Name Source # 
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 #

Show Name Source # 
Instance details

Defined in Language.PureScript.Names

Methods

showsPrec :: Int -> Name -> ShowS #

show :: Name -> String #

showList :: [Name] -> ShowS #

Generic Name Source # 
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 #

NFData Name Source # 
Instance details

Defined in Language.PureScript.Names

Methods

rnf :: Name -> () #

type Rep Name Source # 
Instance details

Defined in Language.PureScript.Names

data Ident Source #

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

Instances
Eq Ident Source # 
Instance details

Defined in Language.PureScript.Names

Methods

(==) :: Ident -> Ident -> Bool #

(/=) :: Ident -> Ident -> Bool #

Ord Ident Source # 
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 #

Show Ident Source # 
Instance details

Defined in Language.PureScript.Names

Methods

showsPrec :: Int -> Ident -> ShowS #

show :: Ident -> String #

showList :: [Ident] -> ShowS #

Generic Ident Source # 
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 #

NFData Ident Source # 
Instance details

Defined in Language.PureScript.Names

Methods

rnf :: Ident -> () #

ToJSON Ident Source # 
Instance details

Defined in Language.PureScript.Names

FromJSON Ident Source # 
Instance details

Defined in Language.PureScript.Names

type Rep Ident Source # 
Instance details

Defined in Language.PureScript.Names

newtype OpName (a :: OpNameType) Source #

Operator alias names.

Constructors

OpName 

Fields

Instances
Eq (OpName a) Source # 
Instance details

Defined in Language.PureScript.Names

Methods

(==) :: OpName a -> OpName a -> Bool #

(/=) :: OpName a -> OpName a -> Bool #

Ord (OpName a) Source # 
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 #

Show (OpName a) Source # 
Instance details

Defined in Language.PureScript.Names

Methods

showsPrec :: Int -> OpName a -> ShowS #

show :: OpName a -> String #

showList :: [OpName a] -> ShowS #

Generic (OpName a) Source # 
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 #

NFData (OpName a) Source # 
Instance details

Defined in Language.PureScript.Names

Methods

rnf :: OpName a -> () #

ToJSON (OpName a) Source # 
Instance details

Defined in Language.PureScript.Names

FromJSON (OpName a) Source # 
Instance details

Defined in Language.PureScript.Names

type Rep (OpName a) Source # 
Instance details

Defined in Language.PureScript.Names

type Rep (OpName a) = D1 (MetaData "OpName" "Language.PureScript.Names" "purescript-0.13.0-1whdl2565Nb1wvlLK7uK18" True) (C1 (MetaCons "OpName" PrefixI True) (S1 (MetaSel (Just "runOpName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)))

data OpNameType Source #

The closed set of operator alias types.

newtype ProperName (a :: ProperNameType) Source #

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

Constructors

ProperName 

Fields

Instances
Eq (ProperName a) Source # 
Instance details

Defined in Language.PureScript.Names

Methods

(==) :: ProperName a -> ProperName a -> Bool #

(/=) :: ProperName a -> ProperName a -> Bool #

Ord (ProperName a) Source # 
Instance details

Defined in Language.PureScript.Names

Show (ProperName a) Source # 
Instance details

Defined in Language.PureScript.Names

Generic (ProperName a) Source # 
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 #

NFData (ProperName a) Source # 
Instance details

Defined in Language.PureScript.Names

Methods

rnf :: ProperName a -> () #

ToJSON (ProperName a) Source # 
Instance details

Defined in Language.PureScript.Names

FromJSON (ProperName a) Source # 
Instance details

Defined in Language.PureScript.Names

type Rep (ProperName a) Source # 
Instance details

Defined in Language.PureScript.Names

type Rep (ProperName a) = D1 (MetaData "ProperName" "Language.PureScript.Names" "purescript-0.13.0-1whdl2565Nb1wvlLK7uK18" True) (C1 (MetaCons "ProperName" PrefixI True) (S1 (MetaSel (Just "runProperName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)))

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
Eq ModuleName Source # 
Instance details

Defined in Language.PureScript.Names

Ord ModuleName Source # 
Instance details

Defined in Language.PureScript.Names

Show ModuleName Source # 
Instance details

Defined in Language.PureScript.Names

Generic ModuleName Source # 
Instance details

Defined in Language.PureScript.Names

Associated Types

type Rep ModuleName :: Type -> Type #

NFData ModuleName Source # 
Instance details

Defined in Language.PureScript.Names

Methods

rnf :: ModuleName -> () #

ToJSON ModuleName Source # 
Instance details

Defined in Language.PureScript.Names

FromJSON ModuleName Source # 
Instance details

Defined in Language.PureScript.Names

type Rep ModuleName Source # 
Instance details

Defined in Language.PureScript.Names

type Rep ModuleName = D1 (MetaData "ModuleName" "Language.PureScript.Names" "purescript-0.13.0-1whdl2565Nb1wvlLK7uK18" True) (C1 (MetaCons "ModuleName" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [ProperName Namespace])))

data Qualified a Source #

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

Constructors

Qualified (Maybe ModuleName) a 
Instances
Functor Qualified Source # 
Instance details

Defined in Language.PureScript.Names

Methods

fmap :: (a -> b) -> Qualified a -> Qualified b #

(<$) :: a -> Qualified b -> Qualified a #

Foldable Qualified Source # 
Instance details

Defined in Language.PureScript.Names

Methods

fold :: Monoid m => Qualified m -> 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 Source # 
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) #

Eq a => Eq (Qualified a) Source # 
Instance details

Defined in Language.PureScript.Names

Methods

(==) :: Qualified a -> Qualified a -> Bool #

(/=) :: Qualified a -> Qualified a -> Bool #

Ord a => Ord (Qualified a) Source # 
Instance details

Defined in Language.PureScript.Names

Show a => Show (Qualified a) Source # 
Instance details

Defined in Language.PureScript.Names

Generic (Qualified a) Source # 
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 #

NFData a => NFData (Qualified a) Source # 
Instance details

Defined in Language.PureScript.Names

Methods

rnf :: Qualified a -> () #

ToJSON a => ToJSON (Qualified a) Source # 
Instance details

Defined in Language.PureScript.Names

FromJSON a => FromJSON (Qualified a) Source # 
Instance details

Defined in Language.PureScript.Names

type Rep (Qualified a) Source # 
Instance details

Defined in Language.PureScript.Names

type Rep (Qualified a) = D1 (MetaData "Qualified" "Language.PureScript.Names" "purescript-0.13.0-1whdl2565Nb1wvlLK7uK18" False) (C1 (MetaCons "Qualified" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe ModuleName)) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))

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