Home

multityped

Multityped is an adjective used to describe something that involves or can hold more than one data type. In computing, it often refers to values, expressions, or interfaces that are not restricted to a single type but may represent data of several types.

In programming language theory, multityped values are typically realized through sum types, union types, discriminated unions,

Examples include TypeScript's union types (for example, string | number) and language features such as Haskell's algebraic

In data interchange and storage, multityped data may appear when a field can hold several kinds of

See also: union type, discriminated union, variant, sum type, dynamic typing.

or
variant
records.
These
constructs
allow
a
single
variable,
field,
or
expression
to
take
on
values
of
different
types,
with
runtime
checks
or
compile-time
guards
to
determine
which
type
is
in
use.
They
enable
flexible
interfaces
but
can
introduce
complexity
for
type
checking
and
error
handling.
data
types
or
Rust's
enums,
which
encode
multiple
possible
shapes
or
variants
under
one
type.
Using
multityped
values
usually
requires
explicit
type
discrimination
to
ensure
correct
operations.
values,
such
as
JSON
values
that
may
be
string,
number,
boolean,
object,
array,
or
null,
or
in
databases
that
store
variant
data.
Some
schemas
or
languages
provide
dedicated
mechanisms
to
model
such
variability,
avoiding
unsafe
type
casts.