/** * Functor a simple Functor that can be mapped. */ export interface Functor { map(f: MapFunction): Functor; } export interface MapFunction { (a: A): B } /** * map is a partially applied version of a Functor's map. * Its purpose is to allow us to map over Functors without creating anonymous functions. */ export const map = (f: MapFunction) => (m: Functor) => m.map(f);