import { Failure , Success } from 'runtypes' ; export const failure = ( message ) : Failure => ( { success : false , message } ) ; export const success = < T > ( value ) : Success < T > => ( { success : true , value } ) ; export const mapSuccess = < T , A > ( s , fn ) : Success < A > => ( { ... s , value : fn ( s . value ) } ) ;