随笔分类 - Compose
摘要:Let's say we have two fucntions: const toUpper = s => s.toUpperCase(); const exclaim = s => `${s}!`; We want to combine those. But function itself doe
阅读全文
摘要:We want to write a Monoid, which able to take function called 'run', therefore we able to run a serial of functions together to get a combined result.
阅读全文
摘要:Much of our code in real life is full of if statements that check the validity of a given input to see if a given computation should be performed. Usi
阅读全文
摘要:For example we have a feature reducer like this: First of all, we can replace 'swtich' statement with normal Object: In case of ´actionReducer[type]´
阅读全文
只有注册用户登录后才能阅读该文。
摘要:Sometimes I am confused with 'liftA2' and 'converge' functions. Main difference between those is that: liftA2 takes applicative functor as second and
阅读全文
只有注册用户登录后才能阅读该文。
摘要:We have State like this: We want to validate user's input is the same as 'hint' and it matchs 'id' in cards array. Then we want to set 'isCorrect' to
阅读全文
只有注册用户登录后才能阅读该文。
只有注册用户登录后才能阅读该文。
只有注册用户登录后才能阅读该文。
只有注册用户登录后才能阅读该文。
只有注册用户登录后才能阅读该文。
摘要:ReaderT is a Monad Transformer that wraps a given Monad with a Reader. This allows the interface of a Reader that enables the composition of computati
阅读全文
只有注册用户登录后才能阅读该文。
摘要:Crocks.js has the implementation, no need to do it yourself. https://evilsoft.github.io/crocks/docs/functions/logic-functions.html#implies
阅读全文
只有注册用户登录后才能阅读该文。
摘要: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 ...
阅读全文