flix

0.55.0

Functor

trait Functor[m: Type -> Type]Source

A trait for types that can be mapped over.

Instances

instance Functor[Chain]Source
instance Functor[DelayList]Source
instance Functor[DelayMap[k]]Source
instance Functor[Identity]Source
instance Functor[List]Source
instance Functor[Map[k]]Source
instance Functor[Nec]Source
instance Functor[Nel]Source
instance Functor[Option]Source
instance Functor[RedBlackTree[k]]Source
instance Functor[Result[e]]Source
instance Functor[Validation[e]]Source
instance Functor[Vector]Source

Signatures

def map(f: a -> b \ ef, x: m[a]): m[b] \ ef with Functor[m] Source

Applies the function f to x preserving its structure.

Module Definitions

def $>(ma: f[a], x: b): f[b] with Functor[f] Source

$> is an operator alias for replace.

def <$(x: a, ma: f[b]): f[a] with Functor[f] Source

<$ is the operator $> with its arguments flipped.

def <$$>(x: m[a], f: a -> b \ ef): m[b] \ ef with Functor[m] Source

<$$> is the operator <$> with its arguments flipped.

def <$>(f: a -> b \ ef, x: m[a]): m[b] \ ef with Functor[m] Source

<$> is an operator alias for map.

def ignore(s: m[a]): m[Unit] with Functor[m] Source

Replaces the value a in s with Unit preserving the structure of s.

This function is typically used to discard the return value of computing s.

def replace(s: m[a], x: b): m[b] with Functor[m] Source

Replaces the value a in s by the given value x preserving the structure of s.