import * as tsplus_module_1 from "@tsplus/stdlib/collections/Chunk/isEmpty";
import * as tsplus_module_2 from "@tsplus/stdlib/data/Maybe/definition";
import * as tsplus_module_3 from "@effect/core/stm/STM/operations/succeedNow";
import * as tsplus_module_4 from "@tsplus/stdlib/collections/Chunk/unsafeHead";
import * as tsplus_module_5 from "@effect/core/stm/TRef/operations/get";
import * as tsplus_module_6 from "@effect/core/stm/STM/operations/map";
import { concreteTArray } from "@effect/core/stm/TArray/operations/_internal/InternalTArray";
/**
 * The first entry of the array, if it exists.
 *
 * @tsplus getter ets/TArray firstMaybe
 */

export function firstMaybe(self) {
  void 0;
  return tsplus_module_1.isEmpty(self.chunk) ? tsplus_module_3.succeedNow(tsplus_module_2.none) : tsplus_module_6.map_(tsplus_module_5.get(tsplus_module_4.unsafeHead(self.chunk)), tsplus_module_2.some);
}
//# sourceMappingURL=firstMaybe.mjs.map