/** * @author kcf */ interface schnittstelle_fehlermonade { /** * @author kcf */ ist_schlicht() : boolean; /** * @author kcf */ lesen() : typ_wert; } /** * @author kcf */ class klasse_nichts implements schnittstelle_fehlermonade { /** * @author kcf */ public constructor() { } /** * @author kcf */ public ist_schlicht() : boolean { return false; } /** * @author kcf */ public lesen() : typ_wert { let meldung : string = "ist nichts"; throw (new Error(meldung)); } } /** * @author kcf */ class klasse_schlicht implements schnittstelle_fehlermonade { /** * @author kcf */ private wert : typ_wert; /** * @author kcf */ public constructor(wert : typ_wert) { this.wert = wert; } /** * @author kcf */ public ist_schlicht() : boolean { return true; } /** * @author kcf */ public lesen() : typ_wert { return this.wert; } }