diff --git a/packages/effect/src/Stream/Stream/halt.ts b/packages/effect/src/Stream/Stream/halt.ts new file mode 100644 index 0000000000..26b2249a13 --- /dev/null +++ b/packages/effect/src/Stream/Stream/halt.ts @@ -0,0 +1,10 @@ +import type { Cause } from "../../Cause" +import { halt as haltEff } from "../../Effect/core" +import { flow } from "../../Function" +import type { SyncE } from "./definitions" +import { fromEffect } from "./fromEffect" + +/** + * The stream that always halts with `cause`. + */ +export const halt: (cause: Cause) => SyncE = flow(haltEff, fromEffect) diff --git a/packages/effect/src/Stream/Stream/index.ts b/packages/effect/src/Stream/Stream/index.ts index b50e9d56e5..105f220989 100644 --- a/packages/effect/src/Stream/Stream/index.ts +++ b/packages/effect/src/Stream/Stream/index.ts @@ -37,6 +37,7 @@ export * from "./fromEffectOption" export * from "./fromQueue" export * from "./fromQueueWithShutdown" export * from "./fromSchedule" +export * from "./halt" export * from "./iterate" export * from "./managed" export * from "./map"