'use strict';

const hProto = require('../interface/result.h').prototype;
const sym = require('../interface/result-sym.h');


hProto.or = function ($val) {
    if (!this[sym.isOk]) {
        this[sym.value] = $val;
        this[sym.isOk] = true;
    }

    return this;
};

@@ -15,21 +15,16 @@
 %0Aconst h
-Proto
  = requi
@@ -50,16 +50,34 @@
 sult.h')
+;%0Aconst hProto = h
 .prototy
@@ -170,13 +170,15 @@
     
-if (!
+return 
 this
@@ -191,19 +191,16 @@
 sOk%5D
-) %7B
 %0A       
  thi
@@ -199,86 +199,50 @@
     
+ ?
  this
-%5Bsym.value%5D = $val;%0A        this%5Bsym.isOk%5D = true;%0A    %7D%0A%0A    return this
+%0A        : h.fromSuccess($val)%0A    
 ;%0A%7D;

fix FP immutability of or()