<commit_before>'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;
<commit_msg>refactor(MonetEitherT): make fluture not compulsory dependency<commit_after>'use strict';

const { isNotNull } = require('ramda-adjunct');

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


const MonetEitherT = ({ monet, fluture = null }) => {
  const { Either, Identity } = monet;

  const type = (monadOrValue) => {
    if (isNotNull(fluture) && fluture.isFuture(monadOrValue)) {
      return FlutureTMonetEither({ monet, fluture }).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;

{'fraction_non_alphanumeric': 0.1301460823373174, 'fraction_numerical': 0.0, 'mean_word_length': 4.1084745762711865, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4860717', 'n_tokens_mistral': 507, 'n_tokens_neox': 479, 'n_words': 103}