Skip to content

Instantly share code, notes, and snippets.

View YSMull's full-sized avatar
🎯
Focusing

ysmull YSMull

🎯
Focusing
View GitHub Profile
async function fn1() {
console.log(1);
await new Promise((resolve, reject) => {
console.log(2);
resolve();
})
console.log(3);
};
package com.netease.youdata.util;
import java.util.concurrent.ConcurrentHashMap;
public class ExpiredWindow<K, V> {
private Long windowSize;
private ConcurrentHashMap<K, V> dataMap = new ConcurrentHashMap<>();
@YSMull
YSMull / ap.js
Created December 28, 2018 03:39
Funtion as Applicative in JavaScript
let _ = require('lodash');
let pure = x => _ => x;
let ap = f => g => x => f(x)(g(x));
let add = a => b => a + b;
let multi = a => b => a * b;
let minus3 = a => b => c => a - b - c;