随笔分类 -  Compose

摘要:Learning notes. Video. Less than: If you use 'ramda', you maybe know 'lt, gt'.. Is '2' less than '1' , the result is false. We can see that the data i 阅读全文
posted @ 2019-04-27 16:25 Zhentiw 阅读(253) 评论(0) 推荐(0) 编辑
只有注册用户登录后才能阅读该文。
posted @ 2019-04-25 02:06 Zhentiw 阅读(1) 评论(0) 推荐(0) 编辑
摘要:Let's say we want to write a most simple implementation 'avg' function: Basiclly, the 'avg' function doing two things: Calculate sum Divide sum / leng 阅读全文
posted @ 2019-04-22 21:49 Zhentiw 阅读(253) 评论(0) 推荐(0) 编辑
摘要:For example, in React application, we have initial state; We have a toggle button, which everytime, it is toggle 'ui.filterGroups.status' to true/fals 阅读全文
posted @ 2019-04-18 19:53 Zhentiw 阅读(153) 评论(0) 推荐(0) 编辑
摘要:For example we have a component, it needs to call 'react-redux' connect function. For the hightlighted part, there can be many possible reason for it 阅读全文
posted @ 2019-04-17 23:53 Zhentiw 阅读(377) 评论(0) 推荐(0) 编辑
只有注册用户登录后才能阅读该文。
posted @ 2019-04-16 02:40 Zhentiw 阅读(1) 评论(0) 推荐(0) 编辑
只有注册用户登录后才能阅读该文。
posted @ 2019-04-14 03:45 Zhentiw 阅读(3) 评论(0) 推荐(0) 编辑
只有注册用户登录后才能阅读该文。
posted @ 2019-04-12 03:14 Zhentiw 阅读(3) 评论(0) 推荐(0) 编辑
只有注册用户登录后才能阅读该文。
posted @ 2019-04-08 01:49 Zhentiw 阅读(7) 评论(0) 推荐(0) 编辑
摘要:Imaging we have a deck of cards, eveytimes we need to pick one card from deck, the result we want to have is: For selected, each time we want only one 阅读全文
posted @ 2019-03-27 19:17 Zhentiw 阅读(187) 评论(0) 推荐(0) 编辑
摘要:Using Naive JS: The main problem is inside 'rando' function, not really a FP way doing stuff. Arrow approach: It becomes complex with we need to do Pa 阅读全文
posted @ 2019-03-26 17:15 Zhentiw 阅读(246) 评论(0) 推荐(0) 编辑
摘要:Recently, I am learning Working with ADT. Got some extra thought about State Monad. Basiclly how to thinking in State. First, we need to know the type 阅读全文
posted @ 2019-03-25 19:06 Zhentiw 阅读(260) 评论(0) 推荐(0) 编辑
摘要:In previous post, Arrow Functor with contramap, we have seen how to opreating on params before we invoke the function by using Arrow + contramap. It h 阅读全文
posted @ 2019-03-24 22:06 Zhentiw 阅读(324) 评论(0) 推荐(0) 编辑
摘要:What is Arrow Functor? Arrow is a Profunctor that lifts a function of type a -> b and allows for lazy execution of the function. Arrow can be consider 阅读全文
posted @ 2019-03-21 00:22 Zhentiw 阅读(332) 评论(0) 推荐(0) 编辑
摘要:Let's we have some prediction functions, for each prediction function has a corresponding tag: So if we have input as: Also we wish our program to the 阅读全文
posted @ 2019-03-19 21:11 Zhentiw 阅读(265) 评论(0) 推荐(0) 编辑
摘要:What we are going to do in this post, is to build a random number generator. As you might know that Javascript provides Math.random(), but the problem 阅读全文
posted @ 2019-03-16 20:07 Zhentiw 阅读(213) 评论(0) 推荐(0) 编辑
摘要:The act of currying can be described as taking a multivariate function and turning it into a series of unary functions. Let's see an example: This is 阅读全文
posted @ 2019-03-12 00:08 Zhentiw 阅读(154) 评论(0) 推荐(0) 编辑
摘要:This post is similar to previous post. The difference is in this post, we are going to see how to handle both successfuly result and error result by u 阅读全文
posted @ 2019-03-10 21:17 Zhentiw 阅读(187) 评论(0) 推荐(0) 编辑
摘要:Let's say we are going to read some files, return the first file which pass the prediction method, this prediction method can be just check whether th 阅读全文
posted @ 2019-03-10 04:24 Zhentiw 阅读(242) 评论(0) 推荐(0) 编辑
摘要:We see three varied examples of where natural transformations come in handy. Let's mark the law here for Natural Transformations: Then let's see why w 阅读全文
posted @ 2019-03-01 22:24 Zhentiw 阅读(275) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示