I hereby claim:
- I am tdreyno on github.
- I am tdreyno (https://keybase.io/tdreyno) on keybase.
- I have a public key whose fingerprint is 0D56 40C3 629D 4F02 3108 0B9B 5DD3 A3D3 D928 68DE
To claim this, I am signing this object:
// Lambda calculus: Church 1940-ish | |
// | |
// <expression> := <name> | <function> | <application> | |
// <function> := λ <name>.<expression> | |
// <application> := <expression><expression> | |
// | |
// expression := name | function | application | |
// function := name => expression | |
// application := expression(expression) | |
// |
export function to<A, T>(fn: (items: A[]) => T) { | |
return (sum: any, _item: A, index: number, all: A[]): T => { | |
const isLast = index === all.length - 1; | |
if (!isLast) { | |
return sum; | |
} | |
return fn(all); | |
}; |
export function loadStories(userId: string) { | |
return Task.map2( | |
myStories => storiesSharedWithMe => | |
({ | |
myStories, | |
storiesSharedWithMe, | |
}), | |
userStories(userId).map(listToLookup), | |
userSharedStories(userId).map(listToLookup), |
interface Array<T> { | |
andThen: <U>(this: T[], fn: (items: T[]) => U) => U; | |
} | |
Array.prototype.andThen = function<T, U>(this: T[], fn: (items: T[]) => U): U { | |
return fn(this); | |
}; |
// Vector of number types | |
const v1 = vector([1, 2, 3, 4]); | |
console.log(v1.toString()); | |
// Vector of string types | |
const v2 = vector(["a", "b", "c", "d"]); | |
console.log(v2.toString()); | |
// Vector of vector types |
import { | |
StyleSheet, | |
css as stylesheetToClassNames, | |
} from 'aphrodite'; | |
import { Map } from 'immutable'; | |
const Prefixer = require('inline-style-prefixer'); | |
import { DEVELOPMENT } from '../config'; | |
const prefixer = new Prefixer({ userAgent: navigator.userAgent }); |
{ | |
"rules": { | |
"align": [true, "parameters", "statements"], | |
"arrow-parens": true, | |
"class-name": true, | |
"comment-format": [ | |
true, | |
"check-space" | |
], | |
"curly": true, |
const country = (seg) => /^[a-z]{2}$/.test(seg); | |
const midPrefix = (seg) => /^m|g$/.test(seg); | |
const midValue = (seg) => /^[a-zA-Z0-9_]+$/.test(seg); | |
const coMidPrefix = (seg) => /^m|g$/.test(seg); | |
const coMidValue = (seg) => /^[a-zA-Z0-9_]+$/.test(seg); | |
const darkNews = (seg) => seg === DARK_LABEL; | |
const year = (seg) => /^[0-9]{4}/.test(seg); | |
const month = (seg) => /^[0-9]{2}/.test(seg); | |
const day = (seg) => /^[0-9]{2}/.test(seg); |
I hereby claim:
To claim this, I am signing this object: