import { identity } from '..' ; /**
 * A *thunk*
 *
 *
 */ export interface Lazy < A > { ( ) : A ; } /**
 *
 */ export interface Predicate < A > { ( a ) : boolean ; } /**
 *
 */ export interface Refinement < A , B extends A > { ( a ) : a is B ; } /**
 *
 */ export interface Endomorphism < A > { ( a ) : A ; } example export interface FunctionN < A extends ReadonlyArray < unknown > , B > { ( ... args ) : B ; } /**
 *
 */ /**
 *
 */ export const unsafeCoerce = identity as any ; /**
 *
 */ export function not < A > ( predicate ) { return ( a ) => ! predicate ( a ) ; } /**
 *
 */ export function constant < A > ( a ) { return ( ) => a ; } /**
 * A thunk that returns always `true`
 *
 *
 */ export const constTrue = ( ) : boolean => { return true ; } ; /**
 * A thunk that returns always `false`
 *
 *
 */ export const constFalse = ( ) : boolean => { return false ; } ; /**
 * A thunk that returns always `null`
 *
 *
 */ export const constNull = ( ) : null => { return null ; } ; /**
 * A thunk that returns always `undefined`
 *
 *
 */ export const constUndefined = ( ) : undefined => { return ; } ; /**
 * A thunk that returns always `void`
 *
 *
 */ export const constVoid = ( ) : void => { return ; } ; /**
 * Flips the order of the arguments of a function of two arguments.
 *
 *
 */ export function flip < A , B , C > ( f ) { return ( b , a ) => f ( a , b ) ; } example export function flow < A extends ReadonlyArray < unknown > , B > ( ab ) ; export function flow < A extends ReadonlyArray < unknown > , B , C > ( ab , bc ) ; export function flow < A extends ReadonlyArray < unknown > , B , C , D > ( ab , bc , cd ) ; export function flow < A extends ReadonlyArray < unknown > , B , C , D , E > ( ab , bc , cd , de ) ; export function flow < A extends ReadonlyArray < unknown > , B , C , D , E , F > ( ab , bc , cd , de , ef ) ; export function flow < A extends ReadonlyArray < unknown > , B , C , D , E , F , G > ( ab , bc , cd , de , ef , fg ) ; export function flow < A extends ReadonlyArray < unknown > , B , C , D , E , F , G , H > ( ab , bc , cd , de , ef , fg , gh ) ; export function flow < A extends ReadonlyArray < unknown > , B , C , D , E , F , G , H , I > ( ab , bc , cd , de , ef , fg , gh , hi ) ; export function flow < A extends ReadonlyArray < unknown > , B , C , D , E , F , G , H , I , J > ( ab , bc , cd , de , ef , fg , gh , hi , ij ) ; export function flow ( ab , bc ? , cd ? , de ? , ef ? , fg ? , gh ? , hi ? , ij ? ) { switch ( arguments . length ) { case 1 : return ab ; case 2 : return function ( this ) { return bc ! ( ab . apply ( this , arguments ) ) ; } ; case 3 : return function ( this ) { return cd ! ( bc ! ( ab . apply ( this , arguments ) ) ) ; } ; case 4 : return function ( this ) { return de ! ( cd ! ( bc ! ( ab . apply ( this , arguments ) ) ) ) ; } ; case 5 : return function ( this ) { return ef ! ( de ! ( cd ! ( bc ! ( ab . apply ( this , arguments ) ) ) ) ) ; } ; case 6 : return function ( this ) { return fg ! ( ef ! ( de ! ( cd ! ( bc ! ( ab . apply ( this , arguments ) ) ) ) ) ) ; } ; case 7 : return function ( this ) { return gh ! ( fg ! ( ef ! ( de ! ( cd ! ( bc ! ( ab . apply ( this , arguments ) ) ) ) ) ) ) ; } ; case 8 : return function ( this ) { return hi ! ( gh ! ( fg ! ( ef ! ( de ! ( cd ! ( bc ! ( ab . apply ( this , arguments ) ) ) ) ) ) ) ) ; } ; case 9 : return function ( this ) { return ij ! ( hi ! ( gh ! ( fg ! ( ef ! ( de ! ( cd ! ( bc ! ( ab . apply ( this , arguments ) ) ) ) ) ) ) ) ) ; } ; } return ; } /**
 *
 */ /**
 *
 */ export function increment ( n ) { return n + 1 ; } /**
 *
 */ export function decrement ( n ) { return n - 1 ; } /**
 *
 */ export function absurd < A > ( _ ) { throw new Error ( 'Called `absurd` function which should be uncallable' ) ; } example export function tupled < A extends ReadonlyArray < unknown > , B > ( f ) { return ( a ) => f ( ... a ) ; } /**
 * Inverse function of `tupled`
 */ export function untupled < A extends ReadonlyArray < unknown > , B > ( f ) { return ( ... a ) => f ( a ) ; } example export function pipe < A > ( a ) ; export function pipe < A , B > ( a , ab ) ; export function pipe < A , B , C > ( a , ab , bc ) ; export function pipe < A , B , C , D > ( a , ab , bc , cd ) ; export function pipe < A , B , C , D , E > ( a , ab , bc , cd , de ) ; export function pipe < A , B , C , D , E , F > ( a , ab , bc , cd , de , ef ) ; export function pipe < A , B , C , D , E , F , G > ( a , ab , bc , cd , de , ef , fg ) ; export function pipe < A , B , C , D , E , F , G , H > ( a , ab , bc , cd , de , ef , fg , gh ) ; export function pipe < A , B , C , D , E , F , G , H , I > ( a , ab , bc , cd , de , ef , fg , gh , hi ) ; export function pipe < A , B , C , D , E , F , G , H , I , J > ( a , ab , bc , cd , de , ef , fg , gh , hi , ij ) ; export function pipe < A , B , C , D , E , F , G , H , I , J , K > ( a , ab , bc , cd , de , ef , fg , gh , hi , ij , jk ) ; export function pipe < A , B , C , D , E , F , G , H , I , J , K , L > ( a , ab , bc , cd , de , ef , fg , gh , hi , ij , jk , kl ) ; export function pipe < A , B , C , D , E , F , G , H , I , J , K , L , M > ( a , ab , bc , cd , de , ef , fg , gh , hi , ij , jk , kl , lm ) ; export function pipe < A , B , C , D , E , F , G , H , I , J , K , L , M , N > ( a , ab , bc , cd , de , ef , fg , gh , hi , ij , jk , kl , lm , mn ) ; export function pipe < A , B , C , D , E , F , G , H , I , J , K , L , M , N , O > ( a , ab , bc , cd , de , ef , fg , gh , hi , ij , jk , kl , lm , mn , no ) ; export function pipe < A , B , C , D , E , F , G , H , I , J , K , L , M , N , O , P > ( a , ab , bc , cd , de , ef , fg , gh , hi , ij , jk , kl , lm , mn , no , op ) ; export function pipe < A , B , C , D , E , F , G , H , I , J , K , L , M , N , O , P , Q > ( a , ab , bc , cd , de , ef , fg , gh , hi , ij , jk , kl , lm , mn , no , op , pq ) ; export function pipe < A , B , C , D , E , F , G , H , I , J , K , L , M , N , O , P , Q , R > ( a , ab , bc , cd , de , ef , fg , gh , hi , ij , jk , kl , lm , mn , no , op , pq , qr ) ; export function pipe < A , B , C , D , E , F , G , H , I , J , K , L , M , N , O , P , Q , R , S > ( a , ab , bc , cd , de , ef , fg , gh , hi , ij , jk , kl , lm , mn , no , op , pq , qr , rs ) ; export function pipe < A , B , C , D , E , F , G , H , I , J , K , L , M , N , O , P , Q , R , S , T > ( a , ab , bc , cd , de , ef , fg , gh , hi , ij , jk , kl , lm , mn , no , op , pq , qr , rs , st ) ; export function pipe ( a , ab ? , bc ? , cd ? , de ? , ef ? , fg ? , gh ? , hi ? , ij ? , jk ? , kl ? , lm ? , mn ? , no ? , op ? , pq ? , qr ? , rs ? , st ? ) { switch ( arguments . length ) { case 1 : return a ; case 2 : return ab ! ( a ) ; case 3 : return bc ! ( ab ! ( a ) ) ; case 4 : return cd ! ( bc ! ( ab ! ( a ) ) ) ; case 5 : return de ! ( cd ! ( bc ! ( ab ! ( a ) ) ) ) ; case 6 : return ef ! ( de ! ( cd ! ( bc ! ( ab ! ( a ) ) ) ) ) ; case 7 : return fg ! ( ef ! ( de ! ( cd ! ( bc ! ( ab ! ( a ) ) ) ) ) ) ; case 8 : return gh ! ( fg ! ( ef ! ( de ! ( cd ! ( bc ! ( ab ! ( a ) ) ) ) ) ) ) ; case 9 : return hi ! ( gh ! ( fg ! ( ef ! ( de ! ( cd ! ( bc ! ( ab ! ( a ) ) ) ) ) ) ) ) ; case 10 : return ij ! ( hi ! ( gh ! ( fg ! ( ef ! ( de ! ( cd ! ( bc ! ( ab ! ( a ) ) ) ) ) ) ) ) ) ; case 11 : return jk ! ( ij ! ( hi ! ( gh ! ( fg ! ( ef ! ( de ! ( cd ! ( bc ! ( ab ! ( a ) ) ) ) ) ) ) ) ) ) ; case 12 : return kl ! ( jk ! ( ij ! ( hi ! ( gh ! ( fg ! ( ef ! ( de ! ( cd ! ( bc ! ( ab ! ( a ) ) ) ) ) ) ) ) ) ) ) ; case 13 : return lm ! ( kl ! ( jk ! ( ij ! ( hi ! ( gh ! ( fg ! ( ef ! ( de ! ( cd ! ( bc ! ( ab ! ( a ) ) ) ) ) ) ) ) ) ) ) ) ; case 14 : return mn ! ( lm ! ( kl ! ( jk ! ( ij ! ( hi ! ( gh ! ( fg ! ( ef ! ( de ! ( cd ! ( bc ! ( ab ! ( a ) ) ) ) ) ) ) ) ) ) ) ) ) ; case 15 : return no ! ( mn ! ( lm ! ( kl ! ( jk ! ( ij ! ( hi ! ( gh ! ( fg ! ( ef ! ( de ! ( cd ! ( bc ! ( ab ! ( a ) ) ) ) ) ) ) ) ) ) ) ) ) ) ; case 16 : return op ! ( no ! ( mn ! ( lm ! ( kl ! ( jk ! ( ij ! ( hi ! ( gh ! ( fg ! ( ef ! ( de ! ( cd ! ( bc ! ( ab ! ( a ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ; case 17 : return pq ! ( op ! ( no ! ( mn ! ( lm ! ( kl ! ( jk ! ( ij ! ( hi ! ( gh ! ( fg ! ( ef ! ( de ! ( cd ! ( bc ! ( ab ! ( a ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ; case 18 : return qr ! ( pq ! ( op ! ( no ! ( mn ! ( lm ! ( kl ! ( jk ! ( ij ! ( hi ! ( gh ! ( fg ! ( ef ! ( de ! ( cd ! ( bc ! ( ab ! ( a ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ; case 19 : return rs ! ( qr ! ( pq ! ( op ! ( no ! ( mn ! ( lm ! ( kl ! ( jk ! ( ij ! ( hi ! ( gh ! ( fg ! ( ef ! ( de ! ( cd ! ( bc ! ( ab ! ( a ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ; case 20 : return st ! ( rs ! ( qr ! ( pq ! ( op ! ( no ! ( mn ! ( lm ! ( kl ! ( jk ! ( ij ! ( hi ! ( gh ! ( fg ! ( ef ! ( de ! ( cd ! ( bc ! ( ab ! ( a ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ; } return ; } /**
 * Type hole simulation
 */ export const hole = absurd as any ; internal export const bind_ = < A , N extends string , B > ( a , name , b ) : { [ K in keyof A | N ] : K extends keyof A ? A [ K ] : B ; } => Object . assign ( { } , a , { [ name ] : b } ) as any ; internal export const bindTo_ = < N extends string > ( name ) => < B > ( b ) : { [ K in N ] : B ; } => ( { [ name ] : b } as any ) ;