A type F
is a Functor if it provides a function fmap
which, given any types A
and B
lets you apply any function from ~A => B~ to turn an F[A]
into an F[B]
, preserving the
structure of F
. Furthermore F
needs to adhere to the following:
Identity
fa <#> identity == identity(fa)
Composition
(f compose g) `<$>` fa == (map[F](f) compose map[F](g))(fa)
- Companion
- object
class Object
trait Matchable
class Any
Value members
Abstract methods
Extensions
Extensions
extension (fa: F[A])
@targetName("voidLeft")
Drop whatever value A
on left and return F[B]
on the right
Drop whatever value A
on left and return F[B]
on the right
- Example
Option(1) `$>` 3 == Option(3)