text: /* global exports */
  "use strict";
  
  // module Data.String
  
  exports._charAt = function (just) {
    return function (nothing) {
      return function (i) {
        return function (s) {
          return i >= 0 && i < s.length ? just(s.charAt(i)) : nothing;
        };
      };
    };
  };
  
  exports.singleton = function (c) {
    return c;
  };
  
  exports._charCodeAt = function (just) {
    return function (nothing) {
      return function (i) {
        return function (s) {
          return i >= 0 && i < s.length ? just(s.charCodeAt(i)) : nothing;
        };
      };
    };
  };
  
  exports._toChar = function (just) {
    return function (nothing) {
      return function (s) {
        return s.length === 1 ? just(s) : nothing;
      };
    };
  };
  
  exports.fromCharArray = function (a) {
    return a.join("");
  };
  
  exports._indexOf = function (just) {
    return function (nothing) {
      return function (x) {
        return function (s) {
          var i = s.indexOf(x);
          return i === -1 ? nothing : just(i);
        };
      };
    };
  };
  
  exports["_indexOf'"] = function (just) {
    return function (nothing) {
      return function (x) {
        return function (startAt) {
          return function (s) {
            if (startAt < 0 || startAt > s.length) return nothing;
            var i = s.indexOf(x, startAt);
            return i === -1 ? nothing : just(i);
          };
        };
      };
    };
  };
  
  exports._lastIndexOf = function (just) {
    return function (nothing) {
      return function (x) {
        return function (s) {
          var i = s.lastIndexOf(x);
          return i === -1 ? nothing : just(i);
        };
      };
    };
  };
  
  exports["_lastIndexOf'"] = function (just) {
    return function (nothing) {
      return function (x) {
        return function (startAt) {
          return function (s) {
            if (startAt < 0 || startAt > s.length) return nothing;
            var i = s.lastIndexOf(x, startAt);
            return i === -1 ? nothing : just(i);
          };
        };
      };
    };
  };
  
  exports.length = function (s) {
    return s.length;
  };
  
  exports._localeCompare = function (lt) {
    return function (eq) {
      return function (gt) {
        return function (s1) {
          return function (s2) {
            var result = s1.localeCompare(s2);
            return result < 0 ? lt : result > 0 ? gt : eq;
          };
        };
      };
    };
  };
  
  exports.replace = function (s1) {
    return function (s2) {
      return function (s3) {
        return s3.replace(s1, s2);
      };
    };
  };
  
  exports.take = function (n) {
    return function (s) {
      return s.substr(0, n);
    };
  };
  
  exports.drop = function (n) {
    return function (s) {
      return s.substring(n);
    };
  };
  
  exports.count = function (p) {
    return function (s) {
      for (var i = 0; i < s.length && p(s.charAt(i)); i++); {}
      return i;
    };
  };
  
  exports.split = function (sep) {
    return function (s) {
      return s.split(sep);
    };
  };
  
  exports.toCharArray = function (s) {
    return s.split("");
  };
  
  exports.toLower = function (s) {
    return s.toLowerCase();
  };
  
  exports.toUpper = function (s) {
    return s.toUpperCase();
  };
  
  exports.trim = function (s) {
    return s.trim();
  };
  
  exports.joinWith = function (s) {
    return function (xs) {
      return xs.join(s);
    };
  };
  