(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| package java8tests ; | |
| import java.util.function.BiFunction ; | |
| import java.util.function.Function ; | |
| public class Currying { | |
| public void currying() { | |
| // Create a function that adds 2 integers | |
| BiFunction<Integer,Integer,Integer> adder = ( a, b ) -> a + b ; |
| import Control.Monad (guard) | |
| -- either one is true | |
| xor :: Bool -> Bool -> Bool | |
| xor = (/=) | |
| distinct :: Eq a => [a] -> Bool | |
| distinct [] = True | |
| distinct (x:xs) = x `notElem` xs && distinct xs |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| . 5 . | . . 1 | 4 7 9 | |
| . . 2 | 7 . . | . . 8 | |
| . . . | . 4 6 | 2 . . | |
| ------+-------+------ | |
| . 4 6 | . . 9 | 5 3 7 | |
| . . . | . 6 . | . . . | |
| 8 9 3 | 5 . . | 6 4 . | |
| ------+-------+------ | |
| . . 9 | 6 1 . | . . . | |
| 1 . . | . . 2 | 3 . . |
| const daggy = require('daggy') | |
| const compose = (f, g) => x => f(g(x)) | |
| const id = x => x | |
| //===============Define Coyoneda========= | |
| const Coyoneda = daggy.tagged('x', 'f') | |
| Coyoneda.prototype.map = function(f) { | |
| return Coyoneda(this.x, compose(f, this.f)) | |
| } |
| #!/usr/bin/python3.5 | |
| # Author: Dagang Wei (github.com/weidagang) | |
| # Created: 2016-11-19 | |
| # Last modified: 2016-11-27 | |
| # License: MIT | |
| # Self link: https://gist.github.com/weidagang/1b001d0e55c4eff15ad34cc469fafb84 | |
| # | |
| # This code demonstrates the core algorithm for distributed MVCC based cross-row | |
| # transactions. The algorithm is built on top of a distributed key-value database |