随笔分类 - 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
阅读全文
只有注册用户登录后才能阅读该文。
摘要:/** * When */ const _branch = (x) => { const result = (x && x.isPublic) ? dissoc('private', x) : x; console.log(result); return assoc('result', 'done', result); } const ...
阅读全文
摘要: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
阅读全文
只有注册用户登录后才能阅读该文。
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
只有注册用户登录后才能阅读该文。
只有注册用户登录后才能阅读该文。
只有注册用户登录后才能阅读该文。
只有注册用户登录后才能阅读该文。
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文

浙公网安备 33010602011771号