import { Disposable } from '@typed/disposable' ; import { curry } from '@typed/lambda' ; import { Env } from './Env' ; import { Resume } from './Resume' ; export const runEnv = curry ( < A extends { } , B > ( fn , resources , env ) : Disposable => Resume . run ( fn , env ( resources ) ) ) as { < A extends { } , B > ( fn , resources , env ) : Disposable ; < A extends { } , B > ( fn , resources ) : ( env : Env < A , B > ) => Disposable ; < B > ( fn ) : { < A extends { } > ( resources , env ) : Disposable ; < A extends { } > ( resources ) : ( env : Env < A , B > ) => Disposable ; } ; } ;