Functor

trait Functor[m: Type -> Type]Source

A trait for types that can be mapped over.

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.