Open distums opened 6 years ago
u.map(a => a
u
u.map(x => f(g(x)))
u.map(g).map(f)
map method
map :: Functor f => f a ~> (a -> b) -> f b
A value which has a Functor must provide a map method. The map method takes one argument:
Functor
map
u.map(f)
Functor是一个容器,对于Functor,非常重要的一点是弄清它所包装的值
definition from fantasy-land
u.map(a => a
) is equivalent tou
(identity)u.map(x => f(g(x)))
is equivalent tou.map(g).map(f)
(composition)map method
A value which has a
Functor
must provide amap
method. Themap
method takes one argument: