diff --git a/index.d.ts b/index.d.ts
index dc7d9325..7d70743b 100644
--- a/index.d.ts
+++ b/index.d.ts
@@ -4,137 +4,78 @@ export type Pair = [A, B];
export type Thunk = () => A;
-export type Fn = (a: A) => B;
-export type Fn2 = (a: A, b: B) => C;
-export type Fn3 = (a: A, b: B, c: C) => D;
-export type Fn4 = (a: A, b: B, c: C, d: D) => E;
-export type Fn5 = (a: A, b: B, c: C, d: D, e: E) => F;
+export type Fn = (a: A) => B;
+export type Fn2 = (a: A) => (b: B) => C;
+export type Fn3 = (a: A) => (b: B) => (c: C) => D;
+export type Fn4 = (a: A) => (b: B) => (c: C) => (d: D) => E;
+export type Fn5 = (a: A) => (b: B) => (c: C) => (d: D) => (e: E) => F;
+export type Fn2_ = (a: A, b: B) => C;
+export type Fn3_ = (a: A, b: B, c: C) => D;
+export type Fn4_ = (a: A, b: B, c: C, d: D) => E;
+export type Fn5_ = (a: A, b: B, c: C, d: D, e: E) => F;
export type Predicate = (a: A) => boolean;
export interface StrMap { [k: string]: A; }
export interface Maybe {
- 'fantasy-land/equals': (p: Maybe) => boolean;
- 'fantasy-land/map': (p: (q: A) => B) => Maybe;
- 'fantasy-land/ap': (p: Maybe<(q: A) => B>) => Maybe;
- 'fantasy-land/chain': (p: (q: A) => Maybe) => Maybe;
- 'fantasy-land/alt': (p: Maybe) => Maybe;
- 'fantasy-land/reduce': (p: Fn2, s: B) => B;
- 'fantasy-land/traverse': (p: TypeRep, q: (r: A) => Applicative) => Applicative>;
-}
-
-export interface Either {
- 'fantasy-land/equals': (p: Either) => boolean;
- 'fantasy-land/map': (p: (q: B) => C) => Either;
- 'fantasy-land/bimap': (p: Fn, q: Fn) => Either;
- 'fantasy-land/ap': (p: Either C>) => Either;
- 'fantasy-land/chain': (p: (q: B) => Either) => Either;
- 'fantasy-land/alt': (p: Either) => Either;
- 'fantasy-land/reduce': (p: Fn2, s: C) => C;
- 'fantasy-land/traverse': (p: TypeRep, q: (r: B) => Applicative) => Applicative>;
-}
-
-
-type ValidNumber = number;
-type FiniteNumber = number;
-type NonZeroFiniteNumber = number;
-type Integer = number;
-type NonNegativeInteger = number;
-
-
-interface TypeRep {}
-
-
-interface Setoid {
- 'fantasy-land/equals': (other: Setoid) => boolean;
-}
-interface Ord extends Setoid {
- 'fantasy-land/lte': (other: Ord) => boolean;
-}
-interface Semigroupoid {
- 'fantasy-land/compose': (other: Semigroupoid) => Semigroupoid;
-}
-interface Category extends Semigroupoid {
constructor: {
- 'fantasy-land/id': () => Category
+ '@@type': 'sanctuary/Maybe';
};
}
-interface Semigroup {
- 'fantasy-land/concat': (other: Semigroup) => Semigroup;
-}
-interface Monoid extends Semigroup {
- constructor: {
- 'fantasy-land/empty': () => Monoid
- };
-}
-interface Functor {
- 'fantasy-land/map': (p: (q: A) => B) => Functor;
-}
-interface Bifunctor extends Functor {
- 'fantasy-land/bimap': (p: Fn, q: Fn) => Bifunctor;
-}
-interface Profunctor extends Functor {
- 'fantasy-land/promap': (p: Fn, q: Fn) => Profunctor;
-}
-interface Apply extends Functor {
- 'fantasy-land/ap': (p: Apply<(q: A) => B>) => Apply;
-}
-interface ApplicativeTypeRep {
- 'fantasy-land/of': (value: any) => any;
-}
-export interface Applicative extends Apply {
-}
-interface Chain extends Apply {
- 'fantasy-land/chain': (p: (q: A) => Chain) => Chain;
-}
-interface ChainRec extends Chain {
+
+export interface Either {
constructor: {
- 'fantasy-land/chainRec': (p: (q: (r: A) => C, s: (t: B) => C, u: A) => ChainRec, v: A) => ChainRec
+ '@@type': 'sanctuary/Either';
};
}
-interface Monad extends Applicative, Chain {}
-interface Alt extends Functor {
- 'fantasy-land/alt': (other: Alt) => Alt;
-}
-interface PlusTypeRep {
- 'fantasy-land/zero': () => Plus;
-}
-interface Plus extends Alt {
- constructor: PlusTypeRep;
-}
-interface Alternative extends Applicative, Plus {
- constructor: ApplicativeTypeRep & PlusTypeRep;
-}
-interface Foldable {
- 'fantasy-land/reduce': (p: Fn2, s: B) => B;
-}
-interface Traversable extends Functor, Foldable {
- 'fantasy-land/traverse': (p: TypeRep, q: (r: A) => Applicative) => Applicative>;
-}
-interface Extend extends Functor {
- 'fantasy-land/extend': (p: any) => any;
-}
-interface Comonad extends Extend {
- 'fantasy-land/extract': () => A;
-}
-interface Contravariant {
- 'fantasy-land/contramap': (p: (q: B) => A) => Contravariant;
-}
+
+
+type ValidNumber = number;
+type FiniteNumber = number;
+type NonZeroFiniteNumber = number;
+type Integer = number;
+type NonNegativeInteger = number;
+
+
+export interface TypeRep {}
+
+export interface Setoid {}
+export interface Ord extends Setoid {}
+export interface Semigroupoid {}
+export interface Category extends Semigroupoid {}
+export interface Semigroup {}
+export interface Monoid extends Semigroup {}
+export interface Functor {}
+export interface Bifunctor extends Functor {}
+export interface Profunctor extends Functor {}
+export interface Apply extends Functor {}
+export interface Applicative extends Apply {}
+export interface Chain extends Apply {}
+export interface ChainRec extends Chain {}
+export interface Monad extends Applicative, Chain {}
+export interface Alt extends Functor {}
+export interface Plus extends Alt {}
+export interface Alternative extends Applicative, Plus {}
+export interface Foldable {}
+export interface Traversable extends Functor, Foldable {}
+export interface Extend extends Functor {}
+export interface Comonad extends Extend {}
+export interface Contravariant {}
export const Maybe: TypeRep;
export const Nothing: Maybe;
-export function Just(value: A): Maybe;
+export function Just(x: A): Maybe;
export const Either: TypeRep;
-export function Left(value: A): Either;
-export function Right(value: A): Either;
+export function Left(x: A): Either;
+export function Right(x: A): Either;
// TODO: Specify return type
-export function create(p: {checkTypes: boolean, env: any[]}): {};
+export function create(opts: {checkTypes: boolean, env: Array}): {};
-export const env: any[];
+export const env: Array;
// Classify
@@ -144,137 +85,39 @@ export function type(x: any): {
version: NonNegativeInteger
};
-export function is(p: TypeRep): Predicate;
+export function is(typeRep: TypeRep): (x: any) => boolean;
// Showable
-export function toString(p: any): string;
+export function toString(x: any): string;
// Fantasy Land
-export function equals(p: null): Predicate;
-export function equals(p: undefined): Predicate;
-export function equals(p: boolean): Predicate;
-export function equals(p: number): Predicate;
-export function equals(p: Date): Predicate;
-export function equals(p: RegExp): Predicate;
-export function equals(p: string): Predicate;
-export function equals(p: Array): Predicate>;
-export function equals(p: IArguments): Predicate;
-export function equals(p: Error): Predicate;
-// XXX: This is too general. Can we match "plain" objects only?
-// export function equals(p: Object): Predicate