Home

termlevel

Term level, often referred to as the value level, denotes the portion of a programming language where ordinary expressions are evaluated to concrete runtime values. This is in contrast to the type level, where computations concern types, kinds, and compile-time guarantees rather than values.

Term-level constructs include variables, function applications, literals, and control flow. Type-level constructs include types, type constructors,

Examples of the relationship between levels appear in languages with dependent types and rich type systems.

Design notes: separating term and type levels can improve safety and enable optimizations, but may add complexity

See also: dependent types, type-level programming, value level, singleton type, macros.

and
type-level
functions.
In
many
languages
with
advanced
type
systems,
the
two
levels
interact:
programs
written
at
the
term
level
can
influence
types
through
dependent
types,
while
some
type-level
features
can
affect
term-level
behavior
via
reflection,
reification,
or
singleton
representations.
In
Haskell,
data
kinds
and
GADTs
create
a
bridge
between
term-level
and
type-level
reasoning,
and
libraries
that
implement
singletons
provide
values
reflecting
type-level
information.
In
languages
like
TypeScript
or
Scala,
type-level
programming
operates
on
types
at
compile
time
and
is
distinct
from
the
runtime
term
level,
yet
you
can
connect
the
two
through
generic
programming
and
type
inference.
In
explicitly
dependently-typed
languages
such
as
Idris
or
Coq,
types
can
depend
on
values,
making
the
line
between
term
and
type
levels
more
fluid.
and
hinder
rapid
iteration.
When
needed,
developers
use
bridges
such
as
singleton
types,
type
witnesses,
or
macro
systems
to
connect
level-specific
code.