import { Result } from './result/types' ; import { Option } from './option/types' ; import { ResultEquipped } from './result/equipped' ; import { OptionEquipped } from './option/equipped' ; export function unimplemented ( msg ? ) { return panic ( `not implemented${ msg == null ? '' : ': ' + msg }` ) ; } export function todo ( msg ? ) { return panic ( `not yet implemented${ msg == null ? '' : ': ' + msg }` ) ; } export function panic ( msg ? ) { throw new Error ( `panicked at '${ msg == null ? 'explicit panic' : msg }'` ) ; } /**
 * Turns Result<T, E> into ResultEquipped<T, E>
 * and Option<T> into OptionEquipped<T>
 */ export function equip < T , E > ( r ) ; export function equip < T > ( r ) ; export function equip ( v ) { if ( ( v as Result < any , any > ) ?. __kind != null ) { return new ResultEquipped ( v ) ; } else { return new OptionEquipped ( v ) ; } }