'use strict';

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


H.and = function ($val) {
    if (this[sym.isOk]) {
        this[sym.value] = $val;
    }

    return this;
};

@@ -14,17 +14,17 @@
 %0A%0Aconst 
-H
+h
  = requi
@@ -50,16 +50,34 @@
 sult.h')
+;%0Aconst hProto = h
 .prototy
@@ -166,12 +166,15 @@
     
-if (
+return 
 this
@@ -183,19 +183,16 @@
 ym.isOk%5D
-) %7B
 %0A       
@@ -196,54 +196,49 @@
     
-this%5Bsym.value%5D = 
+? h.fromSuccess(
 $val
-;
+)
 %0A    
-%7D%0A%0A
     
-return this
+: this%0A    
 ;%0A%7D;

fix FP immutability of and()