随笔分类 -  Compose

摘要:succ :: Doing N + 1 times fn. add :: Doing N times succ, based on K mult :: is B pow :: or Thrush, is flip isZero :: return just T otherwise K(F) , K 阅读全文
posted @ 2019-05-13 04:57 Zhentiw 阅读(183) 评论(0) 推荐(0)
只有注册用户登录后才能阅读该文。
posted @ 2019-05-09 02:02 Zhentiw 阅读(1) 评论(0) 推荐(0)
摘要:/** * When */ const _branch = (x) => { const result = (x && x.isPublic) ? dissoc('private', x) : x; console.log(result); return assoc('result', 'done', result); } const ... 阅读全文
posted @ 2019-05-07 13:54 Zhentiw 阅读(148) 评论(0) 推荐(0)
摘要: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 阅读(260) 评论(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 阅读(260) 评论(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 阅读(160) 评论(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 阅读(387) 评论(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 阅读(194) 评论(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 阅读(252) 评论(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 阅读(266) 评论(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 阅读(336) 评论(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 阅读(343) 评论(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 阅读(278) 评论(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 阅读(223) 评论(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 阅读(163) 评论(0) 推荐(0)