swarm-0.6.0.0: 2D resource gathering game with programmable robots
LicenseBSD-3-Clause
Safe HaskellSafe-Inferred
LanguageHaskell2010

Swarm.Language.Elaborate

Description

Term elaboration which happens after type checking.

Synopsis

Documentation

elaborate :: TSyntax -> TSyntax Source #

Perform some elaboration / rewriting on a fully type-annotated term. This currently performs such operations as rewriting if expressions and recursive let expressions to use laziness appropriately. It also inserts types and requirements on bound variables so they will be available at runtime.

In theory it could also perform rewriting for overloaded constants depending on the actual type they are used at, but currently that sort of thing tends to make type inference fall over.

insertSuspend :: Term -> Term Source #

Insert a special suspend primitive at the very end of an erased term which must have a command type.