随笔分类 - 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
阅读全文
只有注册用户登录后才能阅读该文。
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文