# Functor, Monad, Applicative in Swift

Some Implementation in Swift.

### Functor

Let $C$ be a constructor which takes a variable as parameter.

$C$ is a Functor if $C$ has the following ability.

For example, we can write such a function functor or map.

And we can chain functors like this.

We can also do it like Haskell

### Monad

$C$ is a Monad if $C$ has the following ability. This is also called as flatmap.

Haskell-like version.

### Applicative

$C$ is a Applicative if $C$ has the following ability.

Haskell-like version.