import { Generic , TypeFamily , Of , Kind1 , Generic1 , Kind2 , Generic2 , Of2 } from "." ; declare class Box < A > { [ Generic . Type ] : Generic1 < BoxF , A > ; readonly value : A ; } interface BoxF extends TypeFamily < Kind1 > { ( ) : Box < this [ 0 ] > ; } interface CrossF extends TypeFamily < Kind2 > { < A extends this [ 0 ] , B extends this [ 1 ] > ( ) : [ A , B ] ; } type x = Of2 < CrossF , string , number > ; declare const enum Pass { } type Eq < A , B > = [ A ] extends [ B ] ? [ B ] extends [ A ] ? true : false : false ; type Assert < T extends true > = Pass ; namespace test$1 { export type Result = Assert < Eq < Of < BoxF , string > , Box < string > > > ; } namespace test$2 { declare const box ; declare function test < F , A > ( fa ) ; const inferred = test ( box ) ; export type Result = Assert < Eq < typeof inferred , Box < number > > > ; } namespace test$3 { declare const box ; declare function test < F , A > ( fa ) ; const inferred = test ( box ) ; export type Result = Assert < Eq < typeof inferred , Box < number > > > ; } namespace test$4 { declare const box ; declare function asVoid < F , A > ( fa ) ; const inferred = asVoid ( box ) ; export type Result = Assert < Eq < typeof inferred , Box < void > > > ; } namespace test$5 { declare const box ; function duplicate < F , A > ( fa , extract , lift ) { const a = extract ( fa ) ; return lift ( [ a , a ] as const ) ; } declare function Box < T > ( x ) ; const result = duplicate ( box , fb => fb . value , Box ) ; export type Result = Assert < Eq < typeof result , Box < readonly [ string , string ] > > > ; } namespace test$6 { interface Functor < F > { map < A , B > ( fa , f ) : Of < F , B > ; } declare function Box < T > ( x ) ; const BoxFunctor = { map < A , B > ( box , f ) { return Box ( f ( box . value ) ) ; } } ; function map < F , A , B > ( functor , fa , f ) { return functor . map ( functor . map ( functor . map ( fa , x => x ) , f ) , x => x ) ; } declare const box ; const mapped = map ( BoxFunctor , box , _ => parseInt ( _ , 10 ) ) ; export type Result = Assert < Eq < typeof mapped , Box < number > > > ; } namespace test$7 { class Pair < A , B > { [ Generic . Type ] : Generic2 < Pair$λ , A , B > ; constructor ( readonly _0 , readonly _1 ) { } } interface Pair$λ extends TypeFamily < Kind2 > { ( ) : Pair < this [ 0 ] , this [ 1 ] > ; } declare function infer2 < T extends TypeFamily < Kind2 > , A1 , A2 > ( t ) ; declare const pair ; declare const box ; const x = infer2 ( pair ) ; }