purescript-0.11.7: 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

newtype OpName a 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 #

FromJSON (OpName a) Source # 
ToJSON (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.11.7-LYkkdaNPe76o3Ss2KvZX" 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.

Constructors

ValueOpName 
TypeOpName 

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 # 

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 #

FromJSON (ProperName a) Source # 
ToJSON (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.11.7-LYkkdaNPe76o3Ss2KvZX" 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 #

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 #

FromJSON a0 => FromJSON (Qualified a0) Source # 
ToJSON a0 => ToJSON (Qualified a0) 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.11.7-LYkkdaNPe76o3Ss2KvZX" 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