Home

pertype

Pertype is a term used in discussions of type systems to denote data types that carry per-instance metadata governing allowed operations. The concept aims to express fine-grained capabilities alongside data values, enabling policy enforcement at either compile time or runtime. The term is not canonical and appears in various design notes and speculative proposals rather than in standardized language specifications.

Definition and structure

A pertype consists of a base type T and a per-element policy P that maps each value

Examples

File handle pertype: a file handle value includes metadata specifying read or write permissions, constraining which

Variants and design choices

Policies can be static (checked at compile time) or dynamic (checked at runtime). Policies may be monotonic

Relation to other concepts

Pertypes relate to capability-based security, effect systems, and dependent types. They differ by attaching operational permissions

Implementation notes

In programming languages, pertypes can be realized through dependent types, phantom types, or capability-safe abstractions. Enforcement

Notes

The term remains a proposal concept rather than a widely adopted standard. Its utility lies in modeling

of
T
to
a
set
of
permissions.
Operations
on
a
pertype
value
consult
P
to
determine
legality;
performing
an
unsupported
operation
may
result
in
a
type
error
or
runtime
fault.
Some
formulations
keep
the
policy
separate
from
the
data
value
by
using
a
capability
object
that
carries
permissions
alongside
the
value.
operations
can
be
performed.
Cloud
resource
handle:
a
handle
includes
region,
project,
and
role
information
that
gates
actions
such
as
modification
or
deletion.
(permissions
can
only
increase
or
stay
the
same)
or
can
adapt
based
on
context.
Some
approaches
use
dependent
or
refinement
types
to
encode
policy
directly
in
the
type.
to
individual
values
rather
than
solely
to
types,
enabling
fine-grained
control
within
a
program’s
data
flow.
can
occur
via
compiler
checks,
runtime
checks,
or
a
combination
of
both.
per-value
permissions
and
supporting
modular,
secure
composition
of
components.
See
also:
type
system,
capability-based
security,
dependent
types.