[Compose] 13. Lift into a Pointed Functor with of

发布时间:2017-1-21 21:19:35 编辑:www.fx114.net 分享查询网我要评论
本篇文章主要介绍了"[Compose] 13. Lift into a Pointed Functor with of ",主要涉及到[Compose] 13. Lift into a Pointed Functor with of 方面的内容,对于[Compose] 13. Lift into a Pointed Functor with of 感兴趣的同学可以参考一下。

We examine the of function we've seen on a few types and discover it's the Pointed interface.

Instead of doing constructor way of Task:

const useTask= (x) => 
  new Task((rej,  res) => res(x))

We can just say:

Task.of("something"); //Task("something")
Either.of("something"); // Either("something");
Box.of(100); // Box(100)

上一篇:线程中的定时器Timer类
下一篇:Adaboost提升算法从原理到实践

相关文章

相关评论