derw
Version:
An Elm-inspired language that transpiles to TypeScript
32 lines (31 loc) • 1.28 kB
TypeScript
import { Maybe } from "./Maybe";
export { emptyList };
export { map };
export { indexedMap };
export { filter };
export { foldl };
export { statefulFold };
export { foldr };
export { filterMap };
export { append };
export { reverse };
export { length };
export { take };
export { drop };
export { sort };
export { sortBy };
declare const emptyList: any[];
declare function map<a, b>(fn: (arg0: a) => b, xs: a[]): b[];
declare function indexedMap<a, b>(fn: (arg0: a, arg1: number) => b, xs: a[]): b[];
declare function filter<a>(fn: (arg0: a) => boolean, xs: a[]): a[];
declare function foldl<a, b>(fn: (arg0: a, arg1: b) => b, init: b, xs: a[]): b;
declare function statefulFold<item, state>(fn: (arg0: item, arg1: state) => state, init: state, xs: item[]): state;
declare function foldr<a, b>(fn: (arg0: a, arg1: b) => b, init: b, xs: a[]): b;
declare function filterMap<a, b>(fn: (arg0: a) => Maybe<b>, xs: a[]): b[];
declare function append<a>(xs: a[], ys: a[]): a[];
declare function reverse<a>(xs: a[]): a[];
declare function length<a>(xs: a[]): number;
declare function take<a>(n: number, xs: a[]): a[];
declare function drop<a>(n: number, xs: a[]): a[];
declare function sort<a>(xs: a[]): a[];
declare function sortBy<a>(fn: (arg0: a, arg1: a) => number, xs: a[]): a[];