import { Result as Either } from 'ts-results-es'; export abstract class Context { private constructor(private _: Either){} abstract get message(): Left; abstract get interaction(): Right; } function safeUnwrap(res: Either) { return res.val; } export function wrap( val: Left|Right, fa: (val: Left|Right) => Either ) { return fa(val); }