import { NoInfer } from 'Function/_api' ; import { Left , pipe , Right } from '..' ; import { HKT , ReplaceFirst , ReplaceSecond , Type , URIS } from './hkt' ; export interface ChainLeftable < F extends URIS , A extends any [ ] > extends HKT < F , A > { readonly chainLeft : < B > ( f : ( a : A [ 1 ] ) => Type < F , ReplaceSecond < A , B > > ) => Type < F , ReplaceSecond < A , B > > ; } export const chainLeft = < Monad extends ChainLeftable < any , any > , URI extends URIS = Monad [ '_URI' ] , Generics extends any [ ] = Monad [ '_A' ] , B = any > ( f ) => ( fa ) : Type < URI , ReplaceSecond < Generics , B > > => { return fa . chainLeft ( f ) ; } ;