'use strict';

const FlutureTMonetEither = require('../FlutureTMonetEither');


const MonetEitherT = ({ monet, fluture }) => {
  const { isFuture } = fluture;
  const { Either, Identity } = monet;
  const FutureTEither = FlutureTMonetEither({ monet, fluture });

  const type = (monadOrValue) => {
    if (isFuture(monadOrValue)) {
      return FutureTEither.fromFuture(monadOrValue);
    } else if (monadOrValue instanceof Identity.fn.init) {
      return Either.of(monadOrValue.get());
    } else if (monadOrValue instanceof Either.fn.init) {
      return monadOrValue;
    }
    return Either.of(monadOrValue);
  };

  return Object.assign(type, Either);
};


module.exports = MonetEitherT;

@@ -8,16 +8,65 @@
 rict';%0A%0A
+const %7B isNotNull %7D = require('ramda-adjunct');%0A%0A
 const Fl
@@ -165,47 +165,22 @@
 ure 
-%7D) =%3E %7B%0A  const %7B isFuture
+= null
  %7D
+)
  =
- fluture;
+%3E %7B
 %0A  c
@@ -217,73 +217,8 @@
 net;
-%0A  const FutureTEither = FlutureTMonetEither(%7B monet, fluture %7D);
 %0A%0A  
@@ -258,16 +258,46 @@
     if (
+isNotNull(fluture) && fluture.
 isFuture
@@ -332,20 +332,46 @@
 rn F
+l
 utureT
+Monet
 Either
+(%7B monet, fluture %7D)
 .fro

make fluture not compulsory dependency