const Functor = x => ({
map: f => Functor(f(x)),
fold: f => f(x)
})
const app = (n) =>
Functor(n)
.map(n => n * 2)
.map(n => n + 1)
app(10)
.fold(console.log) //21