export function chain( first: (data: T) => M, second: (dat: M) => R, ): (data: T) => R { return data => { return second(first(data)) } }