import {
  isNonEmpty
} from "./chunk-RGZW4IJC.mjs";
import {
  __export
} from "./chunk-QK4PKNB3.mjs";

// src/string.ts
var string_exports = {};
__export(string_exports, {
  Eq: () => Eq,
  Monoid: () => Monoid,
  Ord: () => Ord,
  Semigroup: () => Semigroup,
  Show: () => Show,
  empty: () => empty,
  endsWith: () => endsWith,
  includes: () => includes,
  isEmpty: () => isEmpty,
  isString: () => isString,
  replace: () => replace,
  size: () => size,
  slice: () => slice,
  split: () => split,
  startsWith: () => startsWith,
  toLowerCase: () => toLowerCase,
  toUpperCase: () => toUpperCase,
  trim: () => trim,
  trimLeft: () => trimLeft,
  trimRight: () => trimRight
});
var Eq = {
  equals: (first, second) => first === second
};
var Semigroup = {
  concat: (first, second) => first + second
};
var empty = "";
var Monoid = {
  concat: Semigroup.concat,
  empty
};
var Ord = {
  equals: Eq.equals,
  compare: (first, second) => first < second ? -1 : first > second ? 1 : 0
};
var Show = {
  show: (s) => JSON.stringify(s)
};
var isString = (u) => typeof u === "string";
var toUpperCase = (s) => s.toUpperCase();
var toLowerCase = (s) => s.toLowerCase();
var replace = (searchValue, replaceValue) => (s) => s.replace(searchValue, replaceValue);
var trim = (s) => s.trim();
var trimLeft = (s) => s.trimLeft();
var trimRight = (s) => s.trimRight();
var slice = (start, end) => (s) => s.slice(start, end);
var isEmpty = (s) => s.length === 0;
var size = (s) => s.length;
var split = (separator) => (s) => {
  const out = s.split(separator);
  return isNonEmpty(out) ? out : [s];
};
var includes = (searchString, position) => (s) => s.includes(searchString, position);
var startsWith = (searchString, position) => (s) => s.startsWith(searchString, position);
var endsWith = (searchString, position) => (s) => s.endsWith(searchString, position);

export {
  Eq,
  Semigroup,
  empty,
  Monoid,
  Ord,
  Show,
  isString,
  toUpperCase,
  toLowerCase,
  replace,
  trim,
  trimLeft,
  trimRight,
  slice,
  isEmpty,
  size,
  split,
  includes,
  startsWith,
  endsWith,
  string_exports
};
