flix

0.75.0

Coerce

trait Coerce[t: Type]Source

A trait for type that can be coerced.

Currently only supports newtype-style wrappers.

Associated Types

type Aef: EffSource

The associated effect of the Coerce instance.

The effect describes the effect of coercing a value of type t. It is pure (i.e. {}) for the common case of newtype-style wrappers.

type Out: TypeSource

The return type of the coerce function.

Instances

instance Coerce[Down[a]]Source
instance Coerce[SourcePosition]Source
instance Coerce[SourceLocation]Source

Signatures

def coerce(x: t): Out[t] \ Aef[t] with Coerce[t] Source

Returns the unwrapped value of x.