code: function resultToEither(result) {
    if(isFunction(result)) {
      return function(x) {
        const m = result(x)
  
        if(!isSameType(Result, m)) {
          throw new TypeError('resultToEither: Result returning function required')
        }
  
        return applyTransform(m)
      }
    }
  
    if(isSameType(Result, result)) {
      return applyTransform(result)
    }
  
    throw new TypeError('resultToEither: Result or Result returning function required')
  }
docs: resultToEither : Result e a -> Either e a resultToEither : (a -> Result e b) -> a -> Either e b