import { Stream } from "./Stream" ; import { Cell } from "./Cell" ; import { Source } from "./Vertex" ; export class Lambda1 < A , B > { constructor ( f , deps ) { this . f = f ; this . deps = deps ; } f : ( a : A ) => B ; deps : Array < Stream < any > | Cell < any > > ; } export function lambda1 < A , B > ( f , deps ) { return new Lambda1 ( f , deps ) ; } export function Lambda1_deps < A , B > ( f ) { if ( f instanceof Lambda1 ) return f . deps ; else return [ ] ; } export function Lambda1_toFunction < A , B > ( f ) { if ( f instanceof Lambda1 ) return f . f ; else return < ( a : A ) => B > f ; } export class Lambda2 < A , B , C > { constructor ( f , deps ) { this . f = f ; this . deps = deps ; } f : ( a : A , b : B ) => C ; deps : Array < Stream < any > | Cell < any > > ; } export function lambda2 < A , B , C > ( f , deps ) { return new Lambda2 ( f , deps ) ; } export function Lambda2_deps < A , B , C > ( f ) { if ( f instanceof Lambda2 ) return f . deps ; else return [ ] ; } export function Lambda2_toFunction < A , B , C > ( f ) { if ( f instanceof Lambda2 ) return f . f ; else return < ( a : A , b : B ) => C > f ; } export class Lambda3 < A , B , C , D > { constructor ( f , deps ) { this . f = f ; this . deps = deps ; } f : ( a : A , b : B , c : C ) => D ; deps : Array < Stream < any > | Cell < any > > ; } export function lambda3 < A , B , C , D > ( f , deps ) { return new Lambda3 ( f , deps ) ; } export function Lambda3_deps < A , B , C , D > ( f ) { if ( f instanceof Lambda3 ) return f . deps ; else return [ ] ; } export function Lambda3_toFunction < A , B , C , D > ( f ) { if ( f instanceof Lambda3 ) return f . f ; else return < ( a : A , b : B , c : C ) => D > f ; } export class Lambda4 < A , B , C , D , E > { constructor ( f , deps ) { this . f = f ; this . deps = deps ; } f : ( a : A , b : B , c : C , d : D ) => E ; deps : Array < Stream < any > | Cell < any > > ; } export function lambda4 < A , B , C , D , E > ( f , deps ) { return new Lambda4 ( f , deps ) ; } export function Lambda4_deps < A , B , C , D , E > ( f ) { if ( f instanceof Lambda4 ) return f . deps ; else return [ ] ; } export function Lambda4_toFunction < A , B , C , D , E > ( f ) { if ( f instanceof Lambda4 ) return f . f ; else return < ( a : A , b : B , c : C , d : D ) => E > f ; } export class Lambda5 < A , B , C , D , E , F > { constructor ( f , deps ) { this . f = f ; this . deps = deps ; } f : ( a : A , b : B , c : C , d : D , e : E ) => F ; deps : Array < Stream < any > | Cell < any > > ; } export function lambda5 < A , B , C , D , E , F > ( f , deps ) { return new Lambda5 ( f , deps ) ; } export function Lambda5_deps < A , B , C , D , E , F > ( f ) { if ( f instanceof Lambda5 ) return f . deps ; else return [ ] ; } export function Lambda5_toFunction < A , B , C , D , E , F > ( f ) { if ( f instanceof Lambda5 ) return f . f ; else return < ( a : A , b : B , c : C , d : D , e : E ) => F > f ; } export class Lambda6 < A , B , C , D , E , F , G > { constructor ( f , deps ) { this . f = f ; this . deps = deps ; } f : ( a : A , b : B , c : C , d : D , e : E , f : F ) => G ; deps : Array < Stream < any > | Cell < any > > ; } export function lambda6 < A , B , C , D , E , F , G > ( f , deps ) { return new Lambda6 ( f , deps ) ; } export function Lambda6_deps < A , B , C , D , E , F , G > ( f ) { if ( f instanceof Lambda6 ) return f . deps ; else return [ ] ; } export function Lambda6_toFunction < A , B , C , D , E , F , G > ( f ) { if ( f instanceof Lambda6 ) return f . f ; else return < ( a : A , b : B , c : C , d : D , e : E , f : F ) => G > f ; } export function toSources ( deps ) { const ss = [ ] ; for ( let i = 0 ; i < deps . length ; i ++ ) { const dep = deps [ i ] ; ss . push ( new Source ( dep . getVertex__ ( ) , null ) ) ; } return ss ; }