import { fold } from 'fp-ts/lib/Either' ; import { TaskEither } from 'fp-ts/lib/TaskEither' ; export function run < A > ( eff ) { eff ( ) . then ( fold ( ( e ) => { throw e ; } , ( _ ) => { process . exitCode = 0 ; } ) ) . catch ( ( e ) => { console . error ( e ) ; process . exitCode = 1 ; } ) ; }