purescript-0.12.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 # 

Methods

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

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

Ord Name Source # 

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 # 

Methods

showsPrec :: Int -> Name -> ShowS #

show :: Name -> String #

showList :: [Name] -> ShowS #

Generic Name Source # 

Associated Types

type Rep Name :: * -> * #

Methods

from :: Name -> Rep Name x #

to :: Rep Name x -> Name #

NFData Name Source # 

Methods

rnf :: Name -> () #

type Rep Name Source # 

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 # 

Methods

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

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

Ord Ident Source # 

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 # 

Methods

showsPrec :: Int -> Ident -> ShowS #

show :: Ident -> String #

showList :: [Ident] -> ShowS #

Generic Ident Source # 

Associated Types

type Rep Ident :: * -> * #

Methods

from :: Ident -> Rep Ident x #

to :: Rep Ident x -> Ident #

ToJSON Ident Source # 
FromJSON Ident Source # 
NFData Ident Source # 

Methods

rnf :: Ident -> () #

type Rep Ident Source # 

newtype OpName (a :: OpNameType) Source #

Operator alias names.

Constructors

OpName 

Fields

Instances

Eq (OpName a) Source # 

Methods

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

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

Ord (OpName a) Source # 

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 # 

Methods

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

show :: OpName a -> String #

showList :: [OpName a] -> ShowS #

Generic (OpName a) Source # 

Associated Types

type Rep (OpName a) :: * -> * #

Methods

from :: OpName a -> Rep (OpName a) x #

to :: Rep (OpName a) x -> OpName a #

ToJSON (OpName a) Source # 
FromJSON (OpName a) Source # 
NFData (OpName a) Source # 

Methods

rnf :: OpName a -> () #

type Rep (OpName a) Source # 
type Rep (OpName a) = D1 * (MetaData "OpName" "Language.PureScript.Names" "purescript-0.12.0-GnFPE64AyqYHZk4VD04uBy" True) (C1 * (MetaCons "OpName" PrefixI True) (S1 * (MetaSel (Just Symbol "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 # 

Methods

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

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

Ord (ProperName a) Source # 
Show (ProperName a) Source # 
Generic (ProperName a) Source # 

Associated Types

type Rep (ProperName a) :: * -> * #

Methods

from :: ProperName a -> Rep (ProperName a) x #

to :: Rep (ProperName a) x -> ProperName a #

ToJSON (ProperName a) Source # 
FromJSON (ProperName a) Source # 
NFData (ProperName a) Source # 

Methods

rnf :: ProperName a -> () #

type Rep (ProperName a) Source # 
type Rep (ProperName a) = D1 * (MetaData "ProperName" "Language.PureScript.Names" "purescript-0.12.0-GnFPE64AyqYHZk4VD04uBy" True) (C1 * (MetaCons "ProperName" PrefixI True) (S1 * (MetaSel (Just Symbol "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

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 # 

Methods

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

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

Foldable Qualified Source # 

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 # 

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 # 

Methods

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

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

Ord a => Ord (Qualified a) Source # 
Show a => Show (Qualified a) Source # 
Generic (Qualified a) Source # 

Associated Types

type Rep (Qualified a) :: * -> * #

Methods

from :: Qualified a -> Rep (Qualified a) x #

to :: Rep (Qualified a) x -> Qualified a #

ToJSON a => ToJSON (Qualified a) Source # 
FromJSON a => FromJSON (Qualified a) Source # 
NFData a => NFData (Qualified a) Source # 

Methods

rnf :: Qualified a -> () #

type Rep (Qualified a) Source # 
type Rep (Qualified a) = D1 * (MetaData "Qualified" "Language.PureScript.Names" "purescript-0.12.0-GnFPE64AyqYHZk4VD04uBy" False) (C1 * (MetaCons "Qualified" PrefixI False) ((:*:) * (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Maybe ModuleName))) (S1 * (MetaSel (Nothing 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