swarm-0.7.0.0: 2D resource gathering game with programmable robots
LicenseBSD-3-Clause
Safe HaskellNone
LanguageHaskell2010

Swarm.Language.TDVar

Description

Type definition variables.

Synopsis

Documentation

data TDVar Source #

The name of a user-defined type is represented by a textual name as well as a version number which we can use to differentiate between names which are otherwise the same, when one shadows the other.

See Note [Shadowing for value-level and type-level variables]

Constructors

TDVar 

Instances

Instances details
FromJSON TDVar Source # 
Instance details

Defined in Swarm.Language.TDVar

FromJSONKey TDVar Source # 
Instance details

Defined in Swarm.Language.TDVar

ToJSON TDVar Source # 
Instance details

Defined in Swarm.Language.TDVar

ToJSONKey TDVar Source # 
Instance details

Defined in Swarm.Language.TDVar

Data TDVar Source # 
Instance details

Defined in Swarm.Language.TDVar

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TDVar -> c TDVar #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TDVar #

toConstr :: TDVar -> Constr #

dataTypeOf :: TDVar -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TDVar) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TDVar) #

gmapT :: (forall b. Data b => b -> b) -> TDVar -> TDVar #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TDVar -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TDVar -> r #

gmapQ :: (forall d. Data d => d -> u) -> TDVar -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> TDVar -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> TDVar -> m TDVar #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TDVar -> m TDVar #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TDVar -> m TDVar #

IsString TDVar Source # 
Instance details

Defined in Swarm.Language.TDVar

Methods

fromString :: String -> TDVar #

Generic TDVar Source # 
Instance details

Defined in Swarm.Language.TDVar

Associated Types

type Rep TDVar 
Instance details

Defined in Swarm.Language.TDVar

type Rep TDVar = D1 ('MetaData "TDVar" "Swarm.Language.TDVar" "swarm-0.7.0.0-IuFfgHrMoE7JrptOBRVOwx-swarm-lang" 'False) (C1 ('MetaCons "TDVar" 'PrefixI 'True) (S1 ('MetaSel ('Just "tdVarName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "tdVarVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))

Methods

from :: TDVar -> Rep TDVar x #

to :: Rep TDVar x -> TDVar #

Show TDVar Source # 
Instance details

Defined in Swarm.Language.TDVar

Methods

showsPrec :: Int -> TDVar -> ShowS #

show :: TDVar -> String #

showList :: [TDVar] -> ShowS #

Eq TDVar Source # 
Instance details

Defined in Swarm.Language.TDVar

Methods

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

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

Ord TDVar Source # 
Instance details

Defined in Swarm.Language.TDVar

Methods

compare :: TDVar -> TDVar -> Ordering #

(<) :: TDVar -> TDVar -> Bool #

(<=) :: TDVar -> TDVar -> Bool #

(>) :: TDVar -> TDVar -> Bool #

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

max :: TDVar -> TDVar -> TDVar #

min :: TDVar -> TDVar -> TDVar #

Hashable TDVar Source # 
Instance details

Defined in Swarm.Language.TDVar

Methods

hashWithSalt :: Int -> TDVar -> Int #

hash :: TDVar -> Int #

PrettyPrec TDVar Source #

The PrettyPrec instance for TDVar never prints the version number. If you care about the version number possibly being printed, you must use prettyTDVar instead.

Instance details

Defined in Swarm.Language.TDVar

Methods

prettyPrec :: Int -> TDVar -> Doc ann

type Rep TDVar Source # 
Instance details

Defined in Swarm.Language.TDVar

type Rep TDVar = D1 ('MetaData "TDVar" "Swarm.Language.TDVar" "swarm-0.7.0.0-IuFfgHrMoE7JrptOBRVOwx-swarm-lang" 'False) (C1 ('MetaCons "TDVar" 'PrefixI 'True) (S1 ('MetaSel ('Just "tdVarName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "tdVarVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))

mkTDVar :: Text -> TDVar Source #

Create a type definition variable with the given name and a default version of 0.

mkTDVar' :: Int -> Text -> TDVar Source #

Create a type definition variable with a given version number and name.

prettyTDVar :: Int -> TDVar -> Doc ann Source #

Pretty-print a type definition variable, given an extra argument representing the latest version of any variable with this name. If this variable is the latest version, just print its name. If it is not the latest version, print name%version.