Working our way backwards from solution to problem, we define an applicative functor, then use it to apply a function of multiple arguments. For example we have this line of code: ).ap(Box())// Box(3); We want to use a funciton 'ap' (apply) on Box. A…
We annihilate the need for the ol' nested for loop using Applicatives. For example we have this kind of nested loop code: for(x in xs){ for(x in ys){ for(z in zs){ } } } We can refactor it by using List comprehension: ,,])); console.log(res1) // List…
What is applicative functor: the ability to apply functors to each other. For example we have tow functors: Container(2), Container(3) // We can't do this because the numbers are bottled up. add(Container.of(), Container.of()); // NaN We cannot just…
Let's examine a pointfree way to write these applicative calls. Since we know map is equal to of/ap, we can write generic functions that will ap as many times as we specify: const liftA2 = curry((g, f1, f2) => f1.map(g).ap(f2)); const liftA3 = curry(…
我的观点是,看别人的源码,不追求一定要能原样造轮子,单纯就是学习知识,对于程序员的提高就足够了.在阅读redux的compose源码之前,我们先学一些前置的知识. redux源码阅读之compose,applyMiddleware 看别人的源码就是学习知识.我们先学一些东西. rest参数 形式为...变量名,用于获取函数的多余参数 ,该变量将多余的参数放入数组中, 只能是参数的最后一个. function rest(...args){ console.log(args); }; rest('a…
Redux源码分析之基本概念 Redux源码分析之createStore Redux源码分析之bindActionCreators Redux源码分析之combineReducers Redux源码分析之compose      解读之前先了准备一下基本知识 rest参数  形式为...变量名,用于获取函数的多余参数 ,该变量将多余的参数放入数组中, 只能是参数的最后一个. 扩展运算符 扩展运算符(spread)是三个点(...).它好比 rest 参数的逆运算,将一个数组转为用逗号分隔的参数序…
We use the following notational conventions in this section: Type expressions are represented using the letters A, F, U, V, and W. The letter A is only used to denote the type of an actual argument, and F is only used to denote the type of a formal p…
发现漏洞 弱点发现方法: 1.基于端口服务扫描结果版本信息,比对其是否为最新版本,若不是则去其 官网查看其补丁列表,然后去逐个尝试,但是此法弊端很大,因为各种端口应用比较多,造成耗时大. 2.搜索已公开的漏洞数据库,但数量大. ##其中会有漏洞利用代码,如:https://www.exploit-db.com/ [kali集成] root@kali:~# searchsploit tomcat --------------------------------------------- -----…
原文: https://code.google.com/p/googlemock/wiki/CookBook Creating Mock Classes Mocking Private or Protected Methods Mocking Overloaded Methods Mocking Class Templates Mocking Nonvirtual Methods Mocking Free Functions The Nice, the Strict, and the Naggy…
6. IoC容器 6.1 Spring IoC容器和bean介绍 这一章节介绍了Spring框架的控制反转(IoC)实现的原理.IoC也被称作依赖注入(DI).It is a process whereby objects define their dependencies, that is, the other objects they work with, only through constructor arguments, arguments to a factory method, o…