Fuzion Logo
fuzion-lang.dev — The Fuzion Language Portal
»

identity

identity

(T 
type
)
 => 
Unary T T
[Contains abstract features]
identity -- feature returing the unary identity function

When called, this feature returns a unary function that implements the
identity for the given type.

In most cases, you can use `id` instead and rely on partial application to
create a Function instance, e.g. you can use any of these to produce the same
result

all_true(s Sequence bool) => s ∀ id
all_true(s Sequence bool) => s ∀ (x -> id bool x)
all_true(s Sequence bool) => s ∀ (x -> id x)
all_true(s Sequence bool) => s ∀ (identity bool)

or, using an intermediate field,

all_true(s Sequence bool) => { f (bool)->bool := id; s ∀ f }
all_true(s Sequence bool) => { f (bool)->bool := (x -> id bool x); s ∀ f }
all_true(s Sequence bool) => { f (bool)->bool := (x -> id x); s ∀ f }
all_true(s Sequence bool) => { f (bool)->bool := identity bool; s ∀ f }

Type Parameters

0.094dev (2025-06-18 15:08:51 GIT hash 89cffc23ae669b0898a5564fefbf793fcb8e5ca7 built by fridi@fzen)