flix

0.78.0

Coerce

trait Coerce[t: Type]Source

Trait for types that can be coerced.

Currently only supports newtype-style wrappers.

Associated Types

type Aef: Eff = {}Source

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
type Out = a
instance Coerce[SourceLocation]Source
type Out = (String, SourcePosition, SourcePosition)
instance Coerce[SourcePosition]Source
type Out = (Int32, Int32)

Signatures

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

Returns the unwrapped value of x.