From bae849059b6ad6d773ee02acfd06beb43bcffd25 Mon Sep 17 00:00:00 2001 From: Maxwell Brown Date: Tue, 16 Dec 2025 14:17:44 -0500 Subject: [PATCH] Un-nest the `/data` modules (#832) --- bundle/brand.ts | 2 +- packages/effect/dtslint/Optic.tst.ts | 2 +- packages/effect/dtslint/data/Brand.tst.ts | 2 +- packages/effect/dtslint/data/Option.tst.ts | 5 +- packages/effect/dtslint/data/Struct.tst.ts | 5 +- packages/effect/dtslint/data/Tuple.tst.ts | 5 +- .../effect/dtslint/schema/Annotations.tst.ts | 2 +- .../effect/dtslint/schema/Literals.tst.ts | 2 +- packages/effect/dtslint/schema/Schema.tst.ts | 3 +- packages/effect/dtslint/schema/Struct.tst.ts | 5 +- packages/effect/dtslint/schema/Tuple.tst.ts | 2 +- packages/effect/dtslint/schema/Union.tst.ts | 2 +- packages/effect/dtslint/schema/api.tst.ts | 3 +- packages/effect/dtslint/schema/toIso.tst.ts | 5 +- packages/effect/dtslint/types/Types.tst.ts | 2 +- packages/effect/package.json | 2 - packages/effect/src/BigDecimal.ts | 8 +- packages/effect/src/BigInt.ts | 10 +- packages/effect/src/Boolean.ts | 6 +- packages/effect/src/{data => }/Brand.ts | 8 +- packages/effect/src/Cache.ts | 6 +- packages/effect/src/Cause.ts | 2 +- packages/effect/src/Channel.ts | 90 +++---- packages/effect/src/{data => }/Combiner.ts | 0 packages/effect/src/Config.ts | 6 +- packages/effect/src/ConfigProvider.ts | 6 +- packages/effect/src/Cron.ts | 24 +- packages/effect/src/{data => }/Data.ts | 38 +-- packages/effect/src/DateTime.ts | 6 +- packages/effect/src/Duration.ts | 12 +- packages/effect/src/Effect.ts | 38 +-- packages/effect/src/{data => }/Equivalence.ts | 26 +- packages/effect/src/ExecutionPlan.ts | 2 +- packages/effect/src/Exit.ts | 4 +- packages/effect/src/Fiber.ts | 2 +- packages/effect/src/FiberHandle.ts | 4 +- packages/effect/src/FiberMap.ts | 6 +- packages/effect/src/FiberSet.ts | 4 +- packages/effect/src/{data => }/Filter.ts | 36 +-- packages/effect/src/{data => }/Formatter.ts | 6 +- packages/effect/src/Function.ts | 2 +- packages/effect/src/Layer.ts | 6 +- packages/effect/src/LogLevel.ts | 2 +- packages/effect/src/Logger.ts | 4 +- packages/effect/src/ManagedRuntime.ts | 2 +- packages/effect/src/Match.ts | 6 +- packages/effect/src/Metric.ts | 90 +++---- packages/effect/src/{data => }/NullOr.ts | 4 +- packages/effect/src/Number.ts | 8 +- packages/effect/src/Optic.ts | 8 +- packages/effect/src/{data => }/Option.ts | 170 ++++++------ packages/effect/src/{data => }/Order.ts | 58 ++--- packages/effect/src/{data => }/Ordering.ts | 10 +- packages/effect/src/Pool.ts | 2 +- packages/effect/src/{data => }/Predicate.ts | 122 ++++----- packages/effect/src/PubSub.ts | 4 +- packages/effect/src/Pull.ts | 4 +- packages/effect/src/Queue.ts | 8 +- packages/effect/src/Random.ts | 2 +- packages/effect/src/{data => }/Record.ts | 120 ++++----- packages/effect/src/{data => }/Redacted.ts | 36 +-- packages/effect/src/{data => }/Reducer.ts | 0 packages/effect/src/Ref.ts | 10 +- packages/effect/src/References.ts | 2 +- packages/effect/src/RegExp.ts | 2 +- packages/effect/src/Request.ts | 2 +- packages/effect/src/RequestResolver.ts | 2 +- packages/effect/src/{data => }/Result.ts | 144 +++++----- packages/effect/src/Schedule.ts | 8 +- packages/effect/src/ScopedCache.ts | 4 +- packages/effect/src/ServiceMap.ts | 10 +- packages/effect/src/Sink.ts | 8 +- packages/effect/src/Stream.ts | 12 +- packages/effect/src/String.ts | 10 +- packages/effect/src/{data => }/Struct.ts | 50 ++-- packages/effect/src/SubscriptionRef.ts | 18 +- packages/effect/src/Symbol.ts | 4 +- packages/effect/src/SynchronizedRef.ts | 2 +- packages/effect/src/Tracer.ts | 4 +- packages/effect/src/{data => }/Tuple.ts | 42 +-- packages/effect/src/{data => }/UndefinedOr.ts | 4 +- packages/effect/src/Utils.ts | 6 +- packages/effect/src/collections/Array.ts | 50 ++-- packages/effect/src/collections/Chunk.ts | 44 ++-- packages/effect/src/collections/Graph.ts | 12 +- packages/effect/src/collections/HashMap.ts | 22 +- packages/effect/src/collections/HashRing.ts | 2 +- packages/effect/src/collections/HashSet.ts | 2 +- packages/effect/src/collections/Iterable.ts | 30 +-- .../effect/src/collections/MutableHashMap.ts | 8 +- .../effect/src/collections/MutableHashSet.ts | 2 +- packages/effect/src/collections/Trie.ts | 14 +- packages/effect/src/data/index.ts | 245 ------------------ packages/effect/src/data/index.ts.tpl | 3 - packages/effect/src/encoding/Base64.ts | 6 +- packages/effect/src/encoding/Base64Url.ts | 6 +- packages/effect/src/encoding/EncodingError.ts | 4 +- packages/effect/src/encoding/Hex.ts | 6 +- packages/effect/src/index.ts | 242 +++++++++++++++++ packages/effect/src/interfaces/Equal.ts | 4 +- packages/effect/src/interfaces/Hash.ts | 2 +- packages/effect/src/interfaces/Inspectable.ts | 8 +- packages/effect/src/interfaces/PrimaryKey.ts | 2 +- packages/effect/src/interfaces/Redactable.ts | 2 +- packages/effect/src/interfaces/index.ts | 2 +- packages/effect/src/internal/arbitrary.ts | 10 +- packages/effect/src/internal/core.ts | 4 +- packages/effect/src/internal/dateTime.ts | 10 +- packages/effect/src/internal/differ.ts | 2 +- packages/effect/src/internal/effect.ts | 12 +- packages/effect/src/internal/equivalence.ts | 4 +- packages/effect/src/internal/errors.ts | 2 +- packages/effect/src/internal/executionPlan.ts | 2 +- packages/effect/src/internal/hashMap.ts | 6 +- packages/effect/src/internal/hashSet.ts | 4 +- packages/effect/src/internal/json-schema.ts | 4 +- packages/effect/src/internal/matcher.ts | 6 +- packages/effect/src/internal/option.ts | 6 +- packages/effect/src/internal/redacted.ts | 2 +- packages/effect/src/internal/result.ts | 8 +- packages/effect/src/internal/schedule.ts | 2 +- .../src/internal/tracing/otlpExporter.ts | 2 +- packages/effect/src/internal/trie.ts | 8 +- packages/effect/src/platform/FileSystem.ts | 4 +- packages/effect/src/platform/PlatformError.ts | 2 +- packages/effect/src/platform/Terminal.ts | 2 +- packages/effect/src/schema/AST.ts | 12 +- packages/effect/src/schema/Annotations.ts | 4 +- packages/effect/src/schema/FromJsonSchema.ts | 10 +- packages/effect/src/schema/Getter.ts | 6 +- packages/effect/src/schema/Issue.ts | 6 +- packages/effect/src/schema/Parser.ts | 6 +- packages/effect/src/schema/Schema.ts | 30 +-- packages/effect/src/schema/Standard.ts | 8 +- packages/effect/src/schema/Transformation.ts | 4 +- packages/effect/src/stm/TxChunk.ts | 2 +- packages/effect/src/stm/TxHashMap.ts | 16 +- packages/effect/src/stm/TxHashSet.ts | 4 +- packages/effect/src/stm/TxQueue.ts | 6 +- packages/effect/src/testing/TestClock.ts | 6 +- packages/effect/src/testing/TestConsole.ts | 2 +- packages/effect/src/testing/TestSchema.ts | 4 +- packages/effect/src/types/HKT.ts | 2 +- packages/effect/src/unstable/ai/AiError.ts | 4 +- packages/effect/src/unstable/ai/Chat.ts | 4 +- .../effect/src/unstable/ai/IdGenerator.ts | 2 +- .../effect/src/unstable/ai/LanguageModel.ts | 4 +- packages/effect/src/unstable/ai/McpSchema.ts | 4 +- packages/effect/src/unstable/ai/McpServer.ts | 2 +- packages/effect/src/unstable/ai/Prompt.ts | 4 +- packages/effect/src/unstable/ai/Response.ts | 4 +- packages/effect/src/unstable/ai/Telemetry.ts | 4 +- packages/effect/src/unstable/ai/Tokenizer.ts | 2 +- packages/effect/src/unstable/ai/Tool.ts | 4 +- packages/effect/src/unstable/ai/Toolkit.ts | 2 +- packages/effect/src/unstable/cli/Argument.ts | 8 +- packages/effect/src/unstable/cli/CliError.ts | 2 +- packages/effect/src/unstable/cli/Command.ts | 2 +- packages/effect/src/unstable/cli/Flag.ts | 14 +- packages/effect/src/unstable/cli/Param.ts | 10 +- packages/effect/src/unstable/cli/Primitive.ts | 8 +- packages/effect/src/unstable/cli/Prompt.ts | 10 +- .../src/unstable/cli/internal/builtInFlags.ts | 2 +- .../src/unstable/cli/internal/command.ts | 2 +- .../src/unstable/cli/internal/config.ts | 2 +- .../src/unstable/cli/internal/parser.ts | 2 +- .../src/unstable/cluster/ClusterCron.ts | 2 +- .../src/unstable/cluster/ClusterError.ts | 2 +- .../unstable/cluster/ClusterWorkflowEngine.ts | 2 +- .../effect/src/unstable/cluster/DeliverAt.ts | 2 +- .../effect/src/unstable/cluster/Entity.ts | 6 +- .../effect/src/unstable/cluster/Envelope.ts | 4 +- .../src/unstable/cluster/K8sHttpClient.ts | 4 +- .../effect/src/unstable/cluster/Message.ts | 2 +- .../src/unstable/cluster/MessageStorage.ts | 8 +- packages/effect/src/unstable/cluster/Reply.ts | 6 +- .../effect/src/unstable/cluster/Sharding.ts | 4 +- .../src/unstable/cluster/ShardingConfig.ts | 2 +- .../cluster/ShardingRegistrationEvent.ts | 2 +- .../effect/src/unstable/cluster/Snowflake.ts | 2 +- .../src/unstable/cluster/SqlMessageStorage.ts | 2 +- .../cluster/internal/entityManager.ts | 4 +- .../unstable/cluster/internal/resourceMap.ts | 2 +- .../unstable/cluster/internal/resourceRef.ts | 2 +- .../effect/src/unstable/encoding/Msgpack.ts | 6 +- .../effect/src/unstable/encoding/Ndjson.ts | 4 +- packages/effect/src/unstable/encoding/Sse.ts | 6 +- packages/effect/src/unstable/http/Cookies.ts | 8 +- packages/effect/src/unstable/http/Headers.ts | 8 +- packages/effect/src/unstable/http/HttpBody.ts | 6 +- .../effect/src/unstable/http/HttpClient.ts | 6 +- .../src/unstable/http/HttpClientError.ts | 4 +- .../src/unstable/http/HttpClientRequest.ts | 6 +- .../effect/src/unstable/http/HttpEffect.ts | 2 +- .../src/unstable/http/HttpIncomingMessage.ts | 2 +- .../src/unstable/http/HttpMiddleware.ts | 4 +- .../effect/src/unstable/http/HttpRouter.ts | 4 +- .../src/unstable/http/HttpServerError.ts | 4 +- .../src/unstable/http/HttpServerRequest.ts | 4 +- .../unstable/http/HttpServerRespondable.ts | 2 +- .../src/unstable/http/HttpServerResponse.ts | 2 +- .../effect/src/unstable/http/Multipart.ts | 6 +- packages/effect/src/unstable/http/Template.ts | 2 +- .../effect/src/unstable/http/UrlParams.ts | 16 +- .../effect/src/unstable/httpapi/HttpApi.ts | 6 +- .../src/unstable/httpapi/HttpApiBuilder.ts | 12 +- .../src/unstable/httpapi/HttpApiClient.ts | 4 +- .../src/unstable/httpapi/HttpApiEndpoint.ts | 10 +- .../src/unstable/httpapi/HttpApiGroup.ts | 4 +- .../src/unstable/httpapi/HttpApiMiddleware.ts | 4 +- .../src/unstable/httpapi/HttpApiSecurity.ts | 2 +- .../effect/src/unstable/httpapi/OpenApi.ts | 2 +- .../src/unstable/jsonschema/Rewriter.ts | 12 +- .../unstable/observability/OtlpResource.ts | 2 +- .../src/unstable/persistence/KeyValueStore.ts | 10 +- .../unstable/persistence/PersistedQueue.ts | 2 +- .../src/unstable/process/ChildProcess.ts | 2 +- .../unstable/process/ChildProcessSpawner.ts | 2 +- .../src/unstable/reactivity/Reactivity.ts | 2 +- packages/effect/src/unstable/rpc/Rpc.ts | 4 +- packages/effect/src/unstable/rpc/RpcClient.ts | 6 +- packages/effect/src/unstable/rpc/RpcGroup.ts | 2 +- .../effect/src/unstable/rpc/RpcMessage.ts | 2 +- packages/effect/src/unstable/rpc/RpcSchema.ts | 2 +- .../src/unstable/rpc/RpcSerialization.ts | 4 +- packages/effect/src/unstable/rpc/RpcServer.ts | 6 +- packages/effect/src/unstable/schema/Model.ts | 6 +- .../src/unstable/schema/VariantSchema.ts | 6 +- packages/effect/src/unstable/socket/Socket.ts | 6 +- .../src/unstable/socket/SocketServer.ts | 2 +- packages/effect/src/unstable/sql/Migrator.ts | 8 +- packages/effect/src/unstable/sql/SqlClient.ts | 4 +- packages/effect/src/unstable/sql/SqlError.ts | 2 +- packages/effect/src/unstable/sql/Statement.ts | 2 +- .../src/unstable/workers/WorkerError.ts | 2 +- .../src/unstable/workflow/DurableDeferred.ts | 4 +- .../effect/src/unstable/workflow/Workflow.ts | 6 +- .../src/unstable/workflow/WorkflowEngine.ts | 2 +- packages/effect/test/{data => }/Brand.test.ts | 2 +- .../effect/test/{stream => }/Channel.test.ts | 0 .../effect/test/{data => }/Combiner.test.ts | 5 +- packages/effect/test/Deferred.test.ts | 3 +- packages/effect/test/Effect.test.ts | 3 +- packages/effect/test/Equal.test.ts | 2 +- .../test/{data => }/Equivalence.test.ts | 3 +- .../effect/test/{data => }/Formatter.test.ts | 6 +- packages/effect/test/HashMap.test.ts | 2 +- packages/effect/test/HttpClient.test.ts | 3 +- .../effect/test/{data => }/NullOr.test.ts | 5 +- packages/effect/test/Optic.test.ts | 3 +- .../effect/test/{data => }/Option.test.ts | 3 +- .../effect/test/{data => }/Ordering.test.ts | 2 +- .../effect/test/{data => }/Predicate.test.ts | 3 +- packages/effect/test/RcMap.test.ts | 3 +- .../effect/test/{data => }/Record.test.ts | 3 +- .../effect/test/{data => }/Redacted.test.ts | 2 +- .../effect/test/{data => }/Reducer.test.ts | 5 +- packages/effect/test/Ref.test.ts | 3 +- .../effect/test/{data => }/Result.test.ts | 5 +- .../effect/test/{stream => }/Sink.test.ts | 0 .../effect/test/{stream => }/Stream.test.ts | 22 +- .../effect/test/{data => }/Struct.test.ts | 5 +- .../test/{stream => }/SubscriptionRef.test.ts | 0 packages/effect/test/{data => }/Tuple.test.ts | 3 +- packages/effect/test/TxHashMap.test.ts | 2 +- packages/effect/test/TxQueue.test.ts | 3 +- .../test/{data => }/UndefinedOr.test.ts | 5 +- packages/effect/test/batching/Request.test.ts | 3 +- packages/effect/test/caching/Cache.test.ts | 3 +- .../effect/test/caching/ScopedCache.test.ts | 3 +- packages/effect/test/cluster/Sharding.test.ts | 3 +- .../effect/test/collections/Array.test.ts | 5 +- .../effect/test/collections/Chunk.test.ts | 4 +- .../effect/test/collections/Graph.test.ts | 2 +- .../effect/test/collections/Iterable.test.ts | 4 +- .../test/collections/MutableHashMap.test.ts | 3 +- .../test/collections/Pathfinding.test.ts | 2 +- packages/effect/test/collections/Trie.test.ts | 2 +- packages/effect/test/config/Config.test.ts | 3 +- .../effect/test/config/ConfigProvider.test.ts | 3 +- .../test/persistence/PersistedCacheTest.ts | 3 +- .../effect/test/schema/Equivalence.test.ts | 3 +- packages/effect/test/schema/Formatter.test.ts | 3 +- packages/effect/test/schema/Getter.test.ts | 3 +- packages/effect/test/schema/HMR.test.ts | 3 +- packages/effect/test/schema/Optic.test.ts | 3 +- packages/effect/test/schema/Schema.test.ts | 21 +- .../effect/test/schema/Serializer.test.ts | 3 +- .../test/schema/toStandardSchemaV1.test.ts | 3 +- packages/effect/test/schema/v3-v4.test.ts | 2 +- .../effect/test/testing/TestSchema.test.ts | 3 +- packages/effect/test/time/Cron.test.ts | 3 +- packages/effect/test/time/DateTime.test.ts | 3 +- packages/effect/test/unstable/ai/Chat.test.ts | 3 +- packages/effect/test/unstable/ai/utils.ts | 3 +- .../test/unstable/cli/Arguments.test.ts | 3 +- .../effect/test/unstable/cli/Command.test.ts | 3 +- .../test/unstable/cli/Primitive.test.ts | 3 +- .../unstable/cli/fixtures/ComprehensiveCli.ts | 3 +- .../observability/OtlpMetrics.test.ts | 3 +- .../persistence/KeyValueStore.test.ts | 3 +- packages/effect/test/utils/assert.ts | 2 +- packages/platform-browser/src/Clipboard.ts | 2 +- packages/platform-browser/src/Geolocation.ts | 2 +- packages/platform-browser/src/Permissions.ts | 2 +- .../platform-browser/test/fixtures/rpc-e2e.ts | 3 +- .../test/fixtures/rpc-schemas.ts | 3 +- packages/platform-bun/src/BunHttpServer.ts | 2 +- .../src/NodeChildProcessSpawner.ts | 2 +- .../src/NodeFileSystem.ts | 2 +- .../platform-node-shared/src/NodeTerminal.ts | 2 +- .../test/NodeFileSystem.test.ts | 2 +- .../test/NodeSink.test.ts | 2 +- packages/platform-node/src/NodeHttpServer.ts | 2 +- packages/platform-node/test/HttpApi.test.ts | 3 +- .../platform-node/test/NodeHttpClient.test.ts | 2 +- .../test/fixtures/mysql2-utils.ts | 3 +- .../platform-node/test/fixtures/pg-utils.ts | 3 +- .../platform-node/test/fixtures/rpc-e2e.ts | 3 +- .../test/fixtures/rpc-schemas.ts | 3 +- packages/sql/d1/test/utils.ts | 3 +- packages/sql/libsql/src/LibsqlClient.ts | 4 +- packages/sql/mssql/src/MssqlClient.ts | 2 +- packages/sql/mysql2/src/MysqlClient.ts | 2 +- packages/sql/mysql2/test/utils.ts | 3 +- packages/sql/pg/src/PgClient.ts | 2 +- packages/sql/pg/test/Client.test.ts | 3 +- packages/sql/pg/test/utils.ts | 3 +- .../openapi-generator/src/OpenApiGenerator.ts | 2 +- .../src/OpenApiTransformer.ts | 6 +- packages/tools/openapi-generator/src/Utils.ts | 2 +- packages/vitest/src/internal/internal.ts | 2 +- packages/vitest/src/utils.ts | 6 +- 333 files changed, 1522 insertions(+), 1562 deletions(-) rename packages/effect/src/{data => }/Brand.ts (97%) rename packages/effect/src/{data => }/Combiner.ts (100%) rename packages/effect/src/{data => }/Data.ts (96%) rename packages/effect/src/{data => }/Equivalence.ts (96%) rename packages/effect/src/{data => }/Filter.ts (96%) rename packages/effect/src/{data => }/Formatter.ts (97%) rename packages/effect/src/{data => }/NullOr.ts (98%) rename packages/effect/src/{data => }/Option.ts (95%) rename packages/effect/src/{data => }/Order.ts (94%) rename packages/effect/src/{data => }/Ordering.ts (96%) rename packages/effect/src/{data => }/Predicate.ts (93%) rename packages/effect/src/{data => }/Record.ts (94%) rename packages/effect/src/{data => }/Redacted.ts (86%) rename packages/effect/src/{data => }/Reducer.ts (100%) rename packages/effect/src/{data => }/Result.ts (92%) rename packages/effect/src/{data => }/Struct.ts (94%) rename packages/effect/src/{data => }/Tuple.ts (93%) rename packages/effect/src/{data => }/UndefinedOr.ts (98%) delete mode 100644 packages/effect/src/data/index.ts delete mode 100644 packages/effect/src/data/index.ts.tpl rename packages/effect/test/{data => }/Brand.test.ts (99%) rename packages/effect/test/{stream => }/Channel.test.ts (100%) rename packages/effect/test/{data => }/Combiner.test.ts (87%) rename packages/effect/test/{data => }/Equivalence.test.ts (98%) rename packages/effect/test/{data => }/Formatter.test.ts (97%) rename packages/effect/test/{data => }/NullOr.test.ts (93%) rename packages/effect/test/{data => }/Option.test.ts (94%) rename packages/effect/test/{data => }/Ordering.test.ts (92%) rename packages/effect/test/{data => }/Predicate.test.ts (99%) rename packages/effect/test/{data => }/Record.test.ts (99%) rename packages/effect/test/{data => }/Redacted.test.ts (98%) rename packages/effect/test/{data => }/Reducer.test.ts (70%) rename packages/effect/test/{data => }/Result.test.ts (98%) rename packages/effect/test/{stream => }/Sink.test.ts (100%) rename packages/effect/test/{stream => }/Stream.test.ts (99%) rename packages/effect/test/{data => }/Struct.test.ts (97%) rename packages/effect/test/{stream => }/SubscriptionRef.test.ts (100%) rename packages/effect/test/{data => }/Tuple.test.ts (97%) rename packages/effect/test/{data => }/UndefinedOr.test.ts (94%) diff --git a/bundle/brand.ts b/bundle/brand.ts index 74e5b3be5b..3be3dcc5b4 100644 --- a/bundle/brand.ts +++ b/bundle/brand.ts @@ -1,4 +1,4 @@ -import * as Brand from "#dist/effect/data/Brand" +import * as Brand from "#dist/effect/Brand" import * as Schema from "#dist/effect/schema/Schema" type Positive = number & Brand.Brand<"Positive"> diff --git a/packages/effect/dtslint/Optic.tst.ts b/packages/effect/dtslint/Optic.tst.ts index 81d512f1f4..7c71a2947a 100644 --- a/packages/effect/dtslint/Optic.tst.ts +++ b/packages/effect/dtslint/Optic.tst.ts @@ -1,5 +1,5 @@ import { Optic } from "effect" -import type { Option, Result } from "effect/data" +import type { Option, Result } from "effect" import { AST, Schema } from "effect/schema" import { describe, expect, it } from "tstyche" diff --git a/packages/effect/dtslint/data/Brand.tst.ts b/packages/effect/dtslint/data/Brand.tst.ts index b614680c27..05dcaa167d 100644 --- a/packages/effect/dtslint/data/Brand.tst.ts +++ b/packages/effect/dtslint/data/Brand.tst.ts @@ -1,4 +1,4 @@ -import { Brand } from "effect/data" +import { Brand } from "effect" import { Schema } from "effect/schema" import { describe, expect, it } from "tstyche" diff --git a/packages/effect/dtslint/data/Option.tst.ts b/packages/effect/dtslint/data/Option.tst.ts index cd58f07529..90699a12ee 100644 --- a/packages/effect/dtslint/data/Option.tst.ts +++ b/packages/effect/dtslint/data/Option.tst.ts @@ -1,6 +1,5 @@ -import { pipe } from "effect" -import type { Predicate } from "effect/data" -import { Option } from "effect/data" +import { Option, pipe } from "effect" +import type { Predicate } from "effect" import { describe, expect, it } from "tstyche" declare const number: Option.Option diff --git a/packages/effect/dtslint/data/Struct.tst.ts b/packages/effect/dtslint/data/Struct.tst.ts index c7e6c89313..1b0b39cf2c 100644 --- a/packages/effect/dtslint/data/Struct.tst.ts +++ b/packages/effect/dtslint/data/Struct.tst.ts @@ -1,6 +1,5 @@ -import { hole, Number, pipe, String as Str } from "effect" -import type { Reducer } from "effect/data" -import { Struct } from "effect/data" +import { hole, Number, pipe, String as Str, Struct } from "effect" +import type { Reducer } from "effect" import { Schema } from "effect/schema" import { describe, expect, it, when } from "tstyche" diff --git a/packages/effect/dtslint/data/Tuple.tst.ts b/packages/effect/dtslint/data/Tuple.tst.ts index 161d1aa86f..94baceca92 100644 --- a/packages/effect/dtslint/data/Tuple.tst.ts +++ b/packages/effect/dtslint/data/Tuple.tst.ts @@ -1,6 +1,5 @@ -import { Number, pipe, String as Str } from "effect" -import { Tuple } from "effect/data" -import type { Reducer } from "effect/data" +import { Number, pipe, String as Str, Tuple } from "effect" +import type { Reducer } from "effect" import { Schema } from "effect/schema" import { describe, expect, it, when } from "tstyche" diff --git a/packages/effect/dtslint/schema/Annotations.tst.ts b/packages/effect/dtslint/schema/Annotations.tst.ts index c89c0bd98c..d28de16108 100644 --- a/packages/effect/dtslint/schema/Annotations.tst.ts +++ b/packages/effect/dtslint/schema/Annotations.tst.ts @@ -1,4 +1,4 @@ -import type { Option } from "effect/data" +import type { Option } from "effect" import { Annotations, Schema } from "effect/schema" import { describe, expect, it } from "tstyche" diff --git a/packages/effect/dtslint/schema/Literals.tst.ts b/packages/effect/dtslint/schema/Literals.tst.ts index 55975469ad..0f6cf05339 100644 --- a/packages/effect/dtslint/schema/Literals.tst.ts +++ b/packages/effect/dtslint/schema/Literals.tst.ts @@ -1,4 +1,4 @@ -import { Tuple } from "effect/data" +import { Tuple } from "effect" import { Schema } from "effect/schema" import { describe, expect, it } from "tstyche" diff --git a/packages/effect/dtslint/schema/Schema.tst.ts b/packages/effect/dtslint/schema/Schema.tst.ts index 0ad23a91d6..c75b9d3f0f 100644 --- a/packages/effect/dtslint/schema/Schema.tst.ts +++ b/packages/effect/dtslint/schema/Schema.tst.ts @@ -1,5 +1,4 @@ -import { Brand, Option, Predicate, Tuple, Struct } from "effect/data" -import { ServiceMap, Effect, hole } from "effect" +import { Brand, Option, Predicate, Tuple, Struct, ServiceMap, Effect, hole } from "effect" import type { AST} from 'effect/schema'; import { Getter, Schema, Transformation } from 'effect/schema' import { immerable, produce } from "immer" diff --git a/packages/effect/dtslint/schema/Struct.tst.ts b/packages/effect/dtslint/schema/Struct.tst.ts index 1bafdeebfd..13c66aa025 100644 --- a/packages/effect/dtslint/schema/Struct.tst.ts +++ b/packages/effect/dtslint/schema/Struct.tst.ts @@ -1,6 +1,5 @@ -import { flow, String as Str } from "effect" -import type { Brand } from "effect/data" -import { Struct } from "effect/data" +import { flow, String as Str, Struct } from "effect" +import type { Brand } from "effect" import type { AST } from "effect/schema" import { Schema } from "effect/schema" import { describe, expect, it, when } from "tstyche" diff --git a/packages/effect/dtslint/schema/Tuple.tst.ts b/packages/effect/dtslint/schema/Tuple.tst.ts index 510d738443..e61eda4874 100644 --- a/packages/effect/dtslint/schema/Tuple.tst.ts +++ b/packages/effect/dtslint/schema/Tuple.tst.ts @@ -1,4 +1,4 @@ -import { Option, Tuple } from "effect/data" +import { Option, Tuple } from "effect" import { Schema } from "effect/schema" import { describe, expect, it } from "tstyche" diff --git a/packages/effect/dtslint/schema/Union.tst.ts b/packages/effect/dtslint/schema/Union.tst.ts index 58cd6788fa..3a08d5b300 100644 --- a/packages/effect/dtslint/schema/Union.tst.ts +++ b/packages/effect/dtslint/schema/Union.tst.ts @@ -1,5 +1,5 @@ +import { Tuple } from "effect" import type { Array as Arr } from "effect/collections" -import { Tuple } from "effect/data" import { Schema } from "effect/schema" import { describe, expect, it } from "tstyche" diff --git a/packages/effect/dtslint/schema/api.tst.ts b/packages/effect/dtslint/schema/api.tst.ts index 7002233c9b..f090f35cd6 100644 --- a/packages/effect/dtslint/schema/api.tst.ts +++ b/packages/effect/dtslint/schema/api.tst.ts @@ -1,6 +1,5 @@ -import type { Effect, Exit } from "effect" +import type { Effect, Exit, Option } from "effect" import { hole } from "effect" -import type { Option } from "effect/data" import { Schema } from "effect/schema" import { describe, expect, it } from "tstyche" diff --git a/packages/effect/dtslint/schema/toIso.tst.ts b/packages/effect/dtslint/schema/toIso.tst.ts index 7f665a5429..e8e7196b9f 100644 --- a/packages/effect/dtslint/schema/toIso.tst.ts +++ b/packages/effect/dtslint/schema/toIso.tst.ts @@ -1,6 +1,5 @@ -import type { Cause, Exit, Optic } from "effect" -import type { Brand, Option } from "effect/data" -import { Data } from "effect/data" +import type { Brand, Cause, Exit, Optic, Option } from "effect" +import { Data } from "effect" import { Schema, Util } from "effect/schema" import { describe, expect, it } from "tstyche" diff --git a/packages/effect/dtslint/types/Types.tst.ts b/packages/effect/dtslint/types/Types.tst.ts index 4f6464c6d2..1e0fb51ca9 100644 --- a/packages/effect/dtslint/types/Types.tst.ts +++ b/packages/effect/dtslint/types/Types.tst.ts @@ -1,4 +1,4 @@ -import type { Brand } from "effect/data" +import type { Brand } from "effect" import type { Types } from "effect/types" import { describe, expect, it } from "tstyche" diff --git a/packages/effect/package.json b/packages/effect/package.json index 579858e2bb..9bdfe251e5 100644 --- a/packages/effect/package.json +++ b/packages/effect/package.json @@ -30,7 +30,6 @@ "./package.json": "./package.json", ".": "./src/index.ts", "./collections": "./src/collections/index.ts", - "./data": "./src/data/index.ts", "./encoding": "./src/encoding/index.ts", "./interfaces": "./src/interfaces/index.ts", "./optic": "./src/optic/index.ts", @@ -74,7 +73,6 @@ "./package.json": "./package.json", ".": "./dist/index.js", "./collections": "./dist/collections/index.js", - "./data": "./dist/data/index.js", "./encoding": "./dist/encoding/index.js", "./interfaces": "./dist/interfaces/index.js", "./optic": "./dist/optic/index.js", diff --git a/packages/effect/src/BigDecimal.ts b/packages/effect/src/BigDecimal.ts index daaca63c3e..7a665913b7 100644 --- a/packages/effect/src/BigDecimal.ts +++ b/packages/effect/src/BigDecimal.ts @@ -14,15 +14,15 @@ * @since 2.0.0 */ -import * as equivalence from "./data/Equivalence.ts" -import * as order from "./data/Order.ts" -import type { Ordering } from "./data/Ordering.ts" -import { hasProperty } from "./data/Predicate.ts" +import * as equivalence from "./Equivalence.ts" import { dual } from "./Function.ts" import * as Equal from "./interfaces/Equal.ts" import * as Hash from "./interfaces/Hash.ts" import { type Inspectable, NodeInspectSymbol } from "./interfaces/Inspectable.ts" import { type Pipeable, pipeArguments } from "./interfaces/Pipeable.ts" +import * as order from "./Order.ts" +import type { Ordering } from "./Ordering.ts" +import { hasProperty } from "./Predicate.ts" const DEFAULT_PRECISION = 100 const FINITE_INT_REGEXP = /^[+-]?\d+$/ diff --git a/packages/effect/src/BigInt.ts b/packages/effect/src/BigInt.ts index 724aabb405..e7e75bb0d8 100644 --- a/packages/effect/src/BigInt.ts +++ b/packages/effect/src/BigInt.ts @@ -6,12 +6,12 @@ * @since 2.0.0 */ -import * as Combiner from "./data/Combiner.ts" -import * as order from "./data/Order.ts" -import type { Ordering } from "./data/Ordering.ts" -import * as predicate from "./data/Predicate.ts" -import * as Reducer from "./data/Reducer.ts" +import * as Combiner from "./Combiner.ts" import { dual } from "./Function.ts" +import * as order from "./Order.ts" +import type { Ordering } from "./Ordering.ts" +import * as predicate from "./Predicate.ts" +import * as Reducer from "./Reducer.ts" /** * Reference to the global BigInt constructor. diff --git a/packages/effect/src/Boolean.ts b/packages/effect/src/Boolean.ts index d93634a63b..3f49f547e4 100644 --- a/packages/effect/src/Boolean.ts +++ b/packages/effect/src/Boolean.ts @@ -5,11 +5,11 @@ * * @since 2.0.0 */ -import * as order from "./data/Order.ts" -import * as predicate from "./data/Predicate.ts" -import * as Reducer from "./data/Reducer.ts" import type { LazyArg } from "./Function.ts" import { dual } from "./Function.ts" +import * as order from "./Order.ts" +import * as predicate from "./Predicate.ts" +import * as Reducer from "./Reducer.ts" /** * Reference to the global Boolean constructor. diff --git a/packages/effect/src/data/Brand.ts b/packages/effect/src/Brand.ts similarity index 97% rename from packages/effect/src/data/Brand.ts rename to packages/effect/src/Brand.ts index b4801e7669..8ca905c340 100644 --- a/packages/effect/src/data/Brand.ts +++ b/packages/effect/src/Brand.ts @@ -5,12 +5,12 @@ * * @since 2.0.0 */ -import * as Arr from "../collections/Array.ts" -import * as AST from "../schema/AST.ts" -import type * as Issue from "../schema/Issue.ts" -import type * as Types from "../types/Types.ts" +import * as Arr from "./collections/Array.ts" import * as Option from "./Option.ts" import * as Result from "./Result.ts" +import * as AST from "./schema/AST.ts" +import type * as Issue from "./schema/Issue.ts" +import type * as Types from "./types/Types.ts" const TypeId = "~effect/data/Brand" diff --git a/packages/effect/src/Cache.ts b/packages/effect/src/Cache.ts index bf5964eaad..bec6a76012 100644 --- a/packages/effect/src/Cache.ts +++ b/packages/effect/src/Cache.ts @@ -3,8 +3,6 @@ */ import * as Iterable from "./collections/Iterable.ts" import * as MutableHashMap from "./collections/MutableHashMap.ts" -import * as Option from "./data/Option.ts" -import type { Predicate } from "./data/Predicate.ts" import * as Deferred from "./Deferred.ts" import * as Duration from "./Duration.ts" import type * as Effect from "./Effect.ts" @@ -15,6 +13,8 @@ import type { Pipeable } from "./interfaces/Pipeable.ts" import * as core from "./internal/core.ts" import { PipeInspectableProto } from "./internal/core.ts" import * as effect from "./internal/effect.ts" +import * as Option from "./Option.ts" +import type { Predicate } from "./Predicate.ts" import * as ServiceMap from "./ServiceMap.ts" const TypeId = "~effect/Cache" @@ -68,7 +68,7 @@ const TypeId = "~effect/Cache" * @example * ```ts * import { Cache, Effect } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * import { Duration } from "effect" * * // Cache with complex key types and TTL diff --git a/packages/effect/src/Cause.ts b/packages/effect/src/Cause.ts index b2217963b3..09f79cd26e 100644 --- a/packages/effect/src/Cause.ts +++ b/packages/effect/src/Cause.ts @@ -39,8 +39,8 @@ * * @since 2.0.0 */ -import type * as Filter from "./data/Filter.ts" import type * as Effect from "./Effect.ts" +import type * as Filter from "./Filter.ts" import type { Equal } from "./interfaces/Equal.ts" import type { Inspectable } from "./interfaces/Inspectable.ts" import type { Pipeable } from "./interfaces/Pipeable.ts" diff --git a/packages/effect/src/Channel.ts b/packages/effect/src/Channel.ts index be2161b6dd..c080e1a021 100644 --- a/packages/effect/src/Channel.ts +++ b/packages/effect/src/Channel.ts @@ -63,12 +63,10 @@ import * as Cause from "./Cause.ts" import * as Arr from "./collections/Array.ts" import * as Chunk from "./collections/Chunk.ts" import * as Iterable from "./collections/Iterable.ts" -import * as Filter from "./data/Filter.ts" -import * as Option from "./data/Option.ts" -import { hasProperty, isTagged } from "./data/Predicate.ts" import * as Effect from "./Effect.ts" import * as Exit from "./Exit.ts" import * as Fiber from "./Fiber.ts" +import * as Filter from "./Filter.ts" import type { LazyArg } from "./Function.ts" import { constant, constTrue, constVoid, dual, identity as identity_ } from "./Function.ts" import type { Pipeable } from "./interfaces/Pipeable.ts" @@ -76,6 +74,8 @@ import { pipeArguments } from "./interfaces/Pipeable.ts" import { endSpan } from "./internal/effect.ts" import { addSpanStackTrace } from "./internal/tracer.ts" import * as Layer from "./Layer.ts" +import * as Option from "./Option.ts" +import { hasProperty, isTagged } from "./Predicate.ts" import * as PubSub from "./PubSub.ts" import * as Pull from "./Pull.ts" import * as Queue from "./Queue.ts" @@ -1013,7 +1013,7 @@ export const die = (defect: unknown): Channel => failCause( * ```ts * import { Effect } from "effect" * import { Channel } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class DatabaseError extends Data.TaggedError("DatabaseError")<{ * readonly message: string @@ -1084,7 +1084,7 @@ export const fromEffectTake = ( * ```ts * import { Effect } from "effect" * import { Channel } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * import { Queue } from "effect" * * class QueueError extends Data.TaggedError("QueueError")<{ @@ -1129,7 +1129,7 @@ export const fromQueue = ( * ```ts * import { Effect } from "effect" * import { Channel } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * import { Queue } from "effect" * * class ProcessingError extends Data.TaggedError("ProcessingError")<{ @@ -1184,7 +1184,7 @@ export const identity = (): Channel( * ```ts * import { Effect } from "effect" * import { Channel } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * import { PubSub } from "effect" * * class StreamError extends Data.TaggedError("StreamError")<{ @@ -1270,7 +1270,7 @@ export const fromSubscription = ( * ```ts * import { Effect } from "effect" * import { Channel } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * import { PubSub } from "effect" * * class BatchProcessingError extends Data.TaggedError("BatchProcessingError")<{ @@ -1298,7 +1298,7 @@ export const fromSubscription = ( * ```ts * import { Effect } from "effect" * import { Channel } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * import { PubSub } from "effect" * * class MetricsError extends Data.TaggedError("MetricsError")<{ @@ -1355,7 +1355,7 @@ export const fromSubscriptionArray = ( * ```ts * import { Effect } from "effect" * import { Channel } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * import { PubSub } from "effect" * * class StreamError extends Data.TaggedError("StreamError")<{ @@ -1382,7 +1382,7 @@ export const fromSubscriptionArray = ( * ```ts * import { Effect } from "effect" * import { Channel } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * import { PubSub } from "effect" * * class NotificationError extends Data.TaggedError("NotificationError")<{ @@ -1410,7 +1410,7 @@ export const fromSubscriptionArray = ( * ```ts * import { Effect } from "effect" * import { Channel } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * import { PubSub } from "effect" * * class EventProcessingError extends Data.TaggedError("EventProcessingError")<{ @@ -1467,7 +1467,7 @@ export const fromPubSub = ( * ```ts * import { Effect } from "effect" * import { Channel } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * import { PubSub } from "effect" * * class BatchError extends Data.TaggedError("BatchError")<{ @@ -1495,7 +1495,7 @@ export const fromPubSub = ( * ```ts * import { Effect } from "effect" * import { Channel } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * import { PubSub } from "effect" * * class OrderProcessingError extends Data.TaggedError("OrderProcessingError")<{ @@ -1538,7 +1538,7 @@ export const fromPubSub = ( * ```ts * import { Effect } from "effect" * import { Channel } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * import { PubSub } from "effect" * * class LogProcessingError extends Data.TaggedError("LogProcessingError")<{ @@ -1653,7 +1653,7 @@ export const fromAsyncIterableArray = ( * ```ts * import { Effect } from "effect" * import { Channel } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class TransformError extends Data.TaggedError("TransformError")<{ * readonly reason: string @@ -1777,7 +1777,7 @@ const concurrencyIsSequential = ( * ```ts * import { Effect } from "effect" * import { Channel } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class NetworkError extends Data.TaggedError("NetworkError")<{ * readonly url: string @@ -2041,7 +2041,7 @@ export const mapInputError: { * import { Effect } from "effect" * import { Channel } from "effect" * import { Console } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class LogError extends Data.TaggedError("LogError")<{ * readonly message: string @@ -2101,7 +2101,7 @@ export const tap: { * ```ts * import { Effect } from "effect" * import { Channel } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class ProcessError extends Data.TaggedError("ProcessError")<{ * readonly cause: string @@ -2306,7 +2306,7 @@ const flatMapConcurrent = < * ```ts * import { Effect } from "effect" * import { Channel } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class ConcatError extends Data.TaggedError("ConcatError")<{ * readonly reason: string @@ -2422,7 +2422,7 @@ export const concatWith: { * ```ts * import { Effect } from "effect" * import { Channel } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class ConcatError extends Data.TaggedError("ConcatError")<{ * readonly reason: string @@ -2729,7 +2729,7 @@ export const orElseIfEmpty: { * ```ts * import { Effect } from "effect" * import { Channel } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class FlattenError extends Data.TaggedError("FlattenError")<{ * readonly cause: string @@ -2785,7 +2785,7 @@ export const flatten = < * ```ts * import { Effect } from "effect" * import { Channel } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class FlattenError extends Data.TaggedError("FlattenError")<{ * readonly message: string @@ -3063,7 +3063,7 @@ export const filter: { * @example * ```ts * import { Array } from "effect/collections" - * import { Filter } from "effect/data" + * import { Filter } from "effect" * import { Channel } from "effect" * * const nonEmptyArrayFilter: Filter.Filter< @@ -3347,7 +3347,7 @@ export const scan: { * ```ts * import { Channel } from "effect" * import { Effect } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class ScanError extends Data.TaggedError("ScanError")<{ * readonly reason: string @@ -3437,7 +3437,7 @@ export const scanEffect: { * ```ts * import { Effect, Cause } from "effect" * import { Channel } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class ProcessError extends Data.TaggedError("ProcessError")<{ * readonly reason: string @@ -4108,7 +4108,7 @@ export const mapError: { * ```ts * import { Effect } from "effect" * import { Channel } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class ValidationError extends Data.TaggedError("ValidationError")<{ * readonly field: string @@ -4239,7 +4239,7 @@ export const retry: { * ```ts * import { Effect } from "effect" * import { Channel } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class SwitchError extends Data.TaggedError("SwitchError")<{ * readonly reason: string @@ -4358,7 +4358,7 @@ export const switchMap: { * ```ts * import { Effect } from "effect" * import { Channel } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class MergeAllError extends Data.TaggedError("MergeAllError")<{ * readonly reason: string @@ -4547,7 +4547,7 @@ export type HaltStrategy = "left" | "right" | "both" | "either" * ```ts * import { Effect } from "effect" * import { Channel } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class MergeError extends Data.TaggedError("MergeError")<{ * readonly source: string @@ -4865,7 +4865,7 @@ export const encodeText = (): Channel< * ```ts * import { Effect } from "effect" * import { Channel } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class PipeError extends Data.TaggedError("PipeError")<{ * readonly stage: string @@ -4914,7 +4914,7 @@ export const pipeTo: { * ```ts * import { Effect } from "effect" * import { Channel } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class SourceError extends Data.TaggedError("SourceError")<{ * readonly code: number @@ -4977,7 +4977,7 @@ export const pipeToOrFail: { * ```ts * import { Effect } from "effect" * import { Channel } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * import { Scope } from "effect" * * class UnwrapError extends Data.TaggedError("UnwrapError")<{ @@ -5029,7 +5029,7 @@ export const scoped = ( * ```ts * import { Effect } from "effect" * import { Channel } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class EmbedError extends Data.TaggedError("EmbedError")<{ * readonly stage: string @@ -5264,7 +5264,7 @@ export const onError: { * import { Effect, Exit } from "effect" * import { Channel } from "effect" * import { Console } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class ExitError extends Data.TaggedError("ExitError")<{ * readonly stage: string @@ -5387,7 +5387,7 @@ export const onEnd: { * import { Effect } from "effect" * import { Channel } from "effect" * import { Console } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class EnsureError extends Data.TaggedError("EnsureError")<{ * readonly operation: string @@ -5855,7 +5855,7 @@ export const bindTo: { * ```ts * import { Effect } from "effect" * import { Channel } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class CountError extends Data.TaggedError("CountError")<{ * readonly reason: string @@ -5884,7 +5884,7 @@ export const runCount = ( * ```ts * import { Effect } from "effect" * import { Channel } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class DrainError extends Data.TaggedError("DrainError")<{ * readonly stage: string @@ -5915,7 +5915,7 @@ export const runDrain = ( * import { Effect } from "effect" * import { Channel } from "effect" * import { Console } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class ForEachError extends Data.TaggedError("ForEachError")<{ * readonly element: unknown @@ -5989,7 +5989,7 @@ export const runForEachWhile: { * ```ts * import { Effect } from "effect" * import { Channel } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class CollectError extends Data.TaggedError("CollectError")<{ * readonly reason: string @@ -6075,7 +6075,7 @@ export const runLast = ( * ```ts * import { Effect } from "effect" * import { Channel } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class FoldError extends Data.TaggedError("FoldError")<{ * readonly operation: string @@ -6173,7 +6173,7 @@ export const runFoldEffect: { * ```ts * import { Effect } from "effect" * import { Channel } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * import { Scope } from "effect" * * class PullError extends Data.TaggedError("PullError")<{ @@ -6224,7 +6224,7 @@ export const toPull: ( * ```ts * import { Effect } from "effect" * import { Channel } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * import { Scope } from "effect" * * class ScopedPullError extends Data.TaggedError("ScopedPullError")<{ @@ -6317,7 +6317,7 @@ export const runIntoQueueArray: { * ```ts * import { Effect } from "effect" * import { Channel } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * import { Queue } from "effect" * * class QueueError extends Data.TaggedError("QueueError")<{ diff --git a/packages/effect/src/data/Combiner.ts b/packages/effect/src/Combiner.ts similarity index 100% rename from packages/effect/src/data/Combiner.ts rename to packages/effect/src/Combiner.ts diff --git a/packages/effect/src/Config.ts b/packages/effect/src/Config.ts index d209c729fd..bfe4095f68 100644 --- a/packages/effect/src/Config.ts +++ b/packages/effect/src/Config.ts @@ -3,15 +3,15 @@ */ import type { Path, SourceError } from "./ConfigProvider.ts" import * as ConfigProvider from "./ConfigProvider.ts" -import * as Option from "./data/Option.ts" -import * as Predicate from "./data/Predicate.ts" -import * as Rec from "./data/Record.ts" import * as Duration_ from "./Duration.ts" import * as Effect from "./Effect.ts" import { dual, type LazyArg } from "./Function.ts" import type { Pipeable } from "./interfaces/Pipeable.ts" import { PipeInspectableProto, YieldableProto } from "./internal/core.ts" import * as LogLevel_ from "./LogLevel.ts" +import * as Option from "./Option.ts" +import * as Predicate from "./Predicate.ts" +import * as Rec from "./Record.ts" import * as AST from "./schema/AST.ts" import * as Getter from "./schema/Getter.ts" import * as Issue from "./schema/Issue.ts" diff --git a/packages/effect/src/ConfigProvider.ts b/packages/effect/src/ConfigProvider.ts index ca632a2d2c..3e551d9f14 100644 --- a/packages/effect/src/ConfigProvider.ts +++ b/packages/effect/src/ConfigProvider.ts @@ -2,10 +2,9 @@ * @since 4.0.0 */ -import * as Data from "./data/Data.ts" -import { format } from "./data/Formatter.ts" -import * as Predicate from "./data/Predicate.ts" +import * as Data from "./Data.ts" import * as Effect from "./Effect.ts" +import { format } from "./Formatter.ts" import { dual, flow } from "./Function.ts" import type { Pipeable } from "./interfaces/Pipeable.ts" import { PipeInspectableProto } from "./internal/core.ts" @@ -13,6 +12,7 @@ import * as Layer from "./Layer.ts" import * as FileSystem from "./platform/FileSystem.ts" import * as Path_ from "./platform/Path.ts" import type { PlatformError } from "./platform/PlatformError.ts" +import * as Predicate from "./Predicate.ts" import type { Scope } from "./Scope.ts" import * as ServiceMap from "./ServiceMap.ts" import * as Str from "./String.ts" diff --git a/packages/effect/src/Cron.ts b/packages/effect/src/Cron.ts index a866648cfd..d9630e52aa 100644 --- a/packages/effect/src/Cron.ts +++ b/packages/effect/src/Cron.ts @@ -2,13 +2,10 @@ * @since 2.0.0 */ import * as Arr from "./collections/Array.ts" -import * as Data from "./data/Data.ts" -import * as equivalence from "./data/Equivalence.ts" -import { format } from "./data/Formatter.ts" -import { hasProperty } from "./data/Predicate.ts" -import * as Result from "./data/Result.ts" -import * as UndefinedOr from "./data/UndefinedOr.ts" +import * as Data from "./Data.ts" import type * as DateTime from "./DateTime.ts" +import * as equivalence from "./Equivalence.ts" +import { format } from "./Formatter.ts" import { constVoid, dual, pipe } from "./Function.ts" import * as Equal from "./interfaces/Equal.ts" import * as Hash from "./interfaces/Hash.ts" @@ -16,8 +13,11 @@ import { type Inspectable, NodeInspectSymbol } from "./interfaces/Inspectable.ts import { type Pipeable, pipeArguments } from "./interfaces/Pipeable.ts" import * as dateTime from "./internal/dateTime.ts" import * as N from "./Number.ts" +import { hasProperty } from "./Predicate.ts" +import * as Result from "./Result.ts" import * as String from "./String.ts" import type { Mutable } from "./types/Types.ts" +import * as UndefinedOr from "./UndefinedOr.ts" const TypeId = "~effect/time/Cron" @@ -367,7 +367,7 @@ const CronParseErrorTypeId = "~effect/time/Cron/CronParseError" * @example * ```ts * import { Cron } from "effect" - * import { Result } from "effect/data" + * import { Result } from "effect" * * const result = Cron.parse("invalid expression") * if (Result.isFailure(result)) { @@ -401,7 +401,7 @@ export class CronParseError extends Data.TaggedError("CronParseError")<{ * @example * ```ts * import { Cron } from "effect" - * import { Result } from "effect/data" + * import { Result } from "effect" * * const result = Cron.parse("invalid cron expression") * if (Result.isFailure(result)) { @@ -426,7 +426,7 @@ export const isCronParseError = (u: unknown): u is CronParseError => hasProperty * @example * ```ts * import { Cron } from "effect" - * import { Result } from "effect/data" + * import { Result } from "effect" * import * as assert from "node:assert" * * // At 04:00 on every day-of-month from 8 through 14. @@ -512,7 +512,7 @@ export const parseUnsafe = (cron: string, tz?: DateTime.TimeZone | string): Cron * @example * ```ts * import { Cron } from "effect" - * import { Result } from "effect/data" + * import { Result } from "effect" * * const cron = Result.getOrThrow(Cron.parse("0 0 4 8-14 * *")) * @@ -579,7 +579,7 @@ const daysInMonth = (date: Date): number => * @example * ```ts * import { Cron } from "effect" - * import { Result } from "effect/data" + * import { Result } from "effect" * * const cron = Result.getOrThrow(Cron.parse("0 0 4 8-14 * *")) * @@ -728,7 +728,7 @@ export const next = (cron: Cron, now?: DateTime.DateTime.Input): Date => { * @example * ```ts * import { Cron } from "effect" - * import { Result } from "effect/data" + * import { Result } from "effect" * * const cron = Result.getOrThrow(Cron.parse("0 0 9 * * 1-5")) // 9 AM weekdays * diff --git a/packages/effect/src/data/Data.ts b/packages/effect/src/Data.ts similarity index 96% rename from packages/effect/src/data/Data.ts rename to packages/effect/src/Data.ts index 9119482ff2..3f227eaf6c 100644 --- a/packages/effect/src/data/Data.ts +++ b/packages/effect/src/Data.ts @@ -11,11 +11,11 @@ * * @since 2.0.0 */ -import type * as Cause from "../Cause.ts" -import * as Predicate from "../data/Predicate.ts" -import * as core from "../internal/core.ts" -import type * as Types from "../types/Types.ts" -import type { Unify } from "../types/Unify.ts" +import type * as Cause from "./Cause.ts" +import * as core from "./internal/core.ts" +import * as Predicate from "./Predicate.ts" +import type * as Types from "./types/Types.ts" +import type { Unify } from "./types/Unify.ts" /** * Provides a constructor for a Case Class. @@ -24,7 +24,7 @@ import type { Unify } from "../types/Unify.ts" * ```ts * import * as assert from "node:assert" * import { Equal } from "effect/interfaces" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class Person extends Data.Class<{ readonly name: string }> {} * @@ -57,7 +57,7 @@ export const Class: new = {}>( * ```ts * import * as assert from "node:assert" * import { Equal } from "effect/interfaces" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class Person extends Data.TaggedClass("Person")<{ readonly name: string }> {} * @@ -97,7 +97,7 @@ export const TaggedClass = ( * * @example * ```ts - * import { Data } from "effect/data" + * import { Data } from "effect" * * // Define a tagged enum type * type HttpError = Data.TaggedEnum<{ @@ -148,7 +148,7 @@ type UntaggedChildren = true extends ChildrenAreTagged * * @example * ```ts - * import { Data } from "effect/data" + * import { Data } from "effect" * * // Basic tagged enum usage * const { Success, Failure } = Data.taggedEnum< @@ -172,7 +172,7 @@ export declare namespace TaggedEnum { * * @example * ```ts - * import { Data } from "effect/data" + * import { Data } from "effect" * * // Define a tagged enum with generic parameters * interface MyTaggedEnum extends Data.TaggedEnum.WithGenerics<2> { @@ -206,7 +206,7 @@ export declare namespace TaggedEnum { * * @example * ```ts - * import { Data } from "effect/data" + * import { Data } from "effect" * * // Define a generic Option type * type Option = Data.TaggedEnum<{ @@ -260,7 +260,7 @@ export declare namespace TaggedEnum { * * @example * ```ts - * import { Data } from "effect/data" + * import { Data } from "effect" * * type Result = * | { readonly _tag: "Success"; readonly value: number } @@ -296,7 +296,7 @@ export declare namespace TaggedEnum { * * @example * ```ts - * import { Data } from "effect/data" + * import { Data } from "effect" * * type Result = * | { readonly _tag: "Success"; readonly value: number } @@ -329,7 +329,7 @@ export declare namespace TaggedEnum { * * @example * ```ts - * import { Data } from "effect/data" + * import { Data } from "effect" * * type HttpError = * | { readonly _tag: "BadRequest"; readonly message: string } @@ -405,7 +405,7 @@ export declare namespace TaggedEnum { * * @example * ```ts - * import { Data } from "effect/data" + * import { Data } from "effect" * * type Result = Data.TaggedEnum<{ * Failure: { readonly error: E } @@ -493,7 +493,7 @@ export declare namespace TaggedEnum { * * @example * ```ts - * import { Data } from "effect/data" + * import { Data } from "effect" * * const { BadRequest, NotFound } = Data.taggedEnum< * | { readonly _tag: "BadRequest"; readonly status: 400; readonly message: string } @@ -504,7 +504,7 @@ export declare namespace TaggedEnum { * ``` * * @example - * import { Data } from "effect/data" + * import { Data } from "effect" * * type MyResult = Data.TaggedEnum<{ * Failure: { readonly error: E } @@ -623,7 +623,7 @@ function taggedMatch< * @example * ```ts * import { Effect, Exit } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class NetworkError extends Data.Error<{ code: number; message: string }> {} * @@ -652,7 +652,7 @@ export const Error: new = {}>( * @example * ```ts * import { Effect, pipe } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class NetworkError extends Data.TaggedError("NetworkError")<{ * code: number diff --git a/packages/effect/src/DateTime.ts b/packages/effect/src/DateTime.ts index ca19832a2d..aed57fb5fd 100644 --- a/packages/effect/src/DateTime.ts +++ b/packages/effect/src/DateTime.ts @@ -2,17 +2,17 @@ * @since 3.6.0 */ import type { IllegalArgumentError } from "./Cause.ts" -import type * as equivalence from "./data/Equivalence.ts" -import type * as order from "./data/Order.ts" -import type * as Result from "./data/Result.ts" import type * as Duration from "./Duration.ts" import * as Effect from "./Effect.ts" +import type * as equivalence from "./Equivalence.ts" import { dual, type LazyArg } from "./Function.ts" import type { Inspectable } from "./interfaces/Inspectable.ts" import type { Pipeable } from "./interfaces/Pipeable.ts" import * as Internal from "./internal/dateTime.ts" import { provideService } from "./internal/effect.ts" import * as Layer from "./Layer.ts" +import type * as order from "./Order.ts" +import type * as Result from "./Result.ts" import * as ServiceMap from "./ServiceMap.ts" const TypeId = Internal.TypeId diff --git a/packages/effect/src/Duration.ts b/packages/effect/src/Duration.ts index 0cfaa595db..762a546aeb 100644 --- a/packages/effect/src/Duration.ts +++ b/packages/effect/src/Duration.ts @@ -13,12 +13,8 @@ * * @since 2.0.0 */ -import * as Combiner from "./data/Combiner.ts" -import type * as equivalence from "./data/Equivalence.ts" -import * as order from "./data/Order.ts" -import { hasProperty, isBigInt, isNumber, isString } from "./data/Predicate.ts" -import * as Reducer from "./data/Reducer.ts" -import * as UndefinedOr from "./data/UndefinedOr.ts" +import * as Combiner from "./Combiner.ts" +import type * as equivalence from "./Equivalence.ts" import { dual, identity } from "./Function.ts" import * as Equal from "./interfaces/Equal.ts" import * as Hash from "./interfaces/Hash.ts" @@ -26,6 +22,10 @@ import type * as Inspectable from "./interfaces/Inspectable.ts" import { NodeInspectSymbol } from "./interfaces/Inspectable.ts" import type { Pipeable } from "./interfaces/Pipeable.ts" import { pipeArguments } from "./interfaces/Pipeable.ts" +import * as order from "./Order.ts" +import { hasProperty, isBigInt, isNumber, isString } from "./Predicate.ts" +import * as Reducer from "./Reducer.ts" +import * as UndefinedOr from "./UndefinedOr.ts" const TypeId = "~effect/time/Duration" diff --git a/packages/effect/src/Effect.ts b/packages/effect/src/Effect.ts index b943d0fab6..b540ae5b78 100644 --- a/packages/effect/src/Effect.ts +++ b/packages/effect/src/Effect.ts @@ -70,14 +70,11 @@ import type * as Cause from "./Cause.ts" import type { Clock } from "./Clock.ts" import type * as Arr from "./collections/Array.ts" -import type * as Filter from "./data/Filter.ts" -import type { Option } from "./data/Option.ts" -import type * as Predicate from "./data/Predicate.ts" -import type * as Result from "./data/Result.ts" import * as Duration from "./Duration.ts" import type { ExecutionPlan } from "./ExecutionPlan.ts" import * as Exit from "./Exit.ts" import type { Fiber } from "./Fiber.ts" +import type * as Filter from "./Filter.ts" import { constant, dual, type LazyArg } from "./Function.ts" import type { Pipeable } from "./interfaces/Pipeable.ts" import * as core from "./internal/core.ts" @@ -90,9 +87,12 @@ import type * as Layer from "./Layer.ts" import type { Logger } from "./Logger.ts" import type { LogLevel } from "./LogLevel.ts" import * as Metric from "./Metric.ts" +import type { Option } from "./Option.ts" +import type * as Predicate from "./Predicate.ts" import { CurrentLogAnnotations, CurrentLogSpans } from "./References.ts" import type * as Request from "./Request.ts" import type { RequestResolver } from "./RequestResolver.ts" +import type * as Result from "./Result.ts" import type { Schedule } from "./Schedule.ts" import type { Scheduler } from "./Scheduler.ts" import type { Scope } from "./Scope.ts" @@ -1614,7 +1614,7 @@ export const withFiber: ( * @example * ```ts * import { Effect } from "effect" - * import { Result } from "effect/data" + * import { Result } from "effect" * * const success = Result.succeed(42) * const failure = Result.fail("Something went wrong") @@ -1638,7 +1638,7 @@ export const fromResult: (result: Result.Result) => Effect = i * @example * ```ts * import { Effect } from "effect" - * import { Option } from "effect/data" + * import { Option } from "effect" * * const some = Option.some(42) * const none = Option.none() @@ -1673,7 +1673,7 @@ export const fromNullishOr: (value: A) => Effect, Cause.NoSuch * @example * ```ts * import { Effect } from "effect" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * // Option is yieldable in Effect * const program = Effect.gen(function* () { @@ -1994,7 +1994,7 @@ export const tap: { * @example * ```ts * import { Effect } from "effect" - * import { Result } from "effect/data" + * import { Result } from "effect" * * const success = Effect.succeed(42) * const failure = Effect.fail("Something went wrong") @@ -2165,7 +2165,7 @@ export const as: { * @example * ```ts * import { Effect } from "effect" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * const program = Effect.asSome(Effect.succeed(42)) * @@ -2473,7 +2473,7 @@ export const catchTag: { * @example * ```ts * import { Effect } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * // Define tagged error types * class ValidationError extends Data.TaggedError("ValidationError")<{ @@ -3796,7 +3796,7 @@ export const raceFirst: { * @example * ```ts * import { Effect } from "effect" - * import { Filter } from "effect/data" + * import { Filter } from "effect" * * const isEven = (n: number) => Effect.succeed(n % 2 === 0 ? n : Filter.fail(n)) * @@ -3828,7 +3828,7 @@ export const filter: ( * @example * ```ts * import { Effect } from "effect" - * import { Filter } from "effect/data" + * import { Filter } from "effect" * * // An effect that produces a number * const program = Effect.succeed(5) @@ -3870,7 +3870,7 @@ export const filterOrElse: { * @example * ```ts * import { Effect } from "effect" - * import { Filter } from "effect/data" + * import { Filter } from "effect" * * // An effect that produces a number * const program = Effect.succeed(5) @@ -3930,7 +3930,7 @@ export const filterOrFail: { * @example * ```ts * import { Effect } from "effect" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * import { Console } from "effect" * * const shouldLog = true @@ -4207,7 +4207,7 @@ export const matchCauseEffectEager: { * @example * ```ts * import { Effect, Cause } from "effect" - * import * as Filter from "effect/data/Filter" + * import * as Filter from "effect/Filter" * import { Console } from "effect" * * const task = Effect.fail(new Error("Task failed")) @@ -4400,7 +4400,7 @@ export const isSuccess: (self: Effect) => Effect void @@ -4441,7 +4441,7 @@ export const services: () => Effect, never, R> = int * @example * ```ts * import { Console, Effect, ServiceMap } from "effect" - * import { Option } from "effect/data" + * import { Option } from "effect" * * const Logger = ServiceMap.Service<{ * log: (msg: string) => void @@ -4633,7 +4633,7 @@ export const service: (service: ServiceMap.Service) => Effect = (a, b) => a === b @@ -82,7 +82,7 @@ export type Equivalence = (self: A, that: A) => boolean * * @example * ```ts - * import { Equivalence } from "effect/data" + * import { Equivalence } from "effect" * import type { Kind } from "effect/types/HKT" * * // Used internally for type-level computations @@ -105,7 +105,7 @@ export interface EquivalenceTypeLambda extends TypeLambda { * * @example * ```ts - * import { Equivalence } from "effect/data" + * import { Equivalence } from "effect" * * // Case-insensitive string equivalence * const caseInsensitive = Equivalence.make((a, b) => @@ -144,7 +144,7 @@ const isStrictEquivalent = (x: unknown, y: unknown) => x === y * * @example * ```ts - * import { Equivalence } from "effect/data" + * import { Equivalence } from "effect" * * const strictEq = Equivalence.strict() * @@ -173,7 +173,7 @@ export const strict: () => Equivalence = () => isStrictEquivalent * * @example * ```ts - * import { Equivalence } from "effect/data" + * import { Equivalence } from "effect" * * interface Person { * name: string @@ -217,7 +217,7 @@ export const combine: { * * @example * ```ts - * import { Equivalence } from "effect/data" + * import { Equivalence } from "effect" * * interface Point3D { * x: number @@ -266,7 +266,7 @@ export const combineAll = (collection: Iterable>): Equivalence * * @example * ```ts - * import { Equivalence } from "effect/data" + * import { Equivalence } from "effect" * * interface User { * id: number @@ -321,7 +321,7 @@ export const mapInput: { * * @example * ```ts - * import { Equivalence } from "effect/data" + * import { Equivalence } from "effect" * * // Create equivalence for string tuples * const stringTupleEq = Equivalence.tuple([ @@ -379,7 +379,7 @@ export function tuple>>( * * @example * ```ts - * import { Equivalence } from "effect/data" + * import { Equivalence } from "effect" * * const numberArrayEq = Equivalence.array(Equivalence.strict()) * @@ -425,7 +425,7 @@ export function array(item: Equivalence): Equivalence> { * * @example * ```ts - * import { Equivalence } from "effect/data" + * import { Equivalence } from "effect" * * interface Person { * name: string diff --git a/packages/effect/src/ExecutionPlan.ts b/packages/effect/src/ExecutionPlan.ts index e6d31c0289..58d0d889f0 100644 --- a/packages/effect/src/ExecutionPlan.ts +++ b/packages/effect/src/ExecutionPlan.ts @@ -2,13 +2,13 @@ * @since 3.16.0 */ import type { NonEmptyReadonlyArray } from "./collections/Array.ts" -import * as Predicate from "./data/Predicate.ts" import type * as Effect from "./Effect.ts" import { constant } from "./Function.ts" import type { Pipeable } from "./interfaces/Pipeable.ts" import { pipeArguments } from "./interfaces/Pipeable.ts" import * as effect from "./internal/effect.ts" import * as Layer from "./Layer.ts" +import * as Predicate from "./Predicate.ts" import type * as Schedule from "./Schedule.ts" import * as ServiceMap from "./ServiceMap.ts" diff --git a/packages/effect/src/Exit.ts b/packages/effect/src/Exit.ts index 3010372113..57bf3ae3be 100644 --- a/packages/effect/src/Exit.ts +++ b/packages/effect/src/Exit.ts @@ -10,11 +10,11 @@ * @since 2.0.0 */ import type * as Cause from "./Cause.ts" -import type * as Filter from "./data/Filter.ts" -import type { Option } from "./data/Option.ts" import type * as Effect from "./Effect.ts" +import type * as Filter from "./Filter.ts" import * as core from "./internal/core.ts" import * as effect from "./internal/effect.ts" +import type { Option } from "./Option.ts" import type { NoInfer } from "./types/Types.ts" const TypeId = core.ExitTypeId diff --git a/packages/effect/src/Fiber.ts b/packages/effect/src/Fiber.ts index 5294f7b5d8..db9efc0800 100644 --- a/packages/effect/src/Fiber.ts +++ b/packages/effect/src/Fiber.ts @@ -74,12 +74,12 @@ * * @since 2.0.0 */ -import { hasProperty } from "./data/Predicate.ts" import type { Effect } from "./Effect.ts" import type { Exit } from "./Exit.ts" import type { Pipeable } from "./interfaces/Pipeable.ts" import * as effect from "./internal/effect.ts" import { version } from "./internal/version.ts" +import { hasProperty } from "./Predicate.ts" import type { StackFrame } from "./References.ts" import type { Scheduler } from "./Scheduler.ts" import type { Scope } from "./Scope.ts" diff --git a/packages/effect/src/FiberHandle.ts b/packages/effect/src/FiberHandle.ts index bad17d162a..505e6fd1df 100644 --- a/packages/effect/src/FiberHandle.ts +++ b/packages/effect/src/FiberHandle.ts @@ -2,16 +2,16 @@ * @since 2.0.0 */ import * as Cause from "./Cause.ts" -import * as Filter from "./data/Filter.ts" -import * as Predicate from "./data/Predicate.ts" import * as Deferred from "./Deferred.ts" import * as Effect from "./Effect.ts" import * as Exit from "./Exit.ts" import * as Fiber from "./Fiber.ts" +import * as Filter from "./Filter.ts" import { dual } from "./Function.ts" import type * as Inspectable from "./interfaces/Inspectable.ts" import { type Pipeable } from "./interfaces/Pipeable.ts" import { PipeInspectableProto } from "./internal/core.ts" +import * as Predicate from "./Predicate.ts" import type { Scheduler } from "./Scheduler.ts" import type * as Scope from "./Scope.ts" import type { ServiceMap } from "./ServiceMap.ts" diff --git a/packages/effect/src/FiberMap.ts b/packages/effect/src/FiberMap.ts index 6c79bc5d31..0f2ad3ba1e 100644 --- a/packages/effect/src/FiberMap.ts +++ b/packages/effect/src/FiberMap.ts @@ -4,17 +4,17 @@ import * as Cause from "./Cause.ts" import * as Iterable from "./collections/Iterable.ts" import * as MutableHashMap from "./collections/MutableHashMap.ts" -import * as Filter from "./data/Filter.ts" -import * as Option from "./data/Option.ts" -import * as Predicate from "./data/Predicate.ts" import * as Deferred from "./Deferred.ts" import * as Effect from "./Effect.ts" import * as Exit from "./Exit.ts" import * as Fiber from "./Fiber.ts" +import * as Filter from "./Filter.ts" import { constVoid, dual } from "./Function.ts" import type * as Inspectable from "./interfaces/Inspectable.ts" import { type Pipeable } from "./interfaces/Pipeable.ts" import { PipeInspectableProto } from "./internal/core.ts" +import * as Option from "./Option.ts" +import * as Predicate from "./Predicate.ts" import type * as Scope from "./Scope.ts" import type { ServiceMap } from "./ServiceMap.ts" diff --git a/packages/effect/src/FiberSet.ts b/packages/effect/src/FiberSet.ts index 7852608a7c..91fe903e1f 100644 --- a/packages/effect/src/FiberSet.ts +++ b/packages/effect/src/FiberSet.ts @@ -3,16 +3,16 @@ */ import * as Cause from "./Cause.ts" import * as Iterable from "./collections/Iterable.ts" -import * as Filter from "./data/Filter.ts" -import * as Predicate from "./data/Predicate.ts" import * as Deferred from "./Deferred.ts" import * as Effect from "./Effect.ts" import * as Exit from "./Exit.ts" import * as Fiber from "./Fiber.ts" +import * as Filter from "./Filter.ts" import { constVoid, dual } from "./Function.ts" import type * as Inspectable from "./interfaces/Inspectable.ts" import { type Pipeable } from "./interfaces/Pipeable.ts" import { PipeInspectableProto } from "./internal/core.ts" +import * as Predicate from "./Predicate.ts" import type * as Scope from "./Scope.ts" import type { ServiceMap } from "./ServiceMap.ts" diff --git a/packages/effect/src/data/Filter.ts b/packages/effect/src/Filter.ts similarity index 96% rename from packages/effect/src/data/Filter.ts rename to packages/effect/src/Filter.ts index 875a0547fe..273a838dbd 100644 --- a/packages/effect/src/data/Filter.ts +++ b/packages/effect/src/Filter.ts @@ -1,13 +1,13 @@ /** * @since 4.0.0 */ -import type * as Option from "../data/Option.ts" -import * as Predicate from "../data/Predicate.ts" -import type * as Result from "../data/Result.ts" -import type { Effect } from "../Effect.ts" -import { dual } from "../Function.ts" -import * as Equal from "../interfaces/Equal.ts" -import type { EqualsWith, ExcludeTag, ExtractTag, Tags } from "../types/Types.ts" +import type { Effect } from "./Effect.ts" +import { dual } from "./Function.ts" +import * as Equal from "./interfaces/Equal.ts" +import type * as Option from "./Option.ts" +import * as Predicate from "./Predicate.ts" +import type * as Result from "./Result.ts" +import type { EqualsWith, ExcludeTag, ExtractTag, Tags } from "./types/Types.ts" /** * Represents a filter function that can transform inputs to outputs or filter them out. @@ -17,7 +17,7 @@ import type { EqualsWith, ExcludeTag, ExtractTag, Tags } from "../types/Types.ts * * @example * ```ts - * import { Filter } from "effect/data" + * import { Filter } from "effect" * * // A filter that only passes positive numbers * const positiveFilter: Filter.Filter = (n) => @@ -43,7 +43,7 @@ export interface Filter { * @example * ```ts * import { Effect } from "effect" - * import { Filter } from "effect/data" + * import { Filter } from "effect" * * // An effectful filter that validates user data * type User = { id: string; isActive: boolean } @@ -118,7 +118,7 @@ export type WithoutFail = Exclude> * * @example * ```ts - * import { Filter } from "effect/data" + * import { Filter } from "effect" * * // Create a filter for positive numbers * const positiveFilter = Filter.make((n: number) => @@ -152,7 +152,7 @@ export const make = ( * @example * ```ts * import { Effect } from "effect" - * import { Filter } from "effect/data" + * import { Filter } from "effect" * * // Create an effectful filter that validates async * const asyncValidate = Filter.makeEffect((id: string) => @@ -223,7 +223,7 @@ export { * * @example * ```ts - * import { Filter } from "effect/data" + * import { Filter } from "effect" * * // Create filter from predicate * const positiveNumbers = Filter.fromPredicate((n: number) => n > 0) @@ -290,7 +290,7 @@ export const toPredicate = ( * * @example * ```ts - * import { Filter } from "effect/data" + * import { Filter } from "effect" * * console.log(Filter.string("hello")) // "hello" * console.log(Filter.string(42)) // fail @@ -348,7 +348,7 @@ export const instanceOf = * * @example * ```ts - * import { Filter } from "effect/data" + * import { Filter } from "effect" * * console.log(Filter.number(42)) // 42 * console.log(Filter.number(3.14)) // 3.14 @@ -516,7 +516,7 @@ export const zipWith: { * * @example * ```ts - * import { Filter } from "effect/data" + * import { Filter } from "effect" * * const positiveNumbers = Filter.fromPredicate((n: number) => n > 0) * const evenNumbers = Filter.fromPredicate((n: number) => n % 2 === 0) @@ -563,7 +563,7 @@ export const zip: { * * @example * ```ts - * import { Filter } from "effect/data" + * import { Filter } from "effect" * * const positiveNumbers = Filter.fromPredicate((n: number) => n > 0) * const evenNumbers = Filter.fromPredicate((n: number) => n % 2 === 0) @@ -609,7 +609,7 @@ export const andLeft: { * * @example * ```ts - * import { Filter } from "effect/data" + * import { Filter } from "effect" * * const positiveNumbers = Filter.fromPredicate((n: number) => n > 0) * const doubleNumbers = Filter.make((n: number) => n > 0 ? n * 2 : Filter.fail(n)) @@ -655,7 +655,7 @@ export const andRight: { * * @example * ```ts - * import { Filter } from "effect/data" + * import { Filter } from "effect" * * // First filter: only pass strings * const stringFilter = Filter.string diff --git a/packages/effect/src/data/Formatter.ts b/packages/effect/src/Formatter.ts similarity index 97% rename from packages/effect/src/data/Formatter.ts rename to packages/effect/src/Formatter.ts index 70b7f0650f..10e51628e7 100644 --- a/packages/effect/src/data/Formatter.ts +++ b/packages/effect/src/Formatter.ts @@ -1,8 +1,8 @@ /** * @since 4.0.0 */ -import * as Predicate from "../data/Predicate.ts" -import { getRedacted, redact, symbolRedactable } from "../interfaces/Redactable.ts" +import { getRedacted, redact, symbolRedactable } from "./interfaces/Redactable.ts" +import * as Predicate from "./Predicate.ts" /** * @category Model @@ -186,7 +186,7 @@ function safeToString(input: any): string { * * @example * ```ts - * import { formatJson } from "effect/data/Formatter" + * import { formatJson } from "effect/Formatter" * * // Normal object * const simple = { name: "Alice", age: 30 } diff --git a/packages/effect/src/Function.ts b/packages/effect/src/Function.ts index 7cebcd4289..0488370b05 100644 --- a/packages/effect/src/Function.ts +++ b/packages/effect/src/Function.ts @@ -30,7 +30,7 @@ export interface FunctionTypeLambda extends TypeLambda { * @example * ```ts * import * as assert from "node:assert" - * import * as Predicate from "effect/data/Predicate" + * import * as Predicate from "effect/Predicate" * * assert.deepStrictEqual(Predicate.isFunction(Predicate.isFunction), true) * assert.deepStrictEqual(Predicate.isFunction("function"), false) diff --git a/packages/effect/src/Layer.ts b/packages/effect/src/Layer.ts index 9871c6a133..018470a7cf 100644 --- a/packages/effect/src/Layer.ts +++ b/packages/effect/src/Layer.ts @@ -19,7 +19,6 @@ */ import type * as Cause from "./Cause.ts" import type { NonEmptyArray } from "./collections/Array.ts" -import { hasProperty } from "./data/Predicate.ts" import * as Deferred from "./Deferred.ts" import type { Effect } from "./Effect.ts" import type * as Exit from "./Exit.ts" @@ -28,6 +27,7 @@ import { constant, constTrue, dual, identity } from "./Function.ts" import { type Pipeable, pipeArguments } from "./interfaces/Pipeable.ts" import * as internalEffect from "./internal/effect.ts" import type { ErrorWithStackTraceLimit } from "./internal/tracer.ts" +import { hasProperty } from "./Predicate.ts" import * as Scope from "./Scope.ts" import * as ServiceMap from "./ServiceMap.ts" import type * as Types from "./types/Types.ts" @@ -1279,7 +1279,7 @@ export const flatMap: { * @example * ```ts * import { Effect, Layer, ServiceMap } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class DatabaseError extends Data.TaggedError("DatabaseError")<{ * message: string @@ -1356,7 +1356,7 @@ export { * @example * ```ts * import { Cause, Effect, Layer, ServiceMap } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class DatabaseError extends Data.TaggedError("DatabaseError")<{ * message: string diff --git a/packages/effect/src/LogLevel.ts b/packages/effect/src/LogLevel.ts index b193caed8f..3201541d01 100644 --- a/packages/effect/src/LogLevel.ts +++ b/packages/effect/src/LogLevel.ts @@ -98,8 +98,8 @@ * }) * ``` */ -import * as Ord from "./data/Order.ts" import * as effect from "./internal/effect.ts" +import * as Ord from "./Order.ts" /** * Represents the severity level of a log message. diff --git a/packages/effect/src/Logger.ts b/packages/effect/src/Logger.ts index cab3f7451f..85b42c0048 100644 --- a/packages/effect/src/Logger.ts +++ b/packages/effect/src/Logger.ts @@ -101,11 +101,10 @@ */ import type * as Cause from "./Cause.ts" import * as Array from "./collections/Array.ts" -import * as Formatter from "./data/Formatter.ts" -import * as Predicate from "./data/Predicate.ts" import type * as Duration from "./Duration.ts" import type * as Effect from "./Effect.ts" import type * as Fiber from "./Fiber.ts" +import * as Formatter from "./Formatter.ts" import { dual } from "./Function.ts" import type { Pipeable } from "./interfaces/Pipeable.ts" import { isEffect, withFiber } from "./internal/core.ts" @@ -114,6 +113,7 @@ import * as Layer from "./Layer.ts" import type * as LogLevel from "./LogLevel.ts" import * as FileSystem from "./platform/FileSystem.ts" import type { PlatformError } from "./platform/PlatformError.ts" +import * as Predicate from "./Predicate.ts" import { CurrentLogAnnotations, CurrentLogSpans } from "./References.ts" import type * as Scope from "./Scope.ts" import * as ServiceMap from "./ServiceMap.ts" diff --git a/packages/effect/src/ManagedRuntime.ts b/packages/effect/src/ManagedRuntime.ts index 9ff313fbe9..305c8f1d3c 100644 --- a/packages/effect/src/ManagedRuntime.ts +++ b/packages/effect/src/ManagedRuntime.ts @@ -1,11 +1,11 @@ /** * @since 2.0.0 */ -import { hasProperty } from "./data/Predicate.ts" import * as Effect from "./Effect.ts" import * as Exit from "./Exit.ts" import * as Fiber from "./Fiber.ts" import * as Layer from "./Layer.ts" +import { hasProperty } from "./Predicate.ts" import * as Scope from "./Scope.ts" import type * as ServiceMap from "./ServiceMap.ts" import type { Mutable } from "./types/Types.ts" diff --git a/packages/effect/src/Match.ts b/packages/effect/src/Match.ts index 2208f4edea..a32c6a2e87 100644 --- a/packages/effect/src/Match.ts +++ b/packages/effect/src/Match.ts @@ -26,11 +26,11 @@ * * @since 4.0.0 */ -import type * as Option from "./data/Option.ts" -import * as Predicate from "./data/Predicate.ts" -import type * as Result from "./data/Result.ts" import type { Pipeable } from "./interfaces/Pipeable.ts" import * as internal from "./internal/matcher.ts" +import type * as Option from "./Option.ts" +import * as Predicate from "./Predicate.ts" +import type * as Result from "./Result.ts" import type * as T from "./types/Types.ts" import type { Unify } from "./types/Unify.ts" diff --git a/packages/effect/src/Metric.ts b/packages/effect/src/Metric.ts index adcc7716d3..6894df03cf 100644 --- a/packages/effect/src/Metric.ts +++ b/packages/effect/src/Metric.ts @@ -138,8 +138,6 @@ */ import * as Arr from "./collections/Array.ts" -import * as Order from "./data/Order.ts" -import * as Predicate from "./data/Predicate.ts" import * as Duration from "./Duration.ts" import type { Effect } from "./Effect.ts" import type { Exit } from "./Exit.ts" @@ -149,6 +147,8 @@ import { pipeArguments } from "./interfaces/Pipeable.ts" import * as InternalEffect from "./internal/effect.ts" import * as InternalMetric from "./internal/metric.ts" import * as Layer from "./Layer.ts" +import * as Order from "./Order.ts" +import * as Predicate from "./Predicate.ts" import * as ServiceMap from "./ServiceMap.ts" import * as _String from "./String.ts" import type { Contravariant, Covariant } from "./types/Types.ts" @@ -173,7 +173,7 @@ import type { Contravariant, Covariant } from "./types/Types.ts" * @example * ```ts * import { Effect, Metric } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class MetricExample extends Data.TaggedError("MetricExample")<{ * readonly operation: string @@ -250,7 +250,7 @@ export interface Metric extends Pipeable { * @example * ```ts * import { Effect, Metric } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class CounterInterfaceError extends Data.TaggedError("CounterInterfaceError")<{ * readonly operation: string @@ -313,7 +313,7 @@ export interface Counter extends Metric { * @example * ```ts * import { Effect, Metric } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class FrequencyInterfaceError * extends Data.TaggedError("FrequencyInterfaceError")<{ @@ -461,7 +461,7 @@ export interface Frequency extends Metric {} * @example * ```ts * import { Effect, Metric } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class FrequencyStateError extends Data.TaggedError("FrequencyStateError")<{ * readonly operation: string @@ -551,7 +551,7 @@ export interface FrequencyState { * @example * ```ts * import { Effect, Metric } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class GaugeInterfaceError extends Data.TaggedError("GaugeInterfaceError")<{ * readonly operation: string @@ -607,7 +607,7 @@ export interface Gauge extends Metric { * @example * ```ts * import { Effect, Metric } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class HistogramInterfaceError * extends Data.TaggedError("HistogramInterfaceError")<{ @@ -765,7 +765,7 @@ export interface Histogram extends Metric {} * @example * ```ts * import { Effect, Metric } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class HistogramStateError extends Data.TaggedError("HistogramStateError")<{ * readonly operation: string @@ -862,7 +862,7 @@ export interface HistogramState { * @example * ```ts * import { Effect, Metric } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class SummaryInterfaceError extends Data.TaggedError("SummaryInterfaceError")<{ * readonly operation: string @@ -956,7 +956,7 @@ export interface Summary extends Metric {} * @example * ```ts * import { Effect, Metric } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class SummaryStateError extends Data.TaggedError("SummaryStateError")<{ * readonly operation: string @@ -1045,7 +1045,7 @@ export interface SummaryState { * @example * ```ts * import { Effect, Metric } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class MetricsError extends Data.TaggedError("MetricsError")<{ * readonly operation: string @@ -1091,7 +1091,7 @@ export declare namespace Metric { * @example * ```ts * import { Effect, Metric } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class MetricTypeError extends Data.TaggedError("MetricTypeError")<{ * readonly operation: string @@ -1172,7 +1172,7 @@ export declare namespace Metric { * @example * ```ts * import { Effect, Metric } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class AttributesError extends Data.TaggedError("AttributesError")<{ * readonly operation: string @@ -1248,7 +1248,7 @@ export declare namespace Metric { * @example * ```ts * import { Effect, Metric } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class AttributeSetError extends Data.TaggedError("AttributeSetError")<{ * readonly operation: string @@ -1435,7 +1435,7 @@ export declare namespace Metric { * @example * ```ts * import { Effect, Metric } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class HooksError extends Data.TaggedError("HooksError")<{ * readonly operation: string @@ -1484,7 +1484,7 @@ export declare namespace Metric { * @example * ```ts * import { Effect, Metric } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class MetadataError extends Data.TaggedError("MetadataError")<{ * readonly operation: string @@ -1552,7 +1552,7 @@ export declare namespace Metric { * @example * ```ts * import { Effect, Metric } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class SnapshotProtoError extends Data.TaggedError("SnapshotProtoError")<{ * readonly operation: string @@ -1625,7 +1625,7 @@ export declare namespace Metric { * @example * ```ts * import { Effect, Metric } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class SnapshotError extends Data.TaggedError("SnapshotError")<{ * readonly operation: string @@ -1702,7 +1702,7 @@ export declare namespace Metric { * @example * ```ts * import { Effect, Metric } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class AttributesKeyError extends Data.TaggedError("AttributesKeyError")<{ * readonly operation: string @@ -1753,7 +1753,7 @@ export const CurrentMetricAttributesKey = "effect/Metric/CurrentMetricAttributes * @example * ```ts * import { Effect, Metric } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class AttributesError extends Data.TaggedError("AttributesError")<{ * readonly operation: string @@ -2207,7 +2207,7 @@ export const isMetric = (u: unknown): u is Metric => * @example * ```ts * import { Effect, Metric } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class CounterError extends Data.TaggedError("CounterError")<{ * readonly operation: string @@ -2287,7 +2287,7 @@ export const counter: { * @example * ```ts * import { Effect, Metric } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class GaugeError extends Data.TaggedError("GaugeError")<{ * readonly operation: string @@ -2365,7 +2365,7 @@ export const gauge: { * @example * ```ts * import { Effect, Metric } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class FrequencyError extends Data.TaggedError("FrequencyError")<{ * readonly operation: string @@ -2445,7 +2445,7 @@ export const frequency = (name: string, options?: { * @example * ```ts * import { Effect, Metric } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class HistogramError extends Data.TaggedError("HistogramError")<{ * readonly operation: string @@ -2525,7 +2525,7 @@ export const histogram = (name: string, options: { * @example * ```ts * import { Effect, Metric } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * import { Duration } from "effect" * * class SummaryError extends Data.TaggedError("SummaryError")<{ @@ -2651,7 +2651,7 @@ export const summaryWithTimestamp = (name: string, options: { * @example * ```ts * import { Effect, Metric } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * import { Duration } from "effect" * * class TimerError extends Data.TaggedError("TimerError")<{ @@ -2862,7 +2862,7 @@ export const update: { * @example * ```ts * import { Effect, Metric } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class MetricError extends Data.TaggedError("MetricError")<{ * readonly operation: string @@ -2928,7 +2928,7 @@ export const mapInput: { * @example * ```ts * import { Effect, Metric } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class MetricError extends Data.TaggedError("MetricError")<{ * readonly operation: string @@ -3047,7 +3047,7 @@ export const withAttributes: { * @example * ```ts * import { Console, Effect, Metric } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class SnapshotError extends Data.TaggedError("SnapshotError")<{ * readonly operation: string @@ -3103,7 +3103,7 @@ export const snapshot: Effect> = InternalEffect.m * @example * ```ts * import { Console, Effect, Metric } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class DumpError extends Data.TaggedError("DumpError")<{ * readonly operation: string @@ -3193,7 +3193,7 @@ export const dump: Effect = InternalEffect.flatMap(InternalEffect.servic * @example * ```ts * import { Effect, Metric } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class UnsafeSnapshotError extends Data.TaggedError("UnsafeSnapshotError")<{ * readonly operation: string @@ -3323,7 +3323,7 @@ const attributesToString = (attributes: Metric.AttributeSet): string => { * @example * ```ts * import { Effect, Metric } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class BoundaryError extends Data.TaggedError("BoundaryError")<{ * readonly operation: string @@ -3391,7 +3391,7 @@ export const boundariesFromIterable = (iterable: Iterable): ReadonlyArra * @example * ```ts * import { Effect, Metric } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class BoundaryError extends Data.TaggedError("BoundaryError")<{ * readonly operation: string @@ -3443,7 +3443,7 @@ export const linearBoundaries = (options: { * @example * ```ts * import { Effect, Metric } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class BoundaryError extends Data.TaggedError("BoundaryError")<{ * readonly operation: string @@ -3516,7 +3516,7 @@ const fiberFailures = counter("child_fiber_failures", { * @example * ```ts * import { Effect, Layer, Metric } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class MetricsError extends Data.TaggedError("MetricsError")<{ * readonly operation: string @@ -3557,7 +3557,7 @@ export const FiberRuntimeMetricsKey: "effect/observability/Metric/FiberRuntimeMe * ```ts * import type { ServiceMap } from "effect" * import { Effect, Layer, Metric } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * import type { Exit } from "effect/Exit" * * class MetricsError extends Data.TaggedError("MetricsError")<{ @@ -3601,7 +3601,7 @@ export interface FiberRuntimeMetricsService { * @example * ```ts * import { Effect, Metric } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * class MetricsError extends Data.TaggedError("MetricsError")<{ * readonly operation: string @@ -3652,7 +3652,7 @@ export const FiberRuntimeMetrics = ServiceMap.Reference(self: Effect) => Effect = Option.some(42) @@ -100,7 +100,7 @@ export interface Some extends Pipeable, Inspectable, Yieldable, /** * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * import * as Unify from "effect/types/Unify" * * // Internal unification interface used by the Effect library @@ -118,7 +118,7 @@ export interface OptionUnify { /** * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * // Namespace containing utility types for Option * type StringOption = Option.Option @@ -134,7 +134,7 @@ export declare namespace Option { * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * // Declare an Option holding a string * declare const myOption: Option.Option @@ -155,7 +155,7 @@ export declare namespace Option { /** * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * // Internal interface for type unification behavior * // Used by the Effect library's type system @@ -170,7 +170,7 @@ export interface OptionUnifyIgnore {} /** * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * // Type lambda interface for higher-kinded types with Option * // Used internally by the Effect library's type system @@ -193,7 +193,7 @@ export interface OptionTypeLambda extends TypeLambda { * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * // An Option holding no value * // @@ -217,7 +217,7 @@ export const none = (): Option => option.none * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * // An Option holding the number 1 * // @@ -248,7 +248,7 @@ export const some: (value: A) => Option = option.some * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * console.log(Option.isOption(Option.some(1))) * // Output: true @@ -270,7 +270,7 @@ export const isOption: (input: unknown) => input is Option = option.isO * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * console.log(Option.isNone(Option.some(1))) * // Output: false @@ -291,7 +291,7 @@ export const isNone: (self: Option) => self is None = option.isNone * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * console.log(Option.isSome(Option.some(1))) * // Output: true @@ -329,7 +329,7 @@ export const isSome: (self: Option) => self is Some = option.isSome * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * const foo = Option.some(1) * @@ -381,7 +381,7 @@ export const match: { * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * type MyData = string | number * @@ -424,7 +424,7 @@ export const toRefinement = (f: (a: A) => Option): (a: A) => * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * console.log(Option.fromIterable([1, 2, 3])) * // Output: { _id: 'Option', _tag: 'Some', value: 1 } @@ -463,8 +463,8 @@ export const fromIterable = (collection: Iterable): Option => { * * @example * ```ts - * import { Result } from "effect/data" - * import { Option } from "effect/data" + * import { Result } from "effect" + * import { Option } from "effect" * * console.log(Option.getSuccess(Result.succeed("ok"))) * // Output: { _id: 'Option', _tag: 'Some', value: 'ok' } @@ -498,8 +498,8 @@ export const getSuccess: (self: Result) => Option = result.getSuc * * @example * ```ts - * import { Result } from "effect/data" - * import { Option } from "effect/data" + * import { Result } from "effect" + * import { Option } from "effect" * * console.log(Option.getFailure(Result.succeed("ok"))) * // Output: { _id: 'Option', _tag: 'None' } @@ -533,7 +533,7 @@ export const getFailure: (self: Result) => Option = result.getFai * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * console.log(Option.some(1).pipe(Option.getOrElse(() => 0))) * // Output: 1 @@ -574,7 +574,7 @@ export const getOrElse: { * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * console.log(Option.none().pipe(Option.orElse(() => Option.none()))) * // Output: { _id: 'Option', _tag: 'None' } @@ -617,7 +617,7 @@ export const orElse: { * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * console.log(Option.none().pipe(Option.orElseSome(() => "b"))) * // Output: { _id: 'Option', _tag: 'Some', value: 'b' } @@ -659,8 +659,8 @@ export const orElseSome: { * * @example * ```ts - * import { Result } from "effect/data" - * import { Option } from "effect/data" + * import { Result } from "effect" + * import { Option } from "effect" * * const primary = Option.some("primary") * const fallback = () => Option.some("fallback") @@ -706,7 +706,7 @@ export const orElseResult: { * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * console.log(Option.firstSomeOf([ * Option.none(), @@ -737,7 +737,7 @@ export const firstSomeOf = > = Iterable( * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * const parse = (s: string): number | undefined => { * const n = parseFloat(s) @@ -825,7 +825,7 @@ export const liftNullishOr = , B>( * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * console.log(Option.getOrNull(Option.some(1))) * // Output: 1 @@ -854,7 +854,7 @@ export const getOrNull: (self: Option) => A | null = getOrElse(constNull) * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * console.log(Option.getOrUndefined(Option.some(1))) * // Output: 1 @@ -882,7 +882,7 @@ export const getOrUndefined: (self: Option) => A | undefined = getOrElse(c * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * const parse = Option.liftThrowable(JSON.parse) * @@ -922,7 +922,7 @@ export const liftThrowable = , B>( * @example * ```ts * import * as assert from "node:assert" - * import { Option } from "effect/data" + * import { Option } from "effect" * * assert.deepStrictEqual( * Option.getOrThrowWith(Option.some(1), () => new Error('Unexpected None')), @@ -960,7 +960,7 @@ export const getOrThrowWith: { * @example * ```ts * import * as assert from "node:assert" - * import { Option } from "effect/data" + * import { Option } from "effect" * * assert.deepStrictEqual(Option.getOrThrow(Option.some(1)), 1) * assert.throws(() => Option.getOrThrow(Option.none())) @@ -989,7 +989,7 @@ export const getOrThrow: (self: Option) => A = getOrThrowWith(() => new Er * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * // Mapping over a `Some` * const someValue = Option.some(2) @@ -1030,7 +1030,7 @@ export const map: { * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * // Replacing the value of a `Some` * const someValue = Option.some(42) @@ -1067,7 +1067,7 @@ export const as: { * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * console.log(Option.asVoid(Option.some(42))) * // Output: { _id: 'Option', _tag: 'Some', value: undefined } @@ -1092,7 +1092,7 @@ export { * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * console.log(Option.void) * // Output: { _id: 'Option', _tag: 'Some', value: undefined } @@ -1127,7 +1127,7 @@ export { * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * interface Address { * readonly city: string @@ -1190,7 +1190,7 @@ export const flatMap: { * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * const maybeValue = Option.some(5) * const maybeNone = Option.none() @@ -1250,7 +1250,7 @@ export const andThen: { * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * interface Employee { * company?: { @@ -1308,7 +1308,7 @@ export const flatMapNullishOr: { * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * const nested = Option.some(Option.some("value")) * console.log(Option.flatten(nested)) @@ -1345,7 +1345,7 @@ export const flatten: (self: Option>) => Option = flatMap(identi * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * console.log(Option.zipRight(Option.some(1), Option.some("hello"))) * // Output: { _id: 'Option', _tag: 'Some', value: 'hello' } @@ -1382,7 +1382,7 @@ export const zipRight: { * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * console.log(Option.zipLeft(Option.some("hello"), Option.some(1))) * // Output: { _id: 'Option', _tag: 'Some', value: 'hello' } @@ -1416,7 +1416,7 @@ export const zipLeft: { * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * const parse = (s: string): Option.Option => isNaN(Number(s)) ? Option.none() : Option.some(Number(s)) * @@ -1458,7 +1458,7 @@ export const composeK: { * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * const getInteger = (n: number) => Number.isInteger(n) ? Option.some(n) : Option.none() * @@ -1493,7 +1493,7 @@ export const tap: { * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * console.log(Option.product(Option.some("hello"), Option.some(42))) * // Output: { _id: 'Option', _tag: 'Some', value: ['hello', 42] } @@ -1524,7 +1524,7 @@ export const product = (self: Option, that: Option): Option<[A, B]> * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * const first = Option.some(1) * const rest = [Option.some(2), Option.some(3), Option.some(4)] @@ -1578,7 +1578,7 @@ export const productMany = ( * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * const maybeName: Option.Option = Option.some("John") * const maybeAge: Option.Option = Option.some(25) @@ -1649,7 +1649,7 @@ export const all: > | Record = Option.some("John") * const maybeAge: Option.Option = Option.some(25) @@ -1690,7 +1690,7 @@ export const zipWith: { * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * const optionalFn = Option.some((x: number) => x * 2) * const optionalValue = Option.some(5) @@ -1731,7 +1731,7 @@ export const ap: { * @example * ```ts * import { pipe } from "effect" - * import { Option } from "effect/data" + * import { Option } from "effect" * * const iterable = [Option.some(1), Option.none(), Option.some(2), Option.none()] * @@ -1773,7 +1773,7 @@ export const reduceCompact: { * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * console.log(Option.toArray(Option.some(1))) * // Output: [1] @@ -1808,8 +1808,8 @@ export const toArray = (self: Option): Array => isNone(self) ? [] : [se * * @example * ```ts - * import { Result } from "effect/data" - * import { Option } from "effect/data" + * import { Result } from "effect" + * import { Option } from "effect" * * const parseNumber = (s: string): Result.Result => { * const n = Number(s) @@ -1849,7 +1849,7 @@ export const partitionMap: { * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * // Transform and filter numbers * const transformEven = (n: Option.Option): Option.Option => @@ -1888,7 +1888,7 @@ export const filterMap: { * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * const removeEmptyString = (input: Option.Option) => * Option.filter(input, (value) => value !== "") @@ -1934,7 +1934,7 @@ export const filter: { * * @example * ```ts - * import { Option, Equivalence } from "effect/data" + * import { Option, Equivalence } from "effect" * * const isEquivalent = Option.getEquivalence(Equivalence.strict()) * @@ -1975,7 +1975,7 @@ export const getEquivalence = (isEquivalent: Equivalence.Equivalence): Equ * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * import * as N from "effect/Number" * * const order = Option.getOrder(N.Order) @@ -2016,7 +2016,7 @@ export const getOrder = (O: Order): Order> => * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * // A binary function to add two numbers * const add = (a: number, b: number): number => a + b @@ -2054,7 +2054,7 @@ export const lift2 = (f: (a: A, b: B) => C): { * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * // Check if a number is positive * const isPositive = (n: number) => n > 0 @@ -2103,7 +2103,7 @@ export const liftPredicate: { // Note: I intentionally avoid using the NoInfer p * * @example * ```ts - * import { Option, Equivalence } from "effect/data" + * import { Option, Equivalence } from "effect" * * const contains = Option.containsWith(Equivalence.strict()) * @@ -2143,7 +2143,7 @@ const _equivalence = Equal.equivalence() * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * console.log(Option.some(2).pipe(Option.contains(2))) * // Output: true @@ -2180,7 +2180,7 @@ export const contains: { * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * const isEven = (n: number) => n % 2 === 0 * @@ -2227,7 +2227,7 @@ export const exists: { * ```ts * import * as assert from "node:assert" * import { pipe } from "effect" - * import { Option } from "effect/data" + * import { Option } from "effect" * * const result = pipe( * Option.Do, @@ -2279,7 +2279,7 @@ export { * ```ts * import * as assert from "node:assert" * import { pipe } from "effect" - * import { Option } from "effect/data" + * import { Option } from "effect" * * const result = pipe( * Option.Do, @@ -2316,7 +2316,7 @@ export { * ```ts * import * as assert from "node:assert" * import { pipe } from "effect" - * import { Option } from "effect/data" + * import { Option } from "effect" * * const result = pipe( * Option.Do, @@ -2362,7 +2362,7 @@ export const bind: { * ```ts * import * as assert from "node:assert" * import { pipe } from "effect" - * import { Option } from "effect/data" + * import { Option } from "effect" * * const result = pipe( * Option.Do, @@ -2391,7 +2391,7 @@ export const Do: Option<{}> = some({}) * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * * const maybeName: Option.Option = Option.some("John") * const maybeAge: Option.Option = Option.some(25) diff --git a/packages/effect/src/data/Order.ts b/packages/effect/src/Order.ts similarity index 94% rename from packages/effect/src/data/Order.ts rename to packages/effect/src/Order.ts index e1ded8ac1c..9fd82a05f7 100644 --- a/packages/effect/src/data/Order.ts +++ b/packages/effect/src/Order.ts @@ -16,10 +16,10 @@ * * @since 2.0.0 */ -import { dual } from "../Function.ts" -import type { TypeLambda } from "../types/HKT.ts" +import { dual } from "./Function.ts" import type { Ordering } from "./Ordering.ts" import * as Reducer from "./Reducer.ts" +import type { TypeLambda } from "./types/HKT.ts" /** * Represents a total ordering for values of type `A`. @@ -30,7 +30,7 @@ import * as Reducer from "./Reducer.ts" * * @example * ```ts - * import { Order } from "effect/data" + * import { Order } from "effect" * * // Custom order for objects by age * const byAge: Order.Order<{ name: string, age: number }> = (self, that) => { @@ -57,7 +57,7 @@ export interface Order { * * @example * ```ts - * import { Order } from "effect/data" + * import { Order } from "effect" * * // OrderTypeLambda is used internally for type-level operations * type MyOrderType = Order.OrderTypeLambda @@ -76,7 +76,7 @@ export interface OrderTypeLambda extends TypeLambda { * @example * ```ts * import * as assert from "node:assert" - * import { Order } from "effect/data" + * import { Order } from "effect" * * const byAge = Order.make<{ name: string, age: number }>((self, that) => { * if (self.age < that.age) return -1 @@ -102,7 +102,7 @@ export const make = ( * @example * ```ts * import * as assert from "node:assert" - * import { Order } from "effect/data" + * import { Order } from "effect" * * assert.deepStrictEqual(Order.string("apple", "banana"), -1) * assert.deepStrictEqual(Order.string("banana", "apple"), 1) @@ -120,7 +120,7 @@ export const string: Order = make((self, that) => self < that ? -1 : 1) * @example * ```ts * import * as assert from "node:assert" - * import { Order } from "effect/data" + * import { Order } from "effect" * * assert.deepStrictEqual(Order.number(1, 2), -1) * assert.deepStrictEqual(Order.number(2, 1), 1) @@ -138,7 +138,7 @@ export const number: Order = make((self, that) => self < that ? -1 : 1) * @example * ```ts * import * as assert from "node:assert" - * import { Order } from "effect/data" + * import { Order } from "effect" * * assert.deepStrictEqual(Order.boolean(false, true), -1) * assert.deepStrictEqual(Order.boolean(true, false), 1) @@ -156,7 +156,7 @@ export const boolean: Order = make((self, that) => self < that ? -1 : 1 * @example * ```ts * import * as assert from "node:assert" - * import { Order } from "effect/data" + * import { Order } from "effect" * * assert.deepStrictEqual(Order.bigint(1n, 2n), -1) * assert.deepStrictEqual(Order.bigint(2n, 1n), 1) @@ -174,7 +174,7 @@ export const bigint: Order = make((self, that) => self < that ? -1 : 1) * @example * ```ts * import * as assert from "node:assert" - * import { Order } from "effect/data" + * import { Order } from "effect" * * const reverseNumber = Order.reverse(Order.number) * @@ -195,7 +195,7 @@ export const reverse = (O: Order): Order => make((self, that) => O(that * @example * ```ts * import * as assert from "node:assert" - * import { Order } from "effect/data" + * import { Order } from "effect" * * const byAge = Order.mapInput(Order.number, (person: { name: string, age: number }) => person.age) * const byName = Order.mapInput(Order.string, (person: { name: string, age: number }) => person.name) @@ -230,7 +230,7 @@ export const combine: { * @example * ```ts * import * as assert from "node:assert" - * import { Order } from "effect/data" + * import { Order } from "effect" * * const emptyOrder = Order.empty() * @@ -251,7 +251,7 @@ export const empty = (): Order => make(() => 0) * @example * ```ts * import * as assert from "node:assert" - * import { Order } from "effect/data" + * import { Order } from "effect" * * const byAge = Order.mapInput(Order.number, (person: { name: string, age: number }) => person.age) * const byName = Order.mapInput(Order.string, (person: { name: string, age: number }) => person.name) @@ -286,7 +286,7 @@ export const combineAll = (collection: Iterable>): Order => * @example * ```ts * import * as assert from "node:assert" - * import { Order } from "effect/data" + * import { Order } from "effect" * * const byLength = Order.mapInput(Order.number, (s: string) => s.length) * @@ -312,7 +312,7 @@ export const mapInput: { * @example * ```ts * import * as assert from "node:assert" - * import { Order } from "effect/data" + * import { Order } from "effect" * * const date1 = new Date("2023-01-01") * const date2 = new Date("2023-01-02") @@ -334,7 +334,7 @@ export const Date: Order = mapInput(number, (date) => date.getTime()) * @example * ```ts * import * as assert from "node:assert" - * import { Order } from "effect/data" + * import { Order } from "effect" * * const tupleOrder = Order.product(Order.number, Order.string) * @@ -362,7 +362,7 @@ export const product: { * @example * ```ts * import * as assert from "node:assert" - * import { Order } from "effect/data" + * import { Order } from "effect" * * const arrayOrder = Order.all([Order.number, Order.number]) * @@ -399,7 +399,7 @@ export const all = (collection: Iterable>): Order> * @example * ```ts * import * as assert from "node:assert" - * import { Order } from "effect/data" + * import { Order } from "effect" * * const tupleOrder = Order.productMany(Order.number, [Order.number, Order.number]) * @@ -437,7 +437,7 @@ export const productMany: { * @example * ```ts * import * as assert from "node:assert" - * import { Order } from "effect/data" + * import { Order } from "effect" * * const tupleOrder = Order.tuple([Order.number, Order.number]) * @@ -462,7 +462,7 @@ export const tuple = >>( * @example * ```ts * import * as assert from "node:assert" - * import { Order } from "effect/data" + * import { Order } from "effect" * * const arrayOrder = Order.array(Order.number) * @@ -496,7 +496,7 @@ export const array = (O: Order): Order> => * @example * ```ts * import * as assert from "node:assert" - * import { Order } from "effect/data" + * import { Order } from "effect" * * const personOrder = Order.struct({ * name: Order.string, @@ -536,7 +536,7 @@ export const struct = }>( * @example * ```ts * import * as assert from "node:assert" - * import { Order } from "effect/data" + * import { Order } from "effect" * * const lessThanNumber = Order.lessThan(Order.number) * @@ -559,7 +559,7 @@ export const lessThan = (O: Order): { * @example * ```ts * import * as assert from "node:assert" - * import { Order } from "effect/data" + * import { Order } from "effect" * * const greaterThanNumber = Order.greaterThan(Order.number) * @@ -582,7 +582,7 @@ export const greaterThan = (O: Order): { * @example * ```ts * import * as assert from "node:assert" - * import { Order } from "effect/data" + * import { Order } from "effect" * * const lessThanOrEqualToNumber = Order.lessThanOrEqualTo(Order.number) * @@ -605,7 +605,7 @@ export const lessThanOrEqualTo = (O: Order): { * @example * ```ts * import * as assert from "node:assert" - * import { Order } from "effect/data" + * import { Order } from "effect" * * const greaterThanOrEqualToNumber = Order.greaterThanOrEqualTo(Order.number) * @@ -628,7 +628,7 @@ export const greaterThanOrEqualTo = (O: Order): { * @example * ```ts * import * as assert from "node:assert" - * import { Order } from "effect/data" + * import { Order } from "effect" * * const minNumber = Order.min(Order.number) * @@ -651,7 +651,7 @@ export const min = (O: Order): { * @example * ```ts * import * as assert from "node:assert" - * import { Order } from "effect/data" + * import { Order } from "effect" * * const maxNumber = Order.max(Order.number) * @@ -674,7 +674,7 @@ export const max = (O: Order): { * @example * ```ts * import * as assert from "node:assert" - * import { Order } from "effect/data" + * import { Order } from "effect" * import * as N from "effect/Number" * * const clamp = Order.clamp(N.Order)({ minimum: 1, maximum: 5 }) @@ -711,7 +711,7 @@ export const clamp = (O: Order): { * @example * ```ts * import * as assert from "node:assert" - * import { Order } from "effect/data" + * import { Order } from "effect" * * const betweenNumber = Order.between(Order.number) * diff --git a/packages/effect/src/data/Ordering.ts b/packages/effect/src/Ordering.ts similarity index 96% rename from packages/effect/src/data/Ordering.ts rename to packages/effect/src/Ordering.ts index 4942bfd39f..556d5f41a5 100644 --- a/packages/effect/src/data/Ordering.ts +++ b/packages/effect/src/Ordering.ts @@ -25,8 +25,8 @@ * @since 2.0.0 * @category utilities */ -import type { LazyArg } from "../Function.ts" -import { dual } from "../Function.ts" +import type { LazyArg } from "./Function.ts" +import { dual } from "./Function.ts" import * as Reducer_ from "./Reducer.ts" /** @@ -38,7 +38,7 @@ import * as Reducer_ from "./Reducer.ts" * * @example * ```ts - * import { Ordering } from "effect/data" + * import { Ordering } from "effect" * * // Custom comparison function * const compareNumbers = (a: number, b: number): Ordering.Ordering => { @@ -68,7 +68,7 @@ export type Ordering = -1 | 0 | 1 * * @example * ```ts - * import { Ordering } from "effect/data" + * import { Ordering } from "effect" * * // Basic reversal * console.log(Ordering.reverse(1)) // -1 (greater becomes less) @@ -104,7 +104,7 @@ export const reverse = (o: Ordering): Ordering => (o === -1 ? 1 : o === 1 ? -1 : * @example * ```ts * import * as assert from "node:assert" - * import { Ordering } from "effect/data" + * import { Ordering } from "effect" * import { constant } from "effect/Function" * * const toMessage = Ordering.match({ diff --git a/packages/effect/src/Pool.ts b/packages/effect/src/Pool.ts index 45e6ddd693..db0c1054fe 100644 --- a/packages/effect/src/Pool.ts +++ b/packages/effect/src/Pool.ts @@ -4,13 +4,13 @@ import type * as Cause from "./Cause.ts" import { Clock } from "./Clock.ts" import * as Iterable from "./collections/Iterable.ts" -import { hasProperty } from "./data/Predicate.ts" import * as Duration from "./Duration.ts" import * as Effect from "./Effect.ts" import type * as Exit from "./Exit.ts" import * as Fiber from "./Fiber.ts" import { dual, identity } from "./Function.ts" import { type Pipeable, pipeArguments } from "./interfaces/Pipeable.ts" +import { hasProperty } from "./Predicate.ts" import * as Queue from "./Queue.ts" import { UnhandledLogLevel } from "./References.ts" import * as Scope from "./Scope.ts" diff --git a/packages/effect/src/data/Predicate.ts b/packages/effect/src/Predicate.ts similarity index 93% rename from packages/effect/src/data/Predicate.ts rename to packages/effect/src/Predicate.ts index f28a3b9f28..dd080a2b3a 100644 --- a/packages/effect/src/data/Predicate.ts +++ b/packages/effect/src/Predicate.ts @@ -1,9 +1,9 @@ /** * @since 2.0.0 */ -import { dual, isFunction as isFunction_ } from "../Function.ts" -import type { TypeLambda } from "../types/HKT.ts" -import type { TupleOf, TupleOfAtLeast } from "../types/Types.ts" +import { dual, isFunction as isFunction_ } from "./Function.ts" +import type { TypeLambda } from "./types/HKT.ts" +import type { TupleOf, TupleOfAtLeast } from "./types/Types.ts" /** * A `Predicate` is a function that takes a value of type `A` and returns a boolean. @@ -11,7 +11,7 @@ import type { TupleOf, TupleOfAtLeast } from "../types/Types.ts" * * @example * ```ts - * import { Predicate } from "effect/data" + * import { Predicate } from "effect" * * const isPositive: Predicate.Predicate = (n) => n > 0 * const isEven: Predicate.Predicate = (n) => n % 2 === 0 @@ -35,7 +35,7 @@ export interface Predicate { * * @example * ```ts - * import { Predicate } from "effect/data" + * import { Predicate } from "effect" * * // Type lambda allows Predicate to work with higher-kinded type operations * // This is used internally by the Effect ecosystem for generic abstractions @@ -60,7 +60,7 @@ export interface PredicateTypeLambda extends TypeLambda { * * @example * ```ts - * import { Predicate } from "effect/data" + * import { Predicate } from "effect" * * // A refinement that narrows string to non-empty string * const isNonEmpty: Predicate.Refinement = (s): s is string => s.length > 0 @@ -88,7 +88,7 @@ export interface Refinement { * * @example * ```ts - * import { Predicate } from "effect/data" + * import { Predicate } from "effect" * * // Extract the input type from a predicate * type StringPredicate = Predicate.Predicate @@ -107,7 +107,7 @@ export declare namespace Predicate { * * @example * ```ts - * import { Predicate } from "effect/data" + * import { Predicate } from "effect" * * type StringPredicate = Predicate.Predicate * type InputType = Predicate.Predicate.In // string @@ -126,7 +126,7 @@ export declare namespace Predicate { * * @example * ```ts - * import { Predicate } from "effect/data" + * import { Predicate } from "effect" * * // A utility type for generic predicate operations * type AnyPredicate = Predicate.Predicate.Any @@ -152,7 +152,7 @@ export declare namespace Predicate { * * @example * ```ts - * import { Predicate } from "effect/data" + * import { Predicate } from "effect" * * // Extract types from a refinement * type StringFromUnknown = Predicate.Refinement @@ -172,7 +172,7 @@ export declare namespace Refinement { * * @example * ```ts - * import { Predicate } from "effect/data" + * import { Predicate } from "effect" * * type StringFromUnknown = Predicate.Refinement * type InputType = Predicate.Refinement.In // unknown @@ -190,7 +190,7 @@ export declare namespace Refinement { * * @example * ```ts - * import { Predicate } from "effect/data" + * import { Predicate } from "effect" * * type StringFromUnknown = Predicate.Refinement * type OutputType = Predicate.Refinement.Out // string @@ -209,7 +209,7 @@ export declare namespace Refinement { * * @example * ```ts - * import { Predicate } from "effect/data" + * import { Predicate } from "effect" * * // Function that composes any refinement with a predicate * const composeRefinement = ( @@ -236,7 +236,7 @@ export declare namespace Refinement { * @example * ```ts * import * as assert from "node:assert" - * import { Predicate } from "effect/data" + * import { Predicate } from "effect" * import * as N from "effect/Number" * * const minLength3 = Predicate.mapInput(N.greaterThan(2), (s: string) => s.length) @@ -263,7 +263,7 @@ export const mapInput: { * @example * ```ts * import * as assert from "node:assert" - * import { isTupleOf } from "effect/data/Predicate" + * import { isTupleOf } from "effect/Predicate" * * assert.deepStrictEqual(isTupleOf([1, 2, 3], 3), true); * assert.deepStrictEqual(isTupleOf([1, 2, 3], 2), false); @@ -292,7 +292,7 @@ export const isTupleOf: { * @example * ```ts * import * as assert from "node:assert" - * import { isTupleOfAtLeast } from "effect/data/Predicate" + * import { isTupleOfAtLeast } from "effect/Predicate" * * assert.deepStrictEqual(isTupleOfAtLeast([1, 2, 3], 3), true); * assert.deepStrictEqual(isTupleOfAtLeast([1, 2, 3], 2), true); @@ -319,7 +319,7 @@ export const isTupleOfAtLeast: { * @example * ```ts * import * as assert from "node:assert" - * import { isTruthy } from "effect/data/Predicate" + * import { isTruthy } from "effect/Predicate" * * assert.deepStrictEqual(isTruthy(1), true) * assert.deepStrictEqual(isTruthy(0), false) @@ -337,7 +337,7 @@ export const isTruthy = (input: unknown) => !!input * @example * ```ts * import * as assert from "node:assert" - * import { isSet } from "effect/data/Predicate" + * import { isSet } from "effect/Predicate" * * assert.deepStrictEqual(isSet(new Set([1, 2])), true) * assert.deepStrictEqual(isSet(new Set()), true) @@ -357,7 +357,7 @@ export const isSet = (input: unknown): input is Set => input instanceof * @example * ```ts * import * as assert from "node:assert" - * import { isMap } from "effect/data/Predicate" + * import { isMap } from "effect/Predicate" * * assert.deepStrictEqual(isMap(new Map()), true) * assert.deepStrictEqual(isMap({}), false) @@ -376,7 +376,7 @@ export const isMap = (input: unknown): input is Map => input i * @example * ```ts * import * as assert from "node:assert" - * import { isString } from "effect/data/Predicate" + * import { isString } from "effect/Predicate" * * assert.deepStrictEqual(isString("a"), true) * @@ -394,7 +394,7 @@ export const isString = (input: unknown): input is string => typeof input === "s * @example * ```ts * import * as assert from "node:assert" - * import { isNumber } from "effect/data/Predicate" + * import { isNumber } from "effect/Predicate" * * assert.deepStrictEqual(isNumber(2), true) * @@ -412,7 +412,7 @@ export const isNumber = (input: unknown): input is number => typeof input === "n * @example * ```ts * import * as assert from "node:assert" - * import { isBoolean } from "effect/data/Predicate" + * import { isBoolean } from "effect/Predicate" * * assert.deepStrictEqual(isBoolean(true), true) * @@ -430,7 +430,7 @@ export const isBoolean = (input: unknown): input is boolean => typeof input === * @example * ```ts * import * as assert from "node:assert" - * import { isBigInt } from "effect/data/Predicate" + * import { isBigInt } from "effect/Predicate" * * assert.deepStrictEqual(isBigInt(1n), true) * @@ -448,7 +448,7 @@ export const isBigInt = (input: unknown): input is bigint => typeof input === "b * @example * ```ts * import * as assert from "node:assert" - * import { isSymbol } from "effect/data/Predicate" + * import { isSymbol } from "effect/Predicate" * * assert.deepStrictEqual(isSymbol(Symbol.for("a")), true) * @@ -472,7 +472,7 @@ export const isPropertyKey = (u: unknown): u is PropertyKey => isString(u) || is * @example * ```ts * import * as assert from "node:assert" - * import { isFunction } from "effect/data/Predicate" + * import { isFunction } from "effect/Predicate" * * assert.deepStrictEqual(isFunction(isFunction), true) * @@ -490,7 +490,7 @@ export const isFunction: (input: unknown) => input is Function = isFunction_ * @example * ```ts * import * as assert from "node:assert" - * import { isUndefined } from "effect/data/Predicate" + * import { isUndefined } from "effect/Predicate" * * assert.deepStrictEqual(isUndefined(undefined), true) * @@ -509,7 +509,7 @@ export const isUndefined = (input: unknown): input is undefined => input === und * @example * ```ts * import * as assert from "node:assert" - * import { isNotUndefined } from "effect/data/Predicate" + * import { isNotUndefined } from "effect/Predicate" * * assert.deepStrictEqual(isNotUndefined(null), true) * assert.deepStrictEqual(isNotUndefined("undefined"), true) @@ -528,7 +528,7 @@ export const isNotUndefined = (input: A): input is Exclude => i * @example * ```ts * import * as assert from "node:assert" - * import { isNull } from "effect/data/Predicate" + * import { isNull } from "effect/Predicate" * * assert.deepStrictEqual(isNull(null), true) * @@ -547,7 +547,7 @@ export const isNull = (input: unknown): input is null => input === null * @example * ```ts * import * as assert from "node:assert" - * import { isNotNull } from "effect/data/Predicate" + * import { isNotNull } from "effect/Predicate" * * assert.deepStrictEqual(isNotNull(undefined), true) * assert.deepStrictEqual(isNotNull("null"), true) @@ -566,7 +566,7 @@ export const isNotNull = (input: A): input is Exclude => input !== n * @example * ```ts * import * as assert from "node:assert" - * import { isNullish } from "effect/data/Predicate" + * import { isNullish } from "effect/Predicate" * * assert.deepStrictEqual(isNullish(null), true) * assert.deepStrictEqual(isNullish(undefined), true) @@ -587,7 +587,7 @@ export const isNullish = (input: unknown): input is null | undefined => input == * @example * ```ts * import * as assert from "node:assert" - * import { isNotNullish } from "effect/data/Predicate" + * import { isNotNullish } from "effect/Predicate" * * assert.deepStrictEqual(isNotNullish(0), true) * assert.deepStrictEqual(isNotNullish(""), true) @@ -608,7 +608,7 @@ export const isNotNullish = (input: A): input is NonNullable => input != n * @example * ```ts * import * as assert from "node:assert" - * import { isNever } from "effect/data/Predicate" + * import { isNever } from "effect/Predicate" * * assert.deepStrictEqual(isNever(null), false) * assert.deepStrictEqual(isNever(undefined), false) @@ -627,7 +627,7 @@ export const isNever: (input: unknown) => input is never = (_: unknown): _ is ne * @example * ```ts * import * as assert from "node:assert" - * import { isUnknown } from "effect/data/Predicate" + * import { isUnknown } from "effect/Predicate" * * assert.deepStrictEqual(isUnknown(null), true) * assert.deepStrictEqual(isUnknown(undefined), true) @@ -658,7 +658,7 @@ export const isObjectOrArray = (input: unknown): input is { [x: PropertyKey]: un * @example * ```ts * import * as assert from "node:assert" - * import { isObject } from "effect/data/Predicate" + * import { isObject } from "effect/Predicate" * * assert.deepStrictEqual(isObject({}), true) * assert.deepStrictEqual(isObject({ a: 1 }), true) @@ -682,7 +682,7 @@ export const isObject = (input: unknown): input is { [x: PropertyKey]: unknown } * @example * ```ts * import * as assert from "node:assert" - * import { isReadonlyObject } from "effect/data/Predicate" + * import { isReadonlyObject } from "effect/Predicate" * * assert.deepStrictEqual(isReadonlyObject({ a: 1 }), true) * @@ -702,7 +702,7 @@ export const isReadonlyObject: (input: unknown) => input is { readonly [x: Prope * @example * ```ts * import * as assert from "node:assert" - * import { isObjectKeyword } from "effect/data/Predicate" + * import { isObjectKeyword } from "effect/Predicate" * * assert.deepStrictEqual(isObjectKeyword({}), true) * assert.deepStrictEqual(isObjectKeyword([]), true) @@ -725,7 +725,7 @@ export const isObjectKeyword = (input: unknown): input is object => * @example * ```ts * import * as assert from "node:assert" - * import { Predicate } from "effect/data" + * import { Predicate } from "effect" * * const hasName = Predicate.hasProperty("name") * const hasAge = Predicate.hasProperty("age") @@ -764,7 +764,7 @@ export const hasProperty: { * @example * ```ts * import * as assert from "node:assert" - * import { isTagged } from "effect/data/Predicate" + * import { isTagged } from "effect/Predicate" * * assert.deepStrictEqual(isTagged(1, "a"), false) * assert.deepStrictEqual(isTagged(null, "a"), false) @@ -791,7 +791,7 @@ export const isTagged: { * @example * ```ts * import * as assert from "node:assert" - * import { isError } from "effect/data/Predicate" + * import { isError } from "effect/Predicate" * * assert.deepStrictEqual(isError(new Error()), true) * @@ -810,7 +810,7 @@ export const isError = (input: unknown): input is Error => input instanceof Erro * @example * ```ts * import * as assert from "node:assert" - * import { isUint8Array } from "effect/data/Predicate" + * import { isUint8Array } from "effect/Predicate" * * assert.deepStrictEqual(isUint8Array(new Uint8Array()), true) * @@ -829,7 +829,7 @@ export const isUint8Array = (input: unknown): input is Uint8Array => input insta * @example * ```ts * import * as assert from "node:assert" - * import { isDate } from "effect/data/Predicate" + * import { isDate } from "effect/Predicate" * * assert.deepStrictEqual(isDate(new Date()), true) * @@ -848,7 +848,7 @@ export const isDate = (input: unknown): input is Date => input instanceof Date * @example * ```ts * import * as assert from "node:assert" - * import { isIterable } from "effect/data/Predicate" + * import { isIterable } from "effect/Predicate" * * assert.deepStrictEqual(isIterable([]), true) * assert.deepStrictEqual(isIterable(new Set()), true) @@ -870,7 +870,7 @@ export function isIterable(input: unknown): input is Iterable { * @example * ```ts * import * as assert from "node:assert" - * import { isPromise } from "effect/data/Predicate" + * import { isPromise } from "effect/Predicate" * * assert.deepStrictEqual(isPromise({}), false) * assert.deepStrictEqual(isPromise(Promise.resolve("hello")), true) @@ -890,7 +890,7 @@ export const isPromise = ( * @example * ```ts * import * as assert from "node:assert" - * import { isPromiseLike } from "effect/data/Predicate" + * import { isPromiseLike } from "effect/Predicate" * * assert.deepStrictEqual(isPromiseLike(Promise.resolve("hello")), true) * assert.deepStrictEqual(isPromiseLike({ then: () => {} }), true) @@ -912,7 +912,7 @@ export const isPromiseLike = ( * @example * ```ts * import * as assert from "node:assert" - * import { Predicate } from "effect/data" + * import { Predicate } from "effect" * * assert.deepStrictEqual(Predicate.isRegExp(/a/), true) * assert.deepStrictEqual(Predicate.isRegExp("a"), false) @@ -930,7 +930,7 @@ export const isRegExp = (input: unknown): input is RegExp => input instanceof Re * @example * ```ts * import * as assert from "node:assert" - * import { Predicate } from "effect/data" + * import { Predicate } from "effect" * * const isPositive = (n: number): n is number => n > 0 * const isInteger = (n: number): n is number => Number.isInteger(n) @@ -961,7 +961,7 @@ export const compose: { * @example * ```ts * import * as assert from "node:assert" - * import { Predicate } from "effect/data" + * import { Predicate } from "effect" * * const isPositive = (n: number) => n > 0 * const isLongString = (s: string) => s.length > 3 @@ -985,7 +985,7 @@ export const product = * @example * ```ts * import * as assert from "node:assert" - * import { Predicate } from "effect/data" + * import { Predicate } from "effect" * * const isPositive = (n: number) => n > 0 * const isEven = (n: number) => n % 2 === 0 @@ -1024,7 +1024,7 @@ export const all = ( * @example * ```ts * import * as assert from "node:assert" - * import { Predicate } from "effect/data" + * import { Predicate } from "effect" * * const isPositive = (n: number) => n > 0 * const isEven = (n: number) => n % 2 === 0 @@ -1053,7 +1053,7 @@ export const productMany = ( * @example * ```ts * import * as assert from "node:assert" - * import { Predicate } from "effect/data" + * import { Predicate } from "effect" * * const isPositive = (n: number) => n > 0 * const isString = (s: unknown): s is string => typeof s === "string" @@ -1083,7 +1083,7 @@ export const tuple: { * @example * ```ts * import * as assert from "node:assert" - * import { Predicate } from "effect/data" + * import { Predicate } from "effect" * * const isPositive = (n: number) => n > 0 * const isString = (s: unknown): s is string => typeof s === "string" @@ -1124,7 +1124,7 @@ export const struct: { * @example * ```ts * import * as assert from "node:assert" - * import { Predicate } from "effect/data" + * import { Predicate } from "effect" * import * as N from "effect/Number" * * const isPositive = Predicate.not(N.lessThan(0)) @@ -1145,7 +1145,7 @@ export const not = (self: Predicate): Predicate => (a) => !self(a) * @example * ```ts * import * as assert from "node:assert" - * import { Predicate } from "effect/data" + * import { Predicate } from "effect" * import * as N from "effect/Number" * * const nonZero = Predicate.or(N.lessThan(0), N.greaterThan(0)) @@ -1171,7 +1171,7 @@ export const or: { * @example * ```ts * import * as assert from "node:assert" - * import { Predicate } from "effect/data" + * import { Predicate } from "effect" * * const minLength = (n: number) => (s: string) => s.length >= n * const maxLength = (n: number) => (s: string) => s.length <= n @@ -1199,7 +1199,7 @@ export const and: { * @example * ```ts * import * as assert from "node:assert" - * import { Predicate } from "effect/data" + * import { Predicate } from "effect" * * const isEven = (n: number) => n % 2 === 0 * const isPositive = (n: number) => n > 0 @@ -1225,7 +1225,7 @@ export const xor: { * @example * ```ts * import * as assert from "node:assert" - * import { Predicate } from "effect/data" + * import { Predicate } from "effect" * * const isEven = (n: number) => n % 2 === 0 * const isDivisibleBy2 = (n: number) => n % 2 === 0 @@ -1267,7 +1267,7 @@ export const eqv: { * @example * ```ts * import * as assert from "node:assert" - * import { Predicate } from "effect/data" + * import { Predicate } from "effect" * * type Triple = { * readonly a: number @@ -1304,7 +1304,7 @@ export const implies: { * @example * ```ts * import * as assert from "node:assert" - * import { Predicate } from "effect/data" + * import { Predicate } from "effect" * * const isEven = (n: number) => n % 2 === 0 * const isPositive = (n: number) => n > 0 @@ -1333,7 +1333,7 @@ export const nor: { * @example * ```ts * import * as assert from "node:assert" - * import { Predicate } from "effect/data" + * import { Predicate } from "effect" * * const isEven = (n: number) => n % 2 === 0 * const isPositive = (n: number) => n > 0 @@ -1362,7 +1362,7 @@ export const nand: { * @example * ```ts * import * as assert from "node:assert" - * import { Predicate } from "effect/data" + * import { Predicate } from "effect" * * const isPositive = (n: number) => n > 0 * const isEven = (n: number) => n % 2 === 0 @@ -1392,7 +1392,7 @@ export const every = (collection: Iterable>): Predicate => (a * @example * ```ts * import * as assert from "node:assert" - * import { Predicate } from "effect/data" + * import { Predicate } from "effect" * * const isPositive = (n: number) => n > 0 * const isEven = (n: number) => n % 2 === 0 diff --git a/packages/effect/src/PubSub.ts b/packages/effect/src/PubSub.ts index d4b9ffae5a..1473692fda 100644 --- a/packages/effect/src/PubSub.ts +++ b/packages/effect/src/PubSub.ts @@ -560,7 +560,7 @@ export const size = (self: PubSub): Effect.Effect => Effect.sync(( * @example * ```ts * import { PubSub } from "effect" - * import { Option } from "effect/data" + * import { Option } from "effect" * * // Unsafe synchronous size check * declare const pubsub: PubSub.PubSub @@ -1306,7 +1306,7 @@ export const remaining = (self: Subscription): Effect.Effect => * @example * ```ts * import { PubSub } from "effect" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * declare const subscription: PubSub.Subscription * diff --git a/packages/effect/src/Pull.ts b/packages/effect/src/Pull.ts index 85cc8403b7..e0f775528a 100644 --- a/packages/effect/src/Pull.ts +++ b/packages/effect/src/Pull.ts @@ -2,12 +2,12 @@ * @since 4.0.0 */ import * as Cause from "./Cause.ts" -import * as Filter from "./data/Filter.ts" -import { hasProperty } from "./data/Predicate.ts" import type { Effect } from "./Effect.ts" import * as Exit from "./Exit.ts" +import * as Filter from "./Filter.ts" import { dual } from "./Function.ts" import * as internalEffect from "./internal/effect.ts" +import { hasProperty } from "./Predicate.ts" /** * A Pull is a specialized Effect that represents a pull-based stream operation. diff --git a/packages/effect/src/Queue.ts b/packages/effect/src/Queue.ts index 5e31e44d1d..5b85fc0823 100644 --- a/packages/effect/src/Queue.ts +++ b/packages/effect/src/Queue.ts @@ -36,15 +36,15 @@ import type { Cause } from "./Cause.ts" import * as Arr from "./collections/Array.ts" import * as MutableList from "./collections/MutableList.ts" -import * as Filter from "./data/Filter.ts" -import { hasProperty } from "./data/Predicate.ts" import type { Effect } from "./Effect.ts" import type { Exit, Failure } from "./Exit.ts" +import * as Filter from "./Filter.ts" import { constant, constTrue, dual, identity } from "./Function.ts" import type { Inspectable } from "./interfaces/Inspectable.ts" import * as core from "./internal/core.ts" import { PipeInspectableProto } from "./internal/core.ts" import * as internalEffect from "./internal/effect.ts" +import { hasProperty } from "./Predicate.ts" import * as Pull from "./Pull.ts" import type { Scheduler } from "./Scheduler.ts" import type * as Types from "./types/Types.ts" @@ -1269,7 +1269,7 @@ export { * ```ts * import { Effect } from "effect" * import { Queue } from "effect" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * const program = Effect.gen(function*() { * const queue = yield* Queue.bounded(10) @@ -1315,7 +1315,7 @@ export const isFull = (self: Dequeue): Effect => internalEf * ```ts * import { Effect } from "effect" * import { Queue } from "effect" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * // Create a queue and use unsafe operations * const program = Effect.gen(function*() { diff --git a/packages/effect/src/Random.ts b/packages/effect/src/Random.ts index 9812af8113..3f86fc76c3 100644 --- a/packages/effect/src/Random.ts +++ b/packages/effect/src/Random.ts @@ -21,9 +21,9 @@ * * @since 4.0.0 */ -import * as Predicate from "./data/Predicate.ts" import * as Effect from "./Effect.ts" import { dual } from "./Function.ts" +import * as Predicate from "./Predicate.ts" import * as ServiceMap from "./ServiceMap.ts" /** diff --git a/packages/effect/src/data/Record.ts b/packages/effect/src/Record.ts similarity index 94% rename from packages/effect/src/data/Record.ts rename to packages/effect/src/Record.ts index 676459bf6b..c63b4f02f8 100644 --- a/packages/effect/src/data/Record.ts +++ b/packages/effect/src/Record.ts @@ -4,16 +4,16 @@ * @since 2.0.0 */ -import type { Equivalence } from "../data/Equivalence.ts" -import * as Option from "../data/Option.ts" -import type { Result } from "../data/Result.ts" -import * as R from "../data/Result.ts" -import { dual, identity } from "../Function.ts" -import * as Equal from "../interfaces/Equal.ts" -import type { TypeLambda } from "../types/HKT.ts" -import type { NoInfer } from "../types/Types.ts" import type * as Combiner from "./Combiner.ts" +import type { Equivalence } from "./Equivalence.ts" +import { dual, identity } from "./Function.ts" +import * as Equal from "./interfaces/Equal.ts" +import * as Option from "./Option.ts" import * as Reducer from "./Reducer.ts" +import type { Result } from "./Result.ts" +import * as R from "./Result.ts" +import type { TypeLambda } from "./types/HKT.ts" +import type { NoInfer } from "./types/Types.ts" /** * Represents a readonly record with keys of type `K` and values of type `A`. @@ -21,7 +21,7 @@ import * as Reducer from "./Reducer.ts" * * @example * ```ts - * import { Record } from "effect/data" + * import { Record } from "effect" * * // Creating a readonly record type * type UserRecord = Record.ReadonlyRecord<"name" | "age", string | number> @@ -45,7 +45,7 @@ export type ReadonlyRecord = { * * @example * ```ts - * import { Record } from "effect/data" + * import { Record } from "effect" * * // Using NonLiteralKey to convert literal keys to generic types * type GenericKey = Record.ReadonlyRecord.NonLiteralKey<"foo" | "bar"> // string @@ -69,7 +69,7 @@ export declare namespace ReadonlyRecord { * * @example * ```ts - * import { Record } from "effect/data" + * import { Record } from "effect" * * // For literal string keys, this becomes 'string' * type Example1 = Record.ReadonlyRecord.NonLiteralKey<"foo" | "bar"> // string @@ -90,7 +90,7 @@ export declare namespace ReadonlyRecord { * * @example * ```ts - * import { Record } from "effect/data" + * import { Record } from "effect" * * // Intersection of literal keys * type Example1 = Record.ReadonlyRecord.IntersectKeys<"a" | "b", "b" | "c"> // "b" @@ -113,7 +113,7 @@ export declare namespace ReadonlyRecord { * * @example * ```ts - * import { Record } from "effect/data" + * import { Record } from "effect" * import type { TypeLambda } from "effect/types/HKT" * * // The type lambda allows records to be used as higher-kinded types @@ -135,7 +135,7 @@ export interface ReadonlyRecordTypeLambda extends Typ * * @example * ```ts - * import { Record } from "effect/data" + * import { Record } from "effect" * * // Create an empty record * const emptyRecord = Record.empty() @@ -160,7 +160,7 @@ export const empty = (): Record< * @example * ```ts * import * as assert from "node:assert" - * import { Record } from "effect/data" + * import { Record } from "effect" * * assert.deepStrictEqual(Record.isRecordEmpty({}), true); * assert.deepStrictEqual(Record.isRecordEmpty({ a: 3 }), false); @@ -178,7 +178,7 @@ export const isRecordEmpty = (self: Record): self is * @example * ```ts * import * as assert from "node:assert" - * import { Record } from "effect/data" + * import { Record } from "effect" * * assert.deepStrictEqual(Record.isReadonlyRecordEmpty({}), true); * assert.deepStrictEqual(Record.isReadonlyRecordEmpty({ a: 3 }), false); @@ -198,7 +198,7 @@ export const isReadonlyRecordEmpty: ( * @example * ```ts * import * as assert from "node:assert" - * import { Record } from "effect/data" + * import { Record } from "effect" * * const input = [1, 2, 3, 4] * @@ -240,7 +240,7 @@ export const fromIterableWith: { * @example * ```ts * import * as assert from "node:assert" - * import { Record } from "effect/data" + * import { Record } from "effect" * * const users = [ * { id: "2", name: "name2" }, @@ -273,7 +273,7 @@ export const fromIterableBy = ( * @example * ```ts * import * as assert from "node:assert" - * import { Record } from "effect/data" + * import { Record } from "effect" * * const input: Array<[string, number]> = [["a", 1], ["b", 2]] * @@ -293,7 +293,7 @@ export const fromEntries: ( * @example * ```ts * import * as assert from "node:assert" - * import { Record } from "effect/data" + * import { Record } from "effect" * * const x = { a: 1, b: 2, c: 3 } * assert.deepStrictEqual(Record.collect(x, (key, n) => [key, n]), [["a", 1], ["b", 2], ["c", 3]]) @@ -322,7 +322,7 @@ export const collect: { * @example * ```ts * import * as assert from "node:assert" - * import { Record } from "effect/data" + * import { Record } from "effect" * * const x = { a: 1, b: 2, c: 3 } * assert.deepStrictEqual(Record.toEntries(x), [["a", 1], ["b", 2], ["c", 3]]) @@ -342,7 +342,7 @@ export const toEntries: (self: ReadonlyRecord) => Arr * @example * ```ts * import * as assert from "node:assert" - * import { Record } from "effect/data" + * import { Record } from "effect" * * assert.deepStrictEqual(Record.size({ a: "a", b: 1, c: true }), 3); * ``` @@ -358,7 +358,7 @@ export const size = (self: ReadonlyRecord): number => * @example * ```ts * import * as assert from "node:assert" - * import { Record } from "effect/data" + * import { Record } from "effect" * * assert.deepStrictEqual(Record.has({ a: 1, b: 2 }, "a"), true); * assert.deepStrictEqual(Record.has(Record.empty(), "c"), false); @@ -389,8 +389,8 @@ export const has: { * @example * ```ts * import * as assert from "node:assert" - * import { Record as R } from "effect/data" - * import { Option } from "effect/data" + * import { Record as R } from "effect" + * import { Option } from "effect" * * const person: Record = { name: "John Doe", age: 35 } * @@ -416,7 +416,7 @@ export const get: { * * @example * ```ts - * import { Record } from "effect/data" + * import { Record } from "effect" * * const f = (x: number) => x * 2 * @@ -456,7 +456,7 @@ export const modify: { * * @example * ```ts - * import { Record } from "effect/data" + * import { Record } from "effect" * * Record.replace({ a: 1, b: 2, c: 3 }, 'a', 10) // { a: 10, b: 2, c: 3 } * Record.replace(Record.empty(), 'a', 10) // undefined @@ -491,7 +491,7 @@ export const replace: { * @example * ```ts * import * as assert from "node:assert" - * import { Record } from "effect/data" + * import { Record } from "effect" * * assert.deepStrictEqual(Record.remove({ a: 1, b: 2 }, "a"), { b: 2 }) * ``` @@ -521,7 +521,7 @@ export const remove: { * * @example * ```ts - * import { Record } from "effect/data" + * import { Record } from "effect" * * const input: Record = { a: 1, b: 2 } * @@ -551,7 +551,7 @@ export const pop: { * @example * ```ts * import * as assert from "node:assert" - * import { Record } from "effect/data" + * import { Record } from "effect" * * const f = (n: number) => `-${n}` * @@ -585,7 +585,7 @@ export const map: { * @example * ```ts * import * as assert from "node:assert" - * import { Record } from "effect/data" + * import { Record } from "effect" * * assert.deepStrictEqual(Record.mapKeys({ a: 3, b: 5 }, (key) => key.toUpperCase()), { A: 3, B: 5 }) * ``` @@ -622,7 +622,7 @@ export const mapKeys: { * @example * ```ts * import * as assert from "node:assert" - * import { Record } from "effect/data" + * import { Record } from "effect" * * assert.deepStrictEqual(Record.mapEntries({ a: 3, b: 5 }, (a, key) => [key.toUpperCase(), a + 1]), { A: 4, B: 6 }) * ``` @@ -660,8 +660,8 @@ export const mapEntries: { * @example * ```ts * import * as assert from "node:assert" - * import { Record } from "effect/data" - * import { Option } from "effect/data" + * import { Record } from "effect" + * import { Option } from "effect" * * const x = { a: 1, b: 2, c: 3 } * const f = (a: number, key: string) => a > 2 ? Option.some(a * 2) : Option.none() @@ -702,7 +702,7 @@ export const filterMap: { * @example * ```ts * import * as assert from "node:assert" - * import { Record } from "effect/data" + * import { Record } from "effect" * * const x = { a: 1, b: 2, c: 3, d: 4 } * assert.deepStrictEqual(Record.filter(x, (n) => n > 2), { c: 3, d: 4 }) @@ -748,8 +748,8 @@ export const filter: { * @example * ```ts * import * as assert from "node:assert" - * import { Record } from "effect/data" - * import { Option } from "effect/data" + * import { Record } from "effect" + * import { Option } from "effect" * * assert.deepStrictEqual( * Record.getSomes({ a: Option.some(1), b: Option.none(), c: Option.some(2) }), @@ -772,8 +772,8 @@ export const getSomes: ( * @example * ```ts * import * as assert from "node:assert" - * import { Record } from "effect/data" - * import { Result } from "effect/data" + * import { Record } from "effect" + * import { Result } from "effect" * * assert.deepStrictEqual( * Record.getFailures({ a: Result.succeed(1), b: Result.fail("err"), c: Result.succeed(2) }), @@ -804,8 +804,8 @@ export const getFailures = ( * @example * ```ts * import * as assert from "node:assert" - * import { Record } from "effect/data" - * import { Result } from "effect/data" + * import { Record } from "effect" + * import { Result } from "effect" * * assert.deepStrictEqual( * Record.getSuccesses({ a: Result.succeed(1), b: Result.fail("err"), c: Result.succeed(2) }), @@ -836,8 +836,8 @@ export const getSuccesses = ( * @example * ```ts * import * as assert from "node:assert" - * import { Record } from "effect/data" - * import { Result } from "effect/data" + * import { Record } from "effect" + * import { Result } from "effect" * * const x = { a: 1, b: 2, c: 3 } * const f = (n: number) => (n % 2 === 0 ? Result.succeed(n) : Result.fail(n)) @@ -884,8 +884,8 @@ export const partitionMap: { * @example * ```ts * import * as assert from "node:assert" - * import { Record } from "effect/data" - * import { Result } from "effect/data" + * import { Record } from "effect" + * import { Result } from "effect" * * assert.deepStrictEqual( * Record.separate({ a: Result.fail("e"), b: Result.succeed(1) }), @@ -906,7 +906,7 @@ export const separate: ( * @example * ```ts * import * as assert from "node:assert" - * import { Record } from "effect/data" + * import { Record } from "effect" * * assert.deepStrictEqual( * Record.partition({ a: 1, b: 3 }, (n) => n > 2), @@ -965,7 +965,7 @@ export const partition: { * @example * ```ts * import * as assert from "node:assert" - * import { Record } from "effect/data" + * import { Record } from "effect" * * assert.deepStrictEqual(Record.keys({ a: 1, b: 2, c: 3 }), ["a", "b", "c"]) * ``` @@ -982,7 +982,7 @@ export const keys = (self: ReadonlyRecord): * @example * ```ts * import * as assert from "node:assert" - * import { Record } from "effect/data" + * import { Record } from "effect" * * assert.deepStrictEqual(Record.values({ a: 1, b: 2, c: 3 }), [1, 2, 3]) * ``` @@ -998,7 +998,7 @@ export const values = (self: ReadonlyRecord): Array()) @@ -1067,7 +1067,7 @@ export const isSubrecordBy = (equivalence: Equivalence): { * @example * ```ts * import * as assert from "node:assert" - * import { Record } from "effect/data" + * import { Record } from "effect" * * assert.deepStrictEqual(Record.isSubrecord({ a: 1 } as Record, { a: 1, b: 2 }), true) * assert.deepStrictEqual(Record.isSubrecord({ a: 1, b: 2 }, { a: 1 } as Record), false) @@ -1087,7 +1087,7 @@ export const isSubrecord: { * @example * ```ts * import * as assert from "node:assert" - * import { Record } from "effect/data" + * import { Record } from "effect" * * assert.deepStrictEqual( * Record.reduce({ a: 1, b: 2, c: 3 }, 0, (acc, value, key) => acc + value), @@ -1125,7 +1125,7 @@ export const reduce: { * @example * ```ts * import * as assert from "node:assert" - * import { Record } from "effect/data" + * import { Record } from "effect" * * assert.deepStrictEqual(Record.every({ a: 1, b: 2 }, (n) => n > 0), true) * assert.deepStrictEqual(Record.every({ a: 1, b: -1 }, (n) => n > 0), false) @@ -1165,7 +1165,7 @@ export const every: { * @example * ```ts * import * as assert from "node:assert" - * import { Record } from "effect/data" + * import { Record } from "effect" * * assert.deepStrictEqual(Record.some({ a: 1, b: 2 }, (n) => n > 1), true) * assert.deepStrictEqual(Record.some({ a: 1, b: 2 }, (n) => n > 2), false) @@ -1196,7 +1196,7 @@ export const some: { * @example * ```ts * import * as assert from "node:assert" - * import { Record } from "effect/data" + * import { Record } from "effect" * * assert.deepStrictEqual( * Record.union({ a: 1, b: 2 }, { b: 3, c: 4 }, (a, b) => a + b), @@ -1254,7 +1254,7 @@ export const union: { * @example * ```ts * import * as assert from "node:assert" - * import { Record } from "effect/data" + * import { Record } from "effect" * * assert.deepStrictEqual( * Record.intersection({ a: 1, b: 2 }, { b: 3, c: 4 }, (a, b) => a + b), @@ -1302,7 +1302,7 @@ export const intersection: { * @example * ```ts * import * as assert from "node:assert" - * import { Record } from "effect/data" + * import { Record } from "effect" * * assert.deepStrictEqual( * Record.difference({ a: 1, b: 2 }, { b: 3, c: 4 }), @@ -1352,7 +1352,7 @@ export const difference: { * @example * ```ts * import * as assert from "node:assert" - * import { Record } from "effect/data" + * import { Record } from "effect" * import { Equal } from "effect/interfaces" * * const recordEquivalence = Record.getEquivalence(Equal.equivalence()) @@ -1377,7 +1377,7 @@ export const getEquivalence = ( * @example * ```ts * import * as assert from "node:assert" - * import { Record } from "effect/data" + * import { Record } from "effect" * * assert.deepStrictEqual(Record.singleton("a", 1), { a: 1 }) * ``` @@ -1425,7 +1425,7 @@ export function getReducerIntersection( * * @example * ```ts - * import { Record, Option } from "effect/data" + * import { Record, Option } from "effect" * * const record = { a: 1, b: 2, c: 3 } * const result = Record.findFirst(record, (value, key) => value > 1 && key !== "b") diff --git a/packages/effect/src/data/Redacted.ts b/packages/effect/src/Redacted.ts similarity index 86% rename from packages/effect/src/data/Redacted.ts rename to packages/effect/src/Redacted.ts index 192d3f2f8a..e1f7fb133b 100644 --- a/packages/effect/src/data/Redacted.ts +++ b/packages/effect/src/Redacted.ts @@ -6,21 +6,21 @@ * * @since 3.3.0 */ -import * as Equivalence from "../data/Equivalence.ts" -import { hasProperty, isString } from "../data/Predicate.ts" -import * as Equal from "../interfaces/Equal.ts" -import * as Hash from "../interfaces/Hash.ts" -import type { Pipeable } from "../interfaces/Pipeable.ts" -import { PipeInspectableProto } from "../internal/core.ts" -import { redactedRegistry } from "../internal/redacted.ts" -import type { Covariant } from "../types/Types.ts" +import * as Equivalence from "./Equivalence.ts" +import * as Equal from "./interfaces/Equal.ts" +import * as Hash from "./interfaces/Hash.ts" +import type { Pipeable } from "./interfaces/Pipeable.ts" +import { PipeInspectableProto } from "./internal/core.ts" +import { redactedRegistry } from "./internal/redacted.ts" +import { hasProperty, isString } from "./Predicate.ts" +import type { Covariant } from "./types/Types.ts" const TypeId = "~effect/data/Redacted" /** * @example * ```ts - * import { Redacted } from "effect/data" + * import { Redacted } from "effect" * * // Create a redacted value to protect sensitive information * const apiKey = Redacted.make("secret-key") @@ -39,7 +39,7 @@ export interface Redacted extends Redacted.Variance, Equal.Eq /** * @example * ```ts - * import { Redacted } from "effect/data" + * import { Redacted } from "effect" * * // Use the Redacted namespace for type-level operations * const secret = Redacted.make("my-secret") @@ -55,7 +55,7 @@ export declare namespace Redacted { /** * @example * ```ts - * import { Redacted } from "effect/data" + * import { Redacted } from "effect" * * // Variance interface ensures type safety for covariant type parameter * const stringSecret = Redacted.make("secret") @@ -76,7 +76,7 @@ export declare namespace Redacted { /** * @example * ```ts - * import { Redacted } from "effect/data" + * import { Redacted } from "effect" * * // Extract the value type from a Redacted instance * const secret = Redacted.make("my-secret") @@ -92,7 +92,7 @@ export declare namespace Redacted { /** * @example * ```ts - * import { Redacted } from "effect/data" + * import { Redacted } from "effect" * * const secret = Redacted.make("my-secret") * const plainString = "not-secret" @@ -112,7 +112,7 @@ export const isRedacted = (u: unknown): u is Redacted => hasProperty(u, * * @example * ```ts - * import { Redacted } from "effect/data" + * import { Redacted } from "effect" * * const API_KEY = Redacted.make("1234567890") * ``` @@ -161,7 +161,7 @@ const Proto = { * @example * ```ts * import * as assert from "node:assert" - * import { Redacted } from "effect/data" + * import { Redacted } from "effect" * * const API_KEY = Redacted.make("1234567890") * @@ -187,7 +187,7 @@ export const value = (self: Redacted): T => { * @example * ```ts * import * as assert from "node:assert" - * import { Redacted } from "effect/data" + * import { Redacted } from "effect" * * const API_KEY = Redacted.make("1234567890") * @@ -211,8 +211,8 @@ export const wipeUnsafe = (self: Redacted): boolean => redactedRegistry.de * @example * ```ts * import * as assert from "node:assert" - * import { Equivalence } from "effect/data" - * import { Redacted } from "effect/data" + * import { Equivalence } from "effect" + * import { Redacted } from "effect" * * const API_KEY1 = Redacted.make("1234567890") * const API_KEY2 = Redacted.make("1-34567890") diff --git a/packages/effect/src/data/Reducer.ts b/packages/effect/src/Reducer.ts similarity index 100% rename from packages/effect/src/data/Reducer.ts rename to packages/effect/src/Reducer.ts diff --git a/packages/effect/src/Ref.ts b/packages/effect/src/Ref.ts index 58da5b56fe..3a6ff27faf 100644 --- a/packages/effect/src/Ref.ts +++ b/packages/effect/src/Ref.ts @@ -29,11 +29,11 @@ * * @since 2.0.0 */ -import type * as Option from "./data/Option.ts" import * as Effect from "./Effect.ts" import { dual, identity } from "./Function.ts" import { PipeInspectableProto } from "./internal/core.ts" import * as MutableRef from "./MutableRef.ts" +import type * as Option from "./Option.ts" import type { Invariant } from "./types/Types.ts" const TypeId = "~effect/Ref" @@ -309,7 +309,7 @@ export const getAndUpdate = dual< * ```ts * import { Effect } from "effect" * import { Ref } from "effect" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * const program = Effect.gen(function*() { * const counter = yield* Ref.make(5) @@ -452,7 +452,7 @@ export const modify = dual< * ```ts * import { Effect } from "effect" * import { Ref } from "effect" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * const program = Effect.gen(function*() { * const counter = yield* Ref.make(5) @@ -582,7 +582,7 @@ export const updateAndGet = dual< * ```ts * import { Effect } from "effect" * import { Ref } from "effect" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * const program = Effect.gen(function*() { * const counter = yield* Ref.make(5) @@ -631,7 +631,7 @@ export const updateSome = dual< * ```ts * import { Effect } from "effect" * import { Ref } from "effect" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * const program = Effect.gen(function*() { * const counter = yield* Ref.make(10) diff --git a/packages/effect/src/References.ts b/packages/effect/src/References.ts index 1a241a708e..ed8c01592e 100644 --- a/packages/effect/src/References.ts +++ b/packages/effect/src/References.ts @@ -10,9 +10,9 @@ * * @since 4.0.0 */ -import type { ReadonlyRecord } from "./data/Record.ts" import { constTrue, constUndefined } from "./Function.ts" import type { LogLevel } from "./LogLevel.ts" +import type { ReadonlyRecord } from "./Record.ts" import { MaxOpsBeforeYield } from "./Scheduler.ts" import * as ServiceMap from "./ServiceMap.ts" import { DisablePropagation, type SpanLink, Tracer } from "./Tracer.ts" diff --git a/packages/effect/src/RegExp.ts b/packages/effect/src/RegExp.ts index e442c6aa76..017ef4e036 100644 --- a/packages/effect/src/RegExp.ts +++ b/packages/effect/src/RegExp.ts @@ -3,7 +3,7 @@ * * @since 2.0.0 */ -import * as predicate from "./data/Predicate.ts" +import * as predicate from "./Predicate.ts" /** * @since 4.0.0 diff --git a/packages/effect/src/Request.ts b/packages/effect/src/Request.ts index e0b4fada7c..49706eb03e 100644 --- a/packages/effect/src/Request.ts +++ b/packages/effect/src/Request.ts @@ -14,13 +14,13 @@ * @since 2.0.0 */ import type * as Cause from "./Cause.ts" -import { hasProperty } from "./data/Predicate.ts" import type * as Effect from "./Effect.ts" import type * as Exit from "./Exit.ts" import { dual } from "./Function.ts" import * as Equal from "./interfaces/Equal.ts" import * as core from "./internal/core.ts" import * as internalEffect from "./internal/effect.ts" +import { hasProperty } from "./Predicate.ts" import type * as ServiceMap from "./ServiceMap.ts" import type * as Types from "./types/Types.ts" diff --git a/packages/effect/src/RequestResolver.ts b/packages/effect/src/RequestResolver.ts index d878bca626..1732bca378 100644 --- a/packages/effect/src/RequestResolver.ts +++ b/packages/effect/src/RequestResolver.ts @@ -6,7 +6,6 @@ import type { NonEmptyArray } from "./collections/Array.ts" import * as Arr from "./collections/Array.ts" import * as Iterable from "./collections/Iterable.ts" import * as MutableHashMap from "./collections/MutableHashMap.ts" -import { hasProperty } from "./data/Predicate.ts" import type * as Duration from "./Duration.ts" import * as Effect from "./Effect.ts" import * as Exit from "./Exit.ts" @@ -15,6 +14,7 @@ import { type Pipeable, pipeArguments } from "./interfaces/Pipeable.ts" import { exitFail, exitSucceed } from "./internal/core.ts" import * as effect from "./internal/effect.ts" import * as internal from "./internal/request.ts" +import { hasProperty } from "./Predicate.ts" import type * as Request from "./Request.ts" import type * as Schema from "./schema/Schema.ts" import type { Scope } from "./Scope.ts" diff --git a/packages/effect/src/data/Result.ts b/packages/effect/src/Result.ts similarity index 92% rename from packages/effect/src/data/Result.ts rename to packages/effect/src/Result.ts index a10e9a5e44..8c46b83d7f 100644 --- a/packages/effect/src/data/Result.ts +++ b/packages/effect/src/Result.ts @@ -2,22 +2,22 @@ * @since 4.0.0 */ -import * as Equivalence from "../data/Equivalence.ts" -import type { Option } from "../data/Option.ts" -import type { Predicate, Refinement } from "../data/Predicate.ts" -import { isFunction } from "../data/Predicate.ts" -import type { Yieldable } from "../Effect.ts" -import type { LazyArg } from "../Function.ts" -import { constNull, constUndefined, dual, identity } from "../Function.ts" -import type { Inspectable } from "../interfaces/Inspectable.ts" -import type { Pipeable } from "../interfaces/Pipeable.ts" -import * as doNotation from "../internal/doNotation.ts" -import * as option_ from "../internal/option.ts" -import * as result from "../internal/result.ts" -import type { TypeLambda } from "../types/HKT.ts" -import type { Covariant, NoInfer, NotFunction } from "../types/Types.ts" -import type * as Unify from "../types/Unify.ts" -import * as Gen from "../Utils.ts" +import type { Yieldable } from "./Effect.ts" +import * as Equivalence from "./Equivalence.ts" +import type { LazyArg } from "./Function.ts" +import { constNull, constUndefined, dual, identity } from "./Function.ts" +import type { Inspectable } from "./interfaces/Inspectable.ts" +import type { Pipeable } from "./interfaces/Pipeable.ts" +import * as doNotation from "./internal/doNotation.ts" +import * as option_ from "./internal/option.ts" +import * as result from "./internal/result.ts" +import type { Option } from "./Option.ts" +import type { Predicate, Refinement } from "./Predicate.ts" +import { isFunction } from "./Predicate.ts" +import type { TypeLambda } from "./types/HKT.ts" +import type { Covariant, NoInfer, NotFunction } from "./types/Types.ts" +import type * as Unify from "./types/Unify.ts" +import * as Gen from "./Utils.ts" const TypeId = "~effect/data/Result" @@ -26,7 +26,7 @@ const TypeId = "~effect/data/Result" * * @example * ```ts - * import { Result } from "effect/data" + * import { Result } from "effect" * * // Create a successful result * const success = Result.succeed(42) @@ -51,7 +51,7 @@ export type Result = Success | Failure * * @example * ```ts - * import { Result } from "effect/data" + * import { Result } from "effect" * * const failure = Result.fail("Network error") * @@ -81,7 +81,7 @@ export interface Failure extends Pipeable, Inspectable, Yieldable< * * @example * ```ts - * import { Result } from "effect/data" + * import { Result } from "effect" * * const success = Result.succeed(42) * @@ -111,7 +111,7 @@ export interface Success extends Pipeable, Inspectable, Yieldable< * * @example * ```ts - * import { Result } from "effect/data" + * import { Result } from "effect" * * // This interface helps TypeScript unify different Result types * const stringResult = Result.succeed("hello") @@ -131,7 +131,7 @@ export interface ResultUnify { * * @example * ```ts - * import { Result } from "effect/data" + * import { Result } from "effect" * * // This interface is used internally by the type system * // to control when Result types should not be unified @@ -148,7 +148,7 @@ export interface ResultUnifyIgnore {} * * @example * ```ts - * import { Result } from "effect/data" + * import { Result } from "effect" * * // This interface allows Result to work with higher-kinded type utilities * declare const resultTypeLambda: Result.ResultTypeLambda @@ -167,7 +167,7 @@ export interface ResultTypeLambda extends TypeLambda { * * @example * ```ts - * import { Result } from "effect/data" + * import { Result } from "effect" * * // This namespace contains type-level utilities * const stringResult = Result.succeed("hello") @@ -184,7 +184,7 @@ export declare namespace Result { * * @example * ```ts - * import { Result } from "effect/data" + * import { Result } from "effect" * * // This type utility extracts the failure type * const errorResult = Result.fail("error") @@ -200,7 +200,7 @@ export declare namespace Result { * * @example * ```ts - * import { Result } from "effect/data" + * import { Result } from "effect" * * // This type utility extracts the success type * const successResult = Result.succeed(42) @@ -218,7 +218,7 @@ export declare namespace Result { * * @example * ```ts - * import { Result } from "effect/data" + * import { Result } from "effect" * * const result = Result.succeed(42) * @@ -238,7 +238,7 @@ export const succeed: (right: A) => Result = result.succeed * * @example * ```ts - * import { Result } from "effect/data" + * import { Result } from "effect" * * const result = Result.fail("Something went wrong") * @@ -261,7 +261,7 @@ export { * @example * ```ts * import * as assert from "node:assert" - * import { Result } from "effect/data" + * import { Result } from "effect" * * const result = Result.void * assert.deepStrictEqual(result, Result.succeed(undefined)) @@ -281,7 +281,7 @@ export { * @example * ```ts * import * as assert from "node:assert" - * import { Result } from "effect/data" + * import { Result } from "effect" * * assert.deepStrictEqual(Result.fromNullishOr(1, () => 'fallback'), Result.succeed(1)) * assert.deepStrictEqual(Result.fromNullishOr(null, () => 'fallback'), Result.fail('fallback')) @@ -303,8 +303,8 @@ export const fromNullishOr: { * @example * ```ts * import * as assert from "node:assert" - * import { Result } from "effect/data" - * import { Option } from "effect/data" + * import { Result } from "effect" + * import { Option } from "effect" * * assert.deepStrictEqual(Result.fromOption(Option.some(1), () => 'error'), Result.succeed(1)) * assert.deepStrictEqual(Result.fromOption(Option.none(), () => 'error'), Result.fail('error')) @@ -355,7 +355,7 @@ export { * @example * ```ts * import * as assert from "node:assert" - * import { Result } from "effect/data" + * import { Result } from "effect" * * const success = Result.try(() => JSON.parse('{"name": "John"}')) * assert.deepStrictEqual(success, Result.succeed({ name: "John" })) @@ -376,7 +376,7 @@ export { * @example * ```ts * import * as assert from "node:assert" - * import { Result } from "effect/data" + * import { Result } from "effect" * * assert.deepStrictEqual(Result.isResult(Result.succeed(1)), true) * assert.deepStrictEqual(Result.isResult(Result.fail("a")), true) @@ -394,7 +394,7 @@ export const isResult: (input: unknown) => input is Result = r * @example * ```ts * import * as assert from "node:assert" - * import { Result } from "effect/data" + * import { Result } from "effect" * * assert.deepStrictEqual(Result.isFailure(Result.succeed(1)), false) * assert.deepStrictEqual(Result.isFailure(Result.fail("a")), true) @@ -411,7 +411,7 @@ export const isFailure: (self: Result) => self is Failure = re * @example * ```ts * import * as assert from "node:assert" - * import { Result } from "effect/data" + * import { Result } from "effect" * * assert.deepStrictEqual(Result.isSuccess(Result.succeed(1)), true) * assert.deepStrictEqual(Result.isSuccess(Result.fail("a")), false) @@ -428,8 +428,8 @@ export const isSuccess: (self: Result) => self is Success = re * @example * ```ts * import * as assert from "node:assert" - * import { Result } from "effect/data" - * import { Option } from "effect/data" + * import { Result } from "effect" + * import { Option } from "effect" * * assert.deepStrictEqual(Result.getSuccess(Result.succeed('ok')), Option.some('ok')) * assert.deepStrictEqual(Result.getSuccess(Result.fail('err')), Option.none()) @@ -446,8 +446,8 @@ export const getSuccess: (self: Result) => Option = result.getSuc * @example * ```ts * import * as assert from "node:assert" - * import { Result } from "effect/data" - * import { Option } from "effect/data" + * import { Result } from "effect" + * import { Option } from "effect" * * assert.deepStrictEqual(Result.getFailure(Result.succeed('ok')), Option.none()) * assert.deepStrictEqual(Result.getFailure(Result.fail('err')), Option.some('err')) @@ -464,8 +464,8 @@ export const getFailure: (self: Result) => Option = result.getFai * **Example** * * ```ts - * import { Result } from "effect/data" - * import { Equivalence } from "effect/data" + * import { Result } from "effect" + * import { Equivalence } from "effect" * * const stringEquivalence = Equivalence.strict() * const numberEquivalence = Equivalence.strict() @@ -503,7 +503,7 @@ export const getEquivalence = ( * ```ts * import * as assert from "node:assert" * import { pipe } from "effect" - * import { Result } from "effect/data" + * import { Result } from "effect" * * const success = pipe( * Result.succeed(1), @@ -551,7 +551,7 @@ export const mapBoth: { * ```ts * import * as assert from "node:assert" * import { pipe } from "effect" - * import { Result } from "effect/data" + * import { Result } from "effect" * * const success = pipe( * Result.succeed(1), @@ -585,7 +585,7 @@ export const mapError: { * ```ts * import * as assert from "node:assert" * import { pipe } from "effect" - * import { Result } from "effect/data" + * import { Result } from "effect" * * const success = pipe( * Result.succeed(1), @@ -621,7 +621,7 @@ export const map: { * ```ts * import * as assert from "node:assert" * import { pipe } from "effect" - * import { Result } from "effect/data" + * import { Result } from "effect" * * const onFailure = (strings: ReadonlyArray): string => `strings: ${strings.join(', ')}` * @@ -662,7 +662,7 @@ export const match: { * ```ts * import * as assert from "node:assert" * import { pipe } from "effect" - * import { Result } from "effect/data" + * import { Result } from "effect" * * const isPositive = (n: number): boolean => n > 0 * @@ -715,7 +715,7 @@ export const liftPredicate: { * ```ts * import * as assert from "node:assert" * import { pipe } from "effect" - * import { Result } from "effect/data" + * import { Result } from "effect" * * const isPositive = (n: number): boolean => n > 0 * @@ -765,7 +765,7 @@ export const filterOrFail: { * @example * ```ts * import * as assert from "node:assert" - * import { Result } from "effect/data" + * import { Result } from "effect" * * const success = Result.succeed(42) * assert.deepStrictEqual(Result.merge(success), 42) @@ -785,7 +785,7 @@ export const merge: (self: Result) => E | A = match({ onFailure: ide * @example * ```ts * import * as assert from "node:assert" - * import { Result } from "effect/data" + * import { Result } from "effect" * * assert.deepStrictEqual(Result.getOrElse(Result.succeed(1), (error) => error + "!"), 1) * assert.deepStrictEqual(Result.getOrElse(Result.fail("not a number"), (error) => error + "!"), "not a number!") @@ -809,7 +809,7 @@ export const getOrElse: { * @example * ```ts * import * as assert from "node:assert" - * import { Result } from "effect/data" + * import { Result } from "effect" * * assert.deepStrictEqual(Result.getOrNull(Result.succeed(1)), 1) * assert.deepStrictEqual(Result.getOrNull(Result.fail("a")), null) @@ -826,7 +826,7 @@ export const getOrNull: (self: Result) => A | null = getOrElse(const * @example * ```ts * import * as assert from "node:assert" - * import { Result } from "effect/data" + * import { Result } from "effect" * * assert.deepStrictEqual(Result.getOrUndefined(Result.succeed(1)), 1) * assert.deepStrictEqual(Result.getOrUndefined(Result.fail("a")), undefined) @@ -844,7 +844,7 @@ export const getOrUndefined: (self: Result) => A | undefined = getOr * **Example** * * ```ts - * import { Result } from "effect/data" + * import { Result } from "effect" * * Result.getOrThrowWith(Result.succeed(1), () => new Error('Unexpected Err')) * // => 1 @@ -875,7 +875,7 @@ export const getOrThrowWith: { * @example * ```ts * import * as assert from "node:assert" - * import { Result } from "effect/data" + * import { Result } from "effect" * * assert.deepStrictEqual(Result.getOrThrow(Result.succeed(1)), 1) * assert.throws(() => Result.getOrThrow(Result.fail("error"))) @@ -895,7 +895,7 @@ export const getOrThrow: (self: Result) => A = getOrThrowWith(identi * ```ts * import * as assert from "node:assert" * import { pipe } from "effect" - * import { Result } from "effect/data" + * import { Result } from "effect" * * const success = pipe( * Result.succeed(1), @@ -929,7 +929,7 @@ export const orElse: { * ```ts * import * as assert from "node:assert" * import { pipe } from "effect" - * import { Result } from "effect/data" + * import { Result } from "effect" * * const parseAndDouble = (s: string) => * pipe( @@ -960,7 +960,7 @@ export const flatMap: { * ```ts * import * as assert from "node:assert" * import { pipe } from "effect" - * import { Result } from "effect/data" + * import { Result } from "effect" * * const success = pipe( * Result.succeed(1), @@ -1009,7 +1009,7 @@ export const andThen: { * @example * ```ts * import * as assert from "node:assert" - * import { Result } from "effect/data" + * import { Result } from "effect" * * assert.deepStrictEqual(Result.all([Result.succeed(1), Result.succeed(2)]), Result.succeed([1, 2])) * assert.deepStrictEqual(Result.all({ right: Result.succeed(1), b: Result.succeed("hello") }), Result.succeed({ right: 1, b: "hello" })) @@ -1062,7 +1062,7 @@ export const all: > | Record(self: Result): Result => * @example * ```ts * import * as assert from "node:assert" - * import { Result } from "effect/data" + * import { Result } from "effect" * * const program = Result.gen(function* () { * const a = yield* Result.succeed(1) @@ -1135,7 +1135,7 @@ export const gen: Gen.Gen = (...args) => { * ```ts * import * as assert from "node:assert" * import { pipe } from "effect" - * import { Result } from "effect/data" + * import { Result } from "effect" * * const result = pipe( * Result.Do, @@ -1169,7 +1169,7 @@ export const Do: Result<{}> = succeed({}) * ```ts * import * as assert from "node:assert" * import { pipe } from "effect" - * import { Result } from "effect/data" + * import { Result } from "effect" * * const result = pipe( * Result.Do, @@ -1213,7 +1213,7 @@ export const bind: { * ```ts * import * as assert from "node:assert" * import { pipe } from "effect" - * import { Result } from "effect/data" + * import { Result } from "effect" * * const result = pipe( * Result.Do, @@ -1263,7 +1263,7 @@ export { * ```ts * import * as assert from "node:assert" * import { pipe } from "effect" - * import { Result } from "effect/data" + * import { Result } from "effect" * * const result = pipe( * Result.Do, @@ -1293,8 +1293,8 @@ export { * @example * ```ts * import { Effect } from "effect" - * import { Result } from "effect/data" - * import { Option } from "effect/data" + * import { Result } from "effect" + * import { Option } from "effect" * * // ┌─── Option> * // ▼ @@ -1319,8 +1319,8 @@ export const transposeOption = ( * * @example * ```ts - * import { Result } from "effect/data" - * import { Option } from "effect/data" + * import { Result } from "effect" + * import { Option } from "effect" * * const parseNumber = (s: string) => * isNaN(Number(s)) ? Result.fail("Invalid number") : Result.succeed(Number(s)) @@ -1357,8 +1357,8 @@ export const transposeMapOption = dual< * @example * ```ts * import * as assert from "node:assert" - * import { Result } from "effect/data" - * import { Option } from "effect/data" + * import { Result } from "effect" + * import { Option } from "effect" * * const result = Result.succeedNone * assert.deepStrictEqual(result, Result.succeed(Option.none())) @@ -1375,8 +1375,8 @@ export const succeedNone = succeed(option_.none) * @example * ```ts * import * as assert from "node:assert" - * import { Result } from "effect/data" - * import { Option } from "effect/data" + * import { Result } from "effect" + * import { Option } from "effect" * * const result = Result.succeedSome(42) * assert.deepStrictEqual(result, Result.succeed(Option.some(42))) @@ -1394,7 +1394,7 @@ export const succeedSome = (a: A): Result, E> => succeed * ```ts * import * as assert from "node:assert" * import { pipe } from "effect" - * import { Result } from "effect/data" + * import { Result } from "effect" * * let sideEffect = 0 * const success = pipe( diff --git a/packages/effect/src/Schedule.ts b/packages/effect/src/Schedule.ts index f55cbd299a..c209a2f0f2 100644 --- a/packages/effect/src/Schedule.ts +++ b/packages/effect/src/Schedule.ts @@ -32,8 +32,6 @@ * @since 2.0.0 */ import * as Cron from "./Cron.ts" -import { hasProperty } from "./data/Predicate.ts" -import * as Result from "./data/Result.ts" import type * as DateTime from "./DateTime.ts" import * as Duration from "./Duration.ts" import type { Effect } from "./Effect.ts" @@ -42,7 +40,9 @@ import { constant, constTrue, dual, identity } from "./Function.ts" import { type Pipeable, pipeArguments } from "./interfaces/Pipeable.ts" import { isEffect } from "./internal/core.ts" import * as effect from "./internal/effect.ts" +import { hasProperty } from "./Predicate.ts" import * as Pull from "./Pull.ts" +import * as Result from "./Result.ts" import * as ServiceMap from "./ServiceMap.ts" import type { Contravariant, Covariant, Mutable } from "./types/Types.ts" @@ -754,7 +754,7 @@ export const andThen: { * ```ts * import { Effect } from "effect" * import { Schedule } from "effect" - * import { Result } from "effect/data" + * import { Result } from "effect" * import { Console } from "effect" * * // Track which phase of the schedule we're in @@ -3318,7 +3318,7 @@ export const satisfiesOutputType = () => * @example * ```ts * import { Schedule } from "effect" - * import { Data } from "effect/data" + * import { Data } from "effect" * * // Create a custom error using Data.TaggedError * class CustomError extends Data.TaggedError("CustomError")<{ diff --git a/packages/effect/src/ScopedCache.ts b/packages/effect/src/ScopedCache.ts index a5784eb5b3..fa11d91261 100644 --- a/packages/effect/src/ScopedCache.ts +++ b/packages/effect/src/ScopedCache.ts @@ -3,8 +3,6 @@ */ import * as Arr from "./collections/Array.ts" import * as MutableHashMap from "./collections/MutableHashMap.ts" -import * as Option from "./data/Option.ts" -import * as Predicate from "./data/Predicate.ts" import * as Deferred from "./Deferred.ts" import * as Duration from "./Duration.ts" import type * as Effect from "./Effect.ts" @@ -15,6 +13,8 @@ import type { Pipeable } from "./interfaces/Pipeable.ts" import * as core from "./internal/core.ts" import { PipeInspectableProto } from "./internal/core.ts" import * as effect from "./internal/effect.ts" +import * as Option from "./Option.ts" +import * as Predicate from "./Predicate.ts" import * as Scope from "./Scope.ts" import * as ServiceMap from "./ServiceMap.ts" diff --git a/packages/effect/src/ServiceMap.ts b/packages/effect/src/ServiceMap.ts index 3fffb1404b..b06bd9ec80 100644 --- a/packages/effect/src/ServiceMap.ts +++ b/packages/effect/src/ServiceMap.ts @@ -10,8 +10,6 @@ * * @since 4.0.0 */ -import * as Option from "./data/Option.ts" -import { hasProperty } from "./data/Predicate.ts" import type { Effect, EffectIterator, Yieldable } from "./Effect.ts" import { constant, dual, type LazyArg } from "./Function.ts" import * as Equal from "./interfaces/Equal.ts" @@ -20,6 +18,8 @@ import type { Inspectable } from "./interfaces/Inspectable.ts" import type { Pipeable } from "./interfaces/Pipeable.ts" import { exitSucceed, PipeInspectableProto, withFiber, YieldableProto } from "./internal/core.ts" import type { ErrorWithStackTraceLimit } from "./internal/tracer.ts" +import * as Option from "./Option.ts" +import { hasProperty } from "./Predicate.ts" import type * as Types from "./types/Types.ts" const ServiceTypeId = "~effect/ServiceMap/Service" as const @@ -752,7 +752,7 @@ const serviceNotFoundError = (service: Service) => { * ```ts * import * as assert from "node:assert" * import { ServiceMap } from "effect" - * import { Option } from "effect/data" + * import { Option } from "effect" * * const Port = ServiceMap.Service<{ PORT: number }>("Port") * const Timeout = ServiceMap.Service<{ TIMEOUT: number }>("Timeout") @@ -861,7 +861,7 @@ export const mergeAll = >( * import * as assert from "node:assert" * import { pipe } from "effect" * import { ServiceMap } from "effect" - * import { Option } from "effect/data" + * import { Option } from "effect" * * const Port = ServiceMap.Service<{ PORT: number }>("Port") * const Timeout = ServiceMap.Service<{ TIMEOUT: number }>("Timeout") @@ -900,7 +900,7 @@ export const pick = >>( * import * as assert from "node:assert" * import { pipe } from "effect" * import { ServiceMap } from "effect" - * import { Option } from "effect/data" + * import { Option } from "effect" * * const Port = ServiceMap.Service<{ PORT: number }>("Port") * const Timeout = ServiceMap.Service<{ TIMEOUT: number }>("Timeout") diff --git a/packages/effect/src/Sink.ts b/packages/effect/src/Sink.ts index d11af6d7f7..76b899874b 100644 --- a/packages/effect/src/Sink.ts +++ b/packages/effect/src/Sink.ts @@ -6,14 +6,14 @@ import * as Channel from "./Channel.ts" import type { NonEmptyReadonlyArray } from "./collections/Array.ts" import * as Arr from "./collections/Array.ts" import * as Chunk from "./collections/Chunk.ts" -import * as Filter from "./data/Filter.ts" -import * as Option from "./data/Option.ts" -import type { Predicate } from "./data/Predicate.ts" -import { hasProperty } from "./data/Predicate.ts" import * as Effect from "./Effect.ts" +import * as Filter from "./Filter.ts" import type { LazyArg } from "./Function.ts" import { constant, constTrue, constVoid, dual, identity } from "./Function.ts" import { type Pipeable, pipeArguments } from "./interfaces/Pipeable.ts" +import * as Option from "./Option.ts" +import type { Predicate } from "./Predicate.ts" +import { hasProperty } from "./Predicate.ts" import * as Pull from "./Pull.ts" import type * as Scope from "./Scope.ts" import type * as Types from "./types/Types.ts" diff --git a/packages/effect/src/Stream.ts b/packages/effect/src/Stream.ts index 165d681b8a..6e9e9d1d62 100644 --- a/packages/effect/src/Stream.ts +++ b/packages/effect/src/Stream.ts @@ -9,15 +9,12 @@ import * as Arr from "./collections/Array.ts" import * as Iterable from "./collections/Iterable.ts" import * as MutableHashMap from "./collections/MutableHashMap.ts" import * as MutableList from "./collections/MutableList.ts" -import * as Filter from "./data/Filter.ts" -import * as Option from "./data/Option.ts" -import { hasProperty, isTagged } from "./data/Predicate.ts" -import * as Result from "./data/Result.ts" import * as Duration from "./Duration.ts" import * as Effect from "./Effect.ts" import * as ExecutionPlan from "./ExecutionPlan.ts" import * as Exit from "./Exit.ts" import * as Fiber from "./Fiber.ts" +import * as Filter from "./Filter.ts" import type { LazyArg } from "./Function.ts" import { constant, constTrue, constVoid, dual, identity } from "./Function.ts" import * as Equal from "./interfaces/Equal.ts" @@ -25,11 +22,14 @@ import { type Pipeable, pipeArguments } from "./interfaces/Pipeable.ts" import * as internalExecutionPlan from "./internal/executionPlan.ts" import { addSpanStackTrace } from "./internal/tracer.ts" import type * as Layer from "./Layer.ts" +import * as Option from "./Option.ts" +import { hasProperty, isTagged } from "./Predicate.ts" import type * as PubSub from "./PubSub.ts" import * as Pull from "./Pull.ts" import * as Queue from "./Queue.ts" import * as RcMap from "./RcMap.ts" import * as RcRef from "./RcRef.ts" +import * as Result from "./Result.ts" import * as Schedule from "./Schedule.ts" import * as Scope from "./Scope.ts" import * as ServiceMap from "./ServiceMap.ts" @@ -1129,7 +1129,7 @@ export const unfold = ( * ```ts * import { Stream } from "effect" * import { Effect } from "effect" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * const stream = Stream.paginate(0, (n: number) => * Effect.succeed([ @@ -4220,7 +4220,7 @@ export const slidingSize: { * * ```ts * import { pipe } from "effect" - * import { Filter } from "effect/data" + * import { Filter } from "effect" * import { Stream } from "effect" * * pipe( diff --git a/packages/effect/src/String.ts b/packages/effect/src/String.ts index eeb9275306..9d113aac51 100644 --- a/packages/effect/src/String.ts +++ b/packages/effect/src/String.ts @@ -7,14 +7,14 @@ */ import type { NonEmptyArray } from "./collections/Array.ts" -import * as order from "./data/Order.ts" -import type * as Ordering from "./data/Ordering.ts" -import type { Refinement } from "./data/Predicate.ts" -import * as predicate from "./data/Predicate.ts" -import * as Reducer from "./data/Reducer.ts" import { dual } from "./Function.ts" import * as readonlyArray from "./internal/array.ts" import * as number from "./Number.ts" +import * as order from "./Order.ts" +import type * as Ordering from "./Ordering.ts" +import type { Refinement } from "./Predicate.ts" +import * as predicate from "./Predicate.ts" +import * as Reducer from "./Reducer.ts" /** * Reference to the global `String` constructor. diff --git a/packages/effect/src/data/Struct.ts b/packages/effect/src/Struct.ts similarity index 94% rename from packages/effect/src/data/Struct.ts rename to packages/effect/src/Struct.ts index 977d44f4e3..b720970cf0 100644 --- a/packages/effect/src/data/Struct.ts +++ b/packages/effect/src/Struct.ts @@ -4,10 +4,10 @@ * @since 2.0.0 */ -import * as Equivalence from "../data/Equivalence.ts" -import * as order from "../data/Order.ts" -import { dual } from "../Function.ts" import * as Combiner from "./Combiner.ts" +import * as Equivalence from "./Equivalence.ts" +import { dual } from "./Function.ts" +import * as order from "./Order.ts" import * as Reducer from "./Reducer.ts" /** @@ -15,7 +15,7 @@ import * as Reducer from "./Reducer.ts" * * @example * ```ts - * import type { Struct } from "effect/data" + * import type { Struct } from "effect" * * type Original = { a: string } & { b: number } * type Simplified = Struct.Simplify @@ -32,7 +32,7 @@ export type Simplify = { [K in keyof T]: T[K] } & {} * * @example * ```ts - * import type { Struct } from "effect/data" + * import type { Struct } from "effect" * * type ReadOnly = { readonly a: string; readonly b: number } * type Mutable = Struct.Mutable @@ -50,7 +50,7 @@ export type Mutable = { -readonly [K in keyof T]: T[K] } & {} * * @example * ```ts - * import type { Struct } from "effect/data" + * import type { Struct } from "effect" * * type A = { a: string; b: number } * type B = { b: boolean; c: string } @@ -69,7 +69,7 @@ export type Assign = keyof T & keyof U extends never ? T & U : Omit(self: S): Array<(keyof S) & string> => * @example * ```ts * import { pipe } from "effect" - * import { Struct } from "effect/data" + * import { Struct } from "effect" * * console.log(pipe({ a: "a", b: 1, c: true }, Struct.pick(["a", "b"]))) * // { a: "a", b: 1 } @@ -139,7 +139,7 @@ export const pick: { * @example * ```ts * import { pipe } from "effect" - * import { Struct } from "effect/data" + * import { Struct } from "effect" * * console.log(pipe({ a: "a", b: 1, c: true }, Struct.omit(["c"]))) * // { a: "a", b: 1 } @@ -166,7 +166,7 @@ export const omit: { * @example * ```ts * import { pipe } from "effect" - * import { Struct } from "effect/data" + * import { Struct } from "effect" * * console.log(pipe({ a: "a", b: 1 }, Struct.assign({ b: 2, c: 3 }))) * // { a: "a", b: 2, c: 3 } @@ -199,7 +199,7 @@ type Evolved = Simplify< * @example * ```ts * import { pipe } from "effect" - * import { Struct } from "effect/data" + * import { Struct } from "effect" * * console.log( * pipe( @@ -238,7 +238,7 @@ type KeyEvolved = Simplify< * @example * ```ts * import { pipe } from "effect" - * import { Struct } from "effect/data" + * import { Struct } from "effect" * * const result = pipe( * { a: 1, b: 2 }, @@ -282,7 +282,7 @@ type EntryEvolved = { * @example * ```ts * import { pipe } from "effect" - * import { Struct } from "effect/data" + * import { Struct } from "effect" * * const result = pipe( * { a: 1, b: 2 }, @@ -314,7 +314,7 @@ export const evolveEntries: { * @example * ```ts * import { pipe } from "effect" - * import { Struct } from "effect/data" + * import { Struct } from "effect" * * const result = pipe( * { a: 1, b: 2, c: 3 }, @@ -347,7 +347,7 @@ export const renameKeys: { * * @example * ```ts - * import { Struct, Equivalence } from "effect/data" + * import { Struct, Equivalence } from "effect" * * const PersonEquivalence = Struct.getEquivalence({ * name: Equivalence.strict(), @@ -373,7 +373,7 @@ export const getEquivalence = Equivalence.struct * * @example * ```ts - * import { Struct } from "effect/data" + * import { Struct } from "effect" * import * as S from "effect/String" * import * as N from "effect/Number" * @@ -399,7 +399,7 @@ export const getOrder = order.struct * * @example * ```ts - * import { Struct } from "effect/data" + * import { Struct } from "effect" * * // Lambda is used internally for type-level operations * type MyLambda = Struct.Lambda @@ -418,7 +418,7 @@ export interface Lambda { * * @example * ```ts - * import type { Struct } from "effect/data" + * import type { Struct } from "effect" * * // Applied to a concrete lambda type * type StringToNumber = Struct.Lambda & { @@ -439,7 +439,7 @@ export type Apply = (L & { readonly "~lambda.in": V })["~la * * @example * ```ts - * import { Struct } from "effect/data" + * import { Struct } from "effect" * * const toString = (n: number) => n.toString() * const lambdaFn = Struct.lambda(toString) @@ -457,7 +457,7 @@ export const lambda = any>( * * @example * ```ts - * import { Struct } from "effect/data" + * import { Struct } from "effect" * * // Used with lambda functions for type-level operations * const struct = { a: 1, b: 2, c: 3 } @@ -487,7 +487,7 @@ export const map: { * * @example * ```ts - * import { Struct } from "effect/data" + * import { Struct } from "effect" * * // Used with lambda functions for selective transformation * const struct = { a: 1, b: 2, c: 3 } @@ -526,7 +526,7 @@ export const mapPick: { * * @example * ```ts - * import { Struct } from "effect/data" + * import { Struct } from "effect" * * // Used with lambda functions for selective omission * const struct = { a: 1, b: 2, c: 3 } @@ -600,7 +600,7 @@ function buildStruct< * **Example** * * ```ts - * import { Struct } from "effect/data" + * import { Struct } from "effect" * import { Number, String } from "effect" * * const C = Struct.getCombiner<{ readonly n: number; readonly s: string }>({ @@ -646,7 +646,7 @@ export function getCombiner( * **Example** * * ```ts - * import { Struct } from "effect/data" + * import { Struct } from "effect" * import { Number, String } from "effect" * * const R = Struct.getReducer<{ readonly n: number; readonly s: string }>({ diff --git a/packages/effect/src/SubscriptionRef.ts b/packages/effect/src/SubscriptionRef.ts index 2ce8480376..84428e2004 100644 --- a/packages/effect/src/SubscriptionRef.ts +++ b/packages/effect/src/SubscriptionRef.ts @@ -1,10 +1,10 @@ /** * @since 2.0.0 */ -import * as Option from "./data/Option.ts" import * as Effect from "./Effect.ts" import { dual, identity } from "./Function.ts" import { PipeInspectableProto } from "./internal/core.ts" +import * as Option from "./Option.ts" import * as PubSub from "./PubSub.ts" import * as Ref from "./Ref.ts" import * as Stream from "./Stream.ts" @@ -268,7 +268,7 @@ export const getAndUpdateEffect: { * @example * ```ts * import { Effect } from "effect" - * import { Option } from "effect/data" + * import { Option } from "effect" * import { SubscriptionRef } from "effect" * * const program = Effect.gen(function* () { @@ -312,7 +312,7 @@ export const getAndUpdateSome: { * @example * ```ts * import { Effect } from "effect" - * import { Option } from "effect/data" + * import { Option } from "effect" * import { SubscriptionRef } from "effect" * * const program = Effect.gen(function* () { @@ -448,7 +448,7 @@ export const modifyEffect: { * @example * ```ts * import { Effect } from "effect" - * import { Option } from "effect/data" + * import { Option } from "effect" * import { SubscriptionRef } from "effect" * * const program = Effect.gen(function* () { @@ -496,7 +496,7 @@ export const modifySome: { * @example * ```ts * import { Effect } from "effect" - * import { Option } from "effect/data" + * import { Option } from "effect" * import { SubscriptionRef } from "effect" * * const program = Effect.gen(function* () { @@ -749,7 +749,7 @@ export const updateAndGetEffect: { * @example * ```ts * import { Effect } from "effect" - * import { Option } from "effect/data" + * import { Option } from "effect" * import { SubscriptionRef } from "effect" * * const program = Effect.gen(function* () { @@ -791,7 +791,7 @@ export const updateSome: { * @example * ```ts * import { Effect } from "effect" - * import { Option } from "effect/data" + * import { Option } from "effect" * import { SubscriptionRef } from "effect" * * const program = Effect.gen(function* () { @@ -840,7 +840,7 @@ export const updateSomeEffect: { * @example * ```ts * import { Effect } from "effect" - * import { Option } from "effect/data" + * import { Option } from "effect" * import { SubscriptionRef } from "effect" * * const program = Effect.gen(function* () { @@ -881,7 +881,7 @@ export const updateSomeAndGet: { * @example * ```ts * import { Effect } from "effect" - * import { Option } from "effect/data" + * import { Option } from "effect" * import { SubscriptionRef } from "effect" * * const program = Effect.gen(function* () { diff --git a/packages/effect/src/Symbol.ts b/packages/effect/src/Symbol.ts index bd8642c2b4..e9539752b7 100644 --- a/packages/effect/src/Symbol.ts +++ b/packages/effect/src/Symbol.ts @@ -2,14 +2,14 @@ * @since 2.0.0 */ -import * as predicate from "./data/Predicate.ts" +import * as predicate from "./Predicate.ts" /** * Tests if a value is a `symbol`. * * @example * ```ts - * import * as Predicate from "effect/data/Predicate" + * import * as Predicate from "effect/Predicate" * import * as assert from "node:assert" * * assert.deepStrictEqual(Predicate.isSymbol(Symbol.for("a")), true) diff --git a/packages/effect/src/SynchronizedRef.ts b/packages/effect/src/SynchronizedRef.ts index 4364e81326..6c73e7ba38 100644 --- a/packages/effect/src/SynchronizedRef.ts +++ b/packages/effect/src/SynchronizedRef.ts @@ -1,10 +1,10 @@ /** * @since 2.0.0 */ -import * as Option from "./data/Option.ts" import * as Effect from "./Effect.ts" import { dual } from "./Function.ts" import { PipeInspectableProto } from "./internal/core.ts" +import * as Option from "./Option.ts" import * as Ref from "./Ref.ts" const TypeId = "~effect/SynchronizedRef" diff --git a/packages/effect/src/Tracer.ts b/packages/effect/src/Tracer.ts index fb6d2dbdab..d06d1202a9 100644 --- a/packages/effect/src/Tracer.ts +++ b/packages/effect/src/Tracer.ts @@ -295,7 +295,7 @@ export interface SpanLink { * ```ts * import { Tracer } from "effect" * import { ServiceMap } from "effect" - * import { Option } from "effect/data" + * import { Option } from "effect" * * // Create a custom tracer with logging * const loggingTracer = Tracer.make({ @@ -418,7 +418,7 @@ export const Tracer: ServiceMap.Reference = ServiceMap.Reference * ```ts * import { Tracer } from "effect" * import { ServiceMap } from "effect" - * import { Option } from "effect/data" + * import { Option } from "effect" * * // Create a native span directly * const span = new Tracer.NativeSpan( diff --git a/packages/effect/src/data/Tuple.ts b/packages/effect/src/Tuple.ts similarity index 93% rename from packages/effect/src/data/Tuple.ts rename to packages/effect/src/Tuple.ts index f9748873ee..91f488c053 100644 --- a/packages/effect/src/data/Tuple.ts +++ b/packages/effect/src/Tuple.ts @@ -3,12 +3,12 @@ * * @since 2.0.0 */ -import * as Equivalence from "../data/Equivalence.ts" -import * as order from "../data/Order.ts" -import type { Apply, Lambda } from "../data/Struct.ts" -import { dual } from "../Function.ts" import * as Combiner from "./Combiner.ts" +import * as Equivalence from "./Equivalence.ts" +import { dual } from "./Function.ts" +import * as order from "./Order.ts" import * as Reducer from "./Reducer.ts" +import type { Apply, Lambda } from "./Struct.ts" /** * Constructs a new tuple from the provided values. @@ -16,7 +16,7 @@ import * as Reducer from "./Reducer.ts" * @example * ```ts * import * as assert from "node:assert" - * import { make } from "effect/data/Tuple" + * import { make } from "effect/Tuple" * * assert.deepStrictEqual(make(1, 'hello', true), [1, 'hello', true]) * ``` @@ -33,7 +33,7 @@ type Indices> = Exclude["length"], T * * @example * ```ts - * import { Tuple } from "effect/data" + * import { Tuple } from "effect" * * console.log(Tuple.get([1, true, 'hello'], 2)) * // 'hello' @@ -68,7 +68,7 @@ type PickTuple, K> = _BuildTuple * * @example * ```ts - * import { Tuple } from "effect/data" + * import { Tuple } from "effect" * * const result = Tuple.pick(["a", "b", "c", "d"], [0, 2, 3]) * console.log(result) @@ -103,7 +103,7 @@ type OmitTuple, K> = _BuildTuple = { [I in keyof T]: I extends keyof E ? (E[I] extends (...a: * * @example * ```ts - * import { Tuple } from "effect/data" + * import { Tuple } from "effect" * * // Transform specific elements by index * const original = ["hello", 42, true] @@ -219,7 +219,7 @@ export const evolve: { * * @example * ```ts - * import { Tuple } from "effect/data" + * import { Tuple } from "effect" * * // Example demonstrates index remapping concept * const original = ["a", "b", "c"] @@ -253,7 +253,7 @@ export const renameIndices: { * * @example * ```ts - * import { Tuple } from "effect/data" + * import { Tuple } from "effect" * * // Used with lambda functions for transforming all elements * const tuple = [1, 2, 3] as const @@ -285,7 +285,7 @@ export const map: { * * @example * ```ts - * import { Tuple } from "effect/data" + * import { Tuple } from "effect" * * // Transform only elements at specified indices * const tuple = [1, 2, 3] as const @@ -325,7 +325,7 @@ export const mapPick: { * * @example * ```ts - * import { Tuple } from "effect/data" + * import { Tuple } from "effect" * * // Transform all elements except those at specified indices * const tuple = [1, 2, 3] as const @@ -365,7 +365,7 @@ export const mapOmit: { * * @example * ```ts - * import { Tuple, Equivalence } from "effect/data" + * import { Tuple, Equivalence } from "effect" * * // Creates an equivalence for tuples with string and number elements * const equivalence = Tuple.getEquivalence([Equivalence.strict(), Equivalence.strict()]) @@ -381,7 +381,7 @@ export const getEquivalence = Equivalence.tuple * * @example * ```ts - * import { Tuple } from "effect/data" + * import { Tuple } from "effect" * import * as S from "effect/String" * import * as N from "effect/Number" * @@ -403,7 +403,7 @@ export { * @example * ```ts * import * as assert from "node:assert" - * import { isTupleOf } from "effect/data/Tuple" + * import { isTupleOf } from "effect/Tuple" * * assert.deepStrictEqual(isTupleOf([1, 2, 3], 3), true); * assert.deepStrictEqual(isTupleOf([1, 2, 3], 2), false); @@ -428,7 +428,7 @@ export { * @example * ```ts * import * as assert from "node:assert" - * import { isTupleOfAtLeast } from "effect/data/Tuple" + * import { isTupleOfAtLeast } from "effect/Tuple" * * assert.deepStrictEqual(isTupleOfAtLeast([1, 2, 3], 3), true); * assert.deepStrictEqual(isTupleOfAtLeast([1, 2, 3], 2), true); @@ -460,7 +460,7 @@ export { * **Example** * * ```ts - * import { Tuple } from "effect/data" + * import { Tuple } from "effect" * import { Number, String } from "effect" * * const C = Tuple.getCombiner([Number.ReducerSum, String.ReducerConcat]) @@ -496,7 +496,7 @@ export function getCombiner>( * **Example** * * ```ts - * import { Tuple } from "effect/data" + * import { Tuple } from "effect" * import { Number, String } from "effect" * * const R = Tuple.getReducer([Number.ReducerSum, String.ReducerConcat]) diff --git a/packages/effect/src/data/UndefinedOr.ts b/packages/effect/src/UndefinedOr.ts similarity index 98% rename from packages/effect/src/data/UndefinedOr.ts rename to packages/effect/src/UndefinedOr.ts index 569e021814..4f97d4dc62 100644 --- a/packages/effect/src/data/UndefinedOr.ts +++ b/packages/effect/src/UndefinedOr.ts @@ -27,9 +27,9 @@ * * @since 4.0.0 */ -import type { LazyArg } from "../Function.ts" -import { dual } from "../Function.ts" import * as Combiner from "./Combiner.ts" +import type { LazyArg } from "./Function.ts" +import { dual } from "./Function.ts" import * as Reducer from "./Reducer.ts" /** diff --git a/packages/effect/src/Utils.ts b/packages/effect/src/Utils.ts index 6cddddff1b..dfdfe70109 100644 --- a/packages/effect/src/Utils.ts +++ b/packages/effect/src/Utils.ts @@ -1,8 +1,8 @@ /** * @since 2.0.0 */ -import { isObject } from "./data/Predicate.ts" import { identity } from "./Function.ts" +import { isObject } from "./Predicate.ts" import type { Kind, TypeLambda } from "./types/HKT.ts" import type * as Types from "./types/Types.ts" @@ -107,7 +107,7 @@ export const makeGenKind = ( * @example * ```ts * import { Utils } from "effect" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * // Variance defines the type parameter relationships * declare const variance: Utils.Variance @@ -128,7 +128,7 @@ export interface Variance { * @example * ```ts * import { Utils } from "effect" - * import { Option } from "effect/data" + * import { Option } from "effect" * * // Gen enables generator-based syntax for any TypeLambda * declare const gen: Utils.Gen diff --git a/packages/effect/src/collections/Array.ts b/packages/effect/src/collections/Array.ts index bff0524a48..d220255bb2 100644 --- a/packages/effect/src/collections/Array.ts +++ b/packages/effect/src/collections/Array.ts @@ -4,20 +4,20 @@ * @since 2.0.0 */ import * as moduleIterable from "../collections/Iterable.ts" -import * as Equivalence from "../data/Equivalence.ts" -import * as Filter from "../data/Filter.ts" -import * as Option from "../data/Option.ts" -import * as Order from "../data/Order.ts" -import type * as Predicate from "../data/Predicate.ts" -import * as Record from "../data/Record.ts" -import * as Reducer from "../data/Reducer.ts" -import * as Result from "../data/Result.ts" -import * as Tuple from "../data/Tuple.ts" +import * as Equivalence from "../Equivalence.ts" +import * as Filter from "../Filter.ts" import type { LazyArg } from "../Function.ts" import { dual, identity } from "../Function.ts" import * as Equal from "../interfaces/Equal.ts" import * as internalArray from "../internal/array.ts" import * as internalDoNotation from "../internal/doNotation.ts" +import * as Option from "../Option.ts" +import * as Order from "../Order.ts" +import type * as Predicate from "../Predicate.ts" +import * as Record from "../Record.ts" +import * as Reducer from "../Reducer.ts" +import * as Result from "../Result.ts" +import * as Tuple from "../Tuple.ts" import type { TypeLambda } from "../types/HKT.ts" import type { NoInfer, TupleOf } from "../types/Types.ts" @@ -247,7 +247,7 @@ export const fromRecord: (self: Readonly>) => * @example * ```ts * import { Array } from "effect/collections" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * console.log(Array.fromOption(Option.some(1))) // [1] * console.log(Array.fromOption(Option.none())) // [] @@ -1433,7 +1433,7 @@ export const reverse = >( * @example * ```ts * import { Array } from "effect/collections" - * import { Order } from "effect/data" + * import { Order } from "effect" * * const result = Array.sort([3, 1, 4, 1, 5], Order.number) * console.log(result) // [1, 1, 3, 4, 5] @@ -1463,7 +1463,7 @@ export const sort: { * * ```ts * import { Array } from "effect/collections" - * import { Order } from "effect/data" + * import { Order } from "effect" * * const result = Array.sortWith(["aaa", "b", "cc"], (s) => s.length, Order.number) * console.log(result) // ["b", "cc", "aaa"] @@ -1500,7 +1500,7 @@ export const sortWith: { * ```ts * import { pipe } from "effect" * import { Array } from "effect/collections" - * import { Order } from "effect/data" + * import { Order } from "effect" * * const users = [ * { name: "Alice", age: 30 }, @@ -2686,7 +2686,7 @@ export const flatten: >>(self: S) => * * ```ts * import { Array } from "effect/collections" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * const evenSquares = (x: number) => x % 2 === 0 ? Option.some(x * x) : Option.none() * @@ -2724,7 +2724,7 @@ export const filterMap: { * * ```ts * import { Array } from "effect/collections" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * const toSquareTillOdd = (x: number) => x % 2 === 0 ? Option.some(x * x) : Option.none() * @@ -2763,7 +2763,7 @@ export const filterMapWhile: { * * ```ts * import { Array } from "effect/collections" - * import { Result } from "effect/data"; + * import { Result } from "effect"; * * const isEven = (x: number) => x % 2 === 0 * @@ -2831,7 +2831,7 @@ export const partitionFilter: { * * ```ts * import { Array } from "effect/collections" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * const result = Array.getSomes([Option.some(1), Option.none(), Option.some(2)]) * console.log(result) // [1, 2] @@ -2852,7 +2852,7 @@ export const getSomes: >, X = any>( * * ```ts * import { Array } from "effect/collections" - * import { Result } from "effect/data" + * import { Result } from "effect" * * const result = Array.getFailures([Result.succeed(1), Result.fail("err"), Result.succeed(2)]) * console.log(result) // ["err"] @@ -2881,7 +2881,7 @@ export const getFailures = >>( * * ```ts * import { Array } from "effect/collections" - * import { Result } from "effect/data" + * import { Result } from "effect" * * const result = Array.getSuccesses([Result.succeed(1), Result.fail("err"), Result.succeed(2)]) * console.log(result) // [1, 2] @@ -2986,7 +2986,7 @@ export const partition: { * @example * ```ts * import { Array } from "effect/collections" - * import { Result } from "effect/data" + * import { Result } from "effect" * * const results = [Result.succeed(1), Result.fail("error"), Result.succeed(2)] * const [failures, successes] = Array.separate(results) @@ -3080,7 +3080,7 @@ export const liftPredicate: { // Note: I intentionally avoid using the NoInfer p * @example * ```ts * import { Array } from "effect/collections" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * const parseNumber = Array.liftOption((s: string) => { * const n = Number(s) @@ -3177,7 +3177,7 @@ export const flatMapNullishOr: { * * ```ts * import { Array } from "effect/collections" - * import { Result } from "effect/data" + * import { Result } from "effect" * * const parseNumber = (s: string): Result.Result => * isNaN(Number(s)) ? Result.fail(new Error("Not a number")) : Result.succeed(Number(s)) @@ -3301,7 +3301,7 @@ export const extend: { * * ```ts * import { Array } from "effect/collections" - * import { Order } from "effect/data" + * import { Order } from "effect" * * const result = Array.min([3, 1, 2], Order.number) * console.log(result) // 1 @@ -3322,7 +3322,7 @@ export const min: { * * ```ts * import { Array } from "effect/collections" - * import { Order } from "effect/data" + * import { Order } from "effect" * * const result = Array.max([3, 1, 2], Order.number) * console.log(result) // 3 @@ -3371,7 +3371,7 @@ export const unfold = (b: B, f: (b: B) => readonly [A, B] | undefined): Ar * @example * ```ts * import { Array } from "effect/collections" - * import { Order } from "effect/data" + * import { Order } from "effect" * * const arrayOrder = Array.getOrder(Order.number) * console.log(arrayOrder([1, 2], [1, 3])) // -1 (first is less than second) diff --git a/packages/effect/src/collections/Chunk.ts b/packages/effect/src/collections/Chunk.ts index 96e5c5b5b2..28fbe4746a 100644 --- a/packages/effect/src/collections/Chunk.ts +++ b/packages/effect/src/collections/Chunk.ts @@ -72,22 +72,22 @@ import { Effect } from "effect" import * as RA from "../collections/Array.ts" import type { NonEmptyReadonlyArray } from "../collections/Array.ts" import type { NonEmptyIterable } from "../collections/NonEmptyIterable.ts" -import * as Equivalence from "../data/Equivalence.ts" -import { format } from "../data/Formatter.ts" -import type { Option } from "../data/Option.ts" -import * as O from "../data/Option.ts" -import * as Order from "../data/Order.ts" -import { hasProperty, type Predicate, type Refinement } from "../data/Predicate.ts" -import type { Result } from "../data/Result.ts" -import * as UndefinedOr from "../data/UndefinedOr.ts" +import * as Equivalence from "../Equivalence.ts" +import { format } from "../Formatter.ts" import { dual, identity, pipe } from "../Function.ts" import * as Equal from "../interfaces/Equal.ts" import * as Hash from "../interfaces/Hash.ts" import { type Inspectable, NodeInspectSymbol, toJson } from "../interfaces/Inspectable.ts" import type { Pipeable } from "../interfaces/Pipeable.ts" import { pipeArguments } from "../interfaces/Pipeable.ts" +import type { Option } from "../Option.ts" +import * as O from "../Option.ts" +import * as Order from "../Order.ts" +import { hasProperty, type Predicate, type Refinement } from "../Predicate.ts" +import type { Result } from "../Result.ts" import type { TypeLambda } from "../types/HKT.ts" import type { Covariant, NoInfer } from "../types/Types.ts" +import * as UndefinedOr from "../UndefinedOr.ts" const TypeId = "~effect/collections/Chunk" @@ -209,7 +209,7 @@ const emptyArray: ReadonlyArray = [] * @example * ```ts * import { Chunk } from "effect/collections" -import * as Equivalence from "effect/data/Equivalence" +import * as Equivalence from "effect/Equivalence" * * const chunk1 = Chunk.make(1, 2, 3) * const chunk2 = Chunk.make(1, 2, 3) @@ -558,7 +558,7 @@ export const reverse: >(self: S) => Chunk.With { @@ -1058,7 +1058,7 @@ export const filter: { * @example * ```ts * import { Chunk } from "effect/collections" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * const chunk = Chunk.make("1", "2", "hello", "3", "4") * const result = Chunk.filterMapWhile(chunk, (s) => { @@ -1090,7 +1090,7 @@ export const filterMapWhile: { * @example * ```ts * import { Chunk } from "effect/collections" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * const chunk = Chunk.make(Option.some(1), Option.none(), Option.some(3)) * const result = Chunk.compact(chunk) @@ -1332,7 +1332,7 @@ export const isNonEmpty = (self: Chunk): self is NonEmptyChunk => self. * @example * ```ts * import { Chunk } from "effect/collections" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * console.log(Chunk.head(Chunk.empty())) // { _tag: "None" } * console.log(Chunk.head(Chunk.make(1, 2, 3))) // { _tag: "Some", value: 1 } @@ -1399,7 +1399,7 @@ export const headNonEmpty: (self: NonEmptyChunk) => A = headUnsafe * @example * ```ts * import { Chunk } from "effect/collections" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * console.log(Chunk.last(Chunk.empty())) // { _tag: "None" } * console.log(Chunk.last(Chunk.make(1, 2, 3))) // { _tag: "Some", value: 3 } @@ -1705,7 +1705,7 @@ export const partition: { * @example * ```ts * import { Chunk } from "effect/collections" - * import * as Result from "effect/data/Result" + * import * as Result from "effect/Result" * * const chunk = Chunk.make("1", "hello", "2", "world", "3") * const [errors, numbers] = Chunk.partitionMap(chunk, (str) => { @@ -1745,7 +1745,7 @@ export const partitionMap: { * @example * ```ts * import { Chunk } from "effect/collections" - * import * as Result from "effect/data/Result" + * import * as Result from "effect/Result" * * const chunk = Chunk.make( * Result.succeed(1), @@ -1797,7 +1797,7 @@ export const size = (self: Chunk): number => self.length * @example * ```ts * import { Chunk } from "effect/collections" -import * as Order from "effect/data/Order" +import * as Order from "effect/Order" * * const numbers = Chunk.make(3, 1, 4, 1, 5, 9, 2, 6) * const sorted = Chunk.sort(numbers, Order.number) @@ -1830,7 +1830,7 @@ export const sort: { * @example * ```ts * import { Chunk } from "effect/collections" -import * as Order from "effect/data/Order" +import * as Order from "effect/Order" * * const people = Chunk.make( * { name: "Alice", age: 30 }, @@ -2011,7 +2011,7 @@ export const splitWhere: { * @example * ```ts * import { Chunk } from "effect/collections" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * const chunk = Chunk.make(1, 2, 3, 4) * console.log(Chunk.tail(chunk)) // Option.some(Chunk.make(2, 3, 4)) @@ -2494,7 +2494,7 @@ export const containsWith: ( * @example * ```ts * import { Chunk } from "effect/collections" - * import { Option } from "effect/data" + * import { Option } from "effect" * * const chunk = Chunk.make(1, 2, 3, 4, 5) * const result = Chunk.findFirst(chunk, (n) => n > 3) @@ -2555,7 +2555,7 @@ export const findFirstIndex: { * @example * ```ts * import { Chunk } from "effect/collections" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * const chunk = Chunk.make(1, 2, 3, 4, 5) * const result = Chunk.findLast(chunk, (n) => n < 4) diff --git a/packages/effect/src/collections/Graph.ts b/packages/effect/src/collections/Graph.ts index 6625b9891a..f6cb44f838 100644 --- a/packages/effect/src/collections/Graph.ts +++ b/packages/effect/src/collections/Graph.ts @@ -2,8 +2,7 @@ * @since 4.0.0 */ -import * as Data from "../data/Data.ts" -import * as Option from "../data/Option.ts" +import * as Data from "../Data.ts" import { dual } from "../Function.ts" import * as Equal from "../interfaces/Equal.ts" import * as Hash from "../interfaces/Hash.ts" @@ -11,6 +10,7 @@ import type { Inspectable } from "../interfaces/Inspectable.ts" import { NodeInspectSymbol } from "../interfaces/Inspectable.ts" import type { Pipeable } from "../interfaces/Pipeable.ts" import { pipeArguments } from "../interfaces/Pipeable.ts" +import * as Option from "../Option.ts" import type { Mutable } from "../types/Types.ts" const TypeId = "~effect/collections/Graph" @@ -468,7 +468,7 @@ export const addNode = ( * @example * ```ts * import { Graph } from "effect/collections" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * const graph = Graph.mutate(Graph.directed(), (mutable) => { * Graph.addNode(mutable, "Node A") @@ -933,7 +933,7 @@ export const reverse = ( * @example * ```ts * import { Graph } from "effect/collections" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * const graph = Graph.directed((mutable) => { * const a = Graph.addNode(mutable, "active") @@ -985,7 +985,7 @@ export const filterMapNodes = ( * @example * ```ts * import { Graph } from "effect/collections" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * const graph = Graph.directed((mutable) => { * const a = Graph.addNode(mutable, "A") @@ -2656,7 +2656,7 @@ export interface DijkstraConfig { * @example * ```ts * import { Graph } from "effect/collections" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * const graph = Graph.directed((mutable) => { * const a = Graph.addNode(mutable, "A") diff --git a/packages/effect/src/collections/HashMap.ts b/packages/effect/src/collections/HashMap.ts index 0d007d56f9..ec5ce92c1b 100644 --- a/packages/effect/src/collections/HashMap.ts +++ b/packages/effect/src/collections/HashMap.ts @@ -2,11 +2,11 @@ * @since 2.0.0 */ -import type { Option } from "../data/Option.ts" import type { Equal } from "../interfaces/Equal.ts" import type { Inspectable } from "../interfaces/Inspectable.ts" import type { Pipeable } from "../interfaces/Pipeable.ts" import * as internal from "../internal/hashMap.ts" +import type { Option } from "../Option.ts" import type { NoInfer } from "../types/Types.ts" const TypeId = internal.HashMapTypeId @@ -19,7 +19,7 @@ const TypeId = internal.HashMapTypeId * @example * ```ts * import * as HashMap from "effect/collections/HashMap" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * // Create a HashMap * const map = HashMap.make(["a", 1], ["b", 2], ["c", 3]) @@ -50,7 +50,7 @@ export interface HashMap extends Iterable<[Key, Value]>, Equ * @example * ```ts * import * as HashMap from "effect/collections/HashMap" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * // Create a concrete HashMap for type extraction * const inventory = HashMap.make( @@ -87,7 +87,7 @@ export declare namespace HashMap { * @example * ```ts * import * as HashMap from "effect/collections/HashMap" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * const map = HashMap.make(["a", 1], ["b", 2]) * @@ -295,7 +295,7 @@ export const isEmpty: (self: HashMap) => boolean = internal.isEmpty * @example * ```ts * import * as HashMap from "effect/collections/HashMap" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * const map = HashMap.make(["a", 1], ["b", 2]) * @@ -322,7 +322,7 @@ export const get: { * ```ts * import * as HashMap from "effect/collections/HashMap" import { Hash } from "effect/interfaces" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * // Useful when implementing custom equality for complex keys * const userMap = HashMap.make( @@ -361,7 +361,7 @@ export const getHash: { * @example * ```ts * import * as HashMap from "effect/collections/HashMap" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * const config = HashMap.make( * ["api_url", "https://api.example.com"], @@ -738,7 +738,7 @@ export const mutate: { * @example * ```ts * import * as HashMap from "effect/collections/HashMap" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * const map = HashMap.make(["a", 1], ["b", 2]) * @@ -772,7 +772,7 @@ export const modifyAt: { * ```ts * import * as HashMap from "effect/collections/HashMap" import { Hash } from "effect/interfaces" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * // Useful when working with precomputed hashes for performance * const counters = HashMap.make(["downloads", 100], ["views", 250]) @@ -1045,7 +1045,7 @@ export const filter: { * @example * ```ts * import * as HashMap from "effect/collections/HashMap" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * const map1 = HashMap.make( * ["a", Option.some(1)], @@ -1071,7 +1071,7 @@ export const compact: (self: HashMap>) => HashMap = int * @example * ```ts * import * as HashMap from "effect/collections/HashMap" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * const map1 = HashMap.make(["a", 1], ["b", 2], ["c", 3], ["d", 4]) * const map2 = HashMap.filterMap(map1, (value) => diff --git a/packages/effect/src/collections/HashRing.ts b/packages/effect/src/collections/HashRing.ts index 165219ae8c..bcd77a9857 100644 --- a/packages/effect/src/collections/HashRing.ts +++ b/packages/effect/src/collections/HashRing.ts @@ -1,12 +1,12 @@ /** * @since 4.0.0 */ -import { hasProperty } from "../data/Predicate.ts" import { dual } from "../Function.ts" import * as Hash from "../interfaces/Hash.ts" import { type Pipeable } from "../interfaces/Pipeable.ts" import * as PrimaryKey from "../interfaces/PrimaryKey.ts" import { PipeInspectableProto } from "../internal/core.ts" +import { hasProperty } from "../Predicate.ts" import * as Iterable from "./Iterable.ts" const TypeId = "~effect/cluster/HashRing" as const diff --git a/packages/effect/src/collections/HashSet.ts b/packages/effect/src/collections/HashSet.ts index 4dd812ce97..b694e6a8d4 100644 --- a/packages/effect/src/collections/HashSet.ts +++ b/packages/effect/src/collections/HashSet.ts @@ -2,12 +2,12 @@ * @since 2.0.0 */ -import type { Predicate, Refinement } from "../data/Predicate.ts" import * as Dual from "../Function.ts" import type { Equal } from "../interfaces/Equal.ts" import type { Inspectable } from "../interfaces/Inspectable.ts" import type { Pipeable } from "../interfaces/Pipeable.ts" import * as internal from "../internal/hashSet.ts" +import type { Predicate, Refinement } from "../Predicate.ts" import type { NoInfer } from "../types/Types.ts" const TypeId = internal.HashSetTypeId diff --git a/packages/effect/src/collections/Iterable.ts b/packages/effect/src/collections/Iterable.ts index 614e295a6e..3cd13c5de4 100644 --- a/packages/effect/src/collections/Iterable.ts +++ b/packages/effect/src/collections/Iterable.ts @@ -31,15 +31,15 @@ */ import type { NonEmptyArray } from "../collections/Array.ts" -import type { Option } from "../data/Option.ts" -import * as O from "../data/Option.ts" -import { isBoolean } from "../data/Predicate.ts" -import type * as Record from "../data/Record.ts" -import type { Result } from "../data/Result.ts" -import * as R from "../data/Result.ts" -import * as Tuple from "../data/Tuple.ts" import { dual, identity } from "../Function.ts" import * as Equal from "../interfaces/Equal.ts" +import type { Option } from "../Option.ts" +import * as O from "../Option.ts" +import { isBoolean } from "../Predicate.ts" +import type * as Record from "../Record.ts" +import type { Result } from "../Result.ts" +import * as R from "../Result.ts" +import * as Tuple from "../Tuple.ts" import type { NoInfer } from "../types/Types.ts" /** @@ -420,7 +420,7 @@ export const size = (self: Iterable): number => { * @example * ```ts * import { Iterable } from "effect/collections" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * const numbers = [1, 2, 3] * console.log(Iterable.head(numbers)) // Option.some(1) @@ -640,7 +640,7 @@ export const drop: { * @example * ```ts * import { Iterable } from "effect/collections" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * const numbers = [1, 3, 4, 6, 8] * const firstEven = Iterable.findFirst(numbers, x => x % 2 === 0) @@ -704,7 +704,7 @@ export const findFirst: { * @example * ```ts * import { Iterable } from "effect/collections" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * const numbers = [1, 3, 4, 6, 8, 2] * const lastEven = Iterable.findLast(numbers, x => x % 2 === 0) @@ -1488,7 +1488,7 @@ export const flatten = (self: Iterable>): Iterable => ({ * @example * ```ts * import { Iterable } from "effect/collections" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * // Parse strings to numbers, keeping only valid ones * const strings = ["1", "2", "invalid", "4", "not-a-number"] @@ -1553,7 +1553,7 @@ export const filterMap: { * @example * ```ts * import { Iterable } from "effect/collections" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * // Parse numbers until we hit an invalid one * const strings = ["1", "2", "3", "invalid", "4", "5"] @@ -1611,7 +1611,7 @@ export const filterMapWhile: { * ```ts * import * as assert from "node:assert" * import { Iterable } from "effect/collections" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * assert.deepStrictEqual( * Array.from(Iterable.getSomes([Option.some(1), Option.none(), Option.some(2)])), @@ -1631,7 +1631,7 @@ export const getSomes: (self: Iterable>) => Iterable = filterMap * ```ts * import * as assert from "node:assert" * import { Iterable } from "effect/collections" - * import * as Result from "effect/data/Result" + * import * as Result from "effect/Result" * * assert.deepStrictEqual( * Array.from(Iterable.getFailures([Result.succeed(1), Result.fail("err"), Result.succeed(2)])), @@ -1651,7 +1651,7 @@ export const getFailures = (self: Iterable>): Iterable => * ```ts * import * as assert from "node:assert" * import { Iterable } from "effect/collections" - * import * as Result from "effect/data/Result" + * import * as Result from "effect/Result" * * assert.deepStrictEqual( * Array.from(Iterable.getSuccesses([Result.succeed(1), Result.fail("err"), Result.succeed(2)])), diff --git a/packages/effect/src/collections/MutableHashMap.ts b/packages/effect/src/collections/MutableHashMap.ts index 7fbca6b64d..2e3ac3148f 100644 --- a/packages/effect/src/collections/MutableHashMap.ts +++ b/packages/effect/src/collections/MutableHashMap.ts @@ -25,14 +25,14 @@ * @category data-structures */ import type { NonEmptyArray } from "../collections/Array.ts" -import { format } from "../data/Formatter.ts" -import * as Option from "../data/Option.ts" +import { format } from "../Formatter.ts" import { dual } from "../Function.ts" import * as Equal from "../interfaces/Equal.ts" import * as Hash from "../interfaces/Hash.ts" import { type Inspectable, NodeInspectSymbol, toJson } from "../interfaces/Inspectable.ts" import type { Pipeable } from "../interfaces/Pipeable.ts" import { pipeArguments } from "../interfaces/Pipeable.ts" +import * as Option from "../Option.ts" const TypeId = "~effect/collections/MutableHashMap" @@ -185,7 +185,7 @@ export const fromIterable = (entries: Iterable): MutableH * @example * ```ts * import * as MutableHashMap from "effect/collections/MutableHashMap" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * const map = MutableHashMap.make(["key1", 42], ["key2", 100]) * @@ -474,7 +474,7 @@ export const modify: { * @example * ```ts * import * as MutableHashMap from "effect/collections/MutableHashMap" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * const map = MutableHashMap.make(["count", 5]) * diff --git a/packages/effect/src/collections/MutableHashSet.ts b/packages/effect/src/collections/MutableHashSet.ts index 6f02ba11ca..118baee387 100644 --- a/packages/effect/src/collections/MutableHashSet.ts +++ b/packages/effect/src/collections/MutableHashSet.ts @@ -25,7 +25,7 @@ * @category data-structures */ import * as MutableHashMap from "../collections/MutableHashMap.ts" -import { format } from "../data/Formatter.ts" +import { format } from "../Formatter.ts" import * as Dual from "../Function.ts" import { type Inspectable, NodeInspectSymbol, toJson } from "../interfaces/Inspectable.ts" import type { Pipeable } from "../interfaces/Pipeable.ts" diff --git a/packages/effect/src/collections/Trie.ts b/packages/effect/src/collections/Trie.ts index 3ab3c421f5..cd8fde7a65 100644 --- a/packages/effect/src/collections/Trie.ts +++ b/packages/effect/src/collections/Trie.ts @@ -15,11 +15,11 @@ * * @since 2.0.0 */ -import type { Option } from "../data/Option.ts" import type { Equal } from "../interfaces/Equal.ts" import type { Inspectable } from "../interfaces/Inspectable.ts" import type { Pipeable } from "../interfaces/Pipeable.ts" import * as TR from "../internal/trie.ts" +import type { Option } from "../Option.ts" import type { Covariant, NoInfer } from "../types/Types.ts" const TypeId = TR.TrieTypeId @@ -27,7 +27,7 @@ const TypeId = TR.TrieTypeId /** * @example * ```ts - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * import * as Trie from "effect/collections/Trie" * * // Create a trie with string-to-number mappings @@ -429,7 +429,7 @@ export const size: (self: Trie) => number = TR.size * @example * ```ts * import * as assert from "node:assert" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * import * as Trie from "effect/collections/Trie" * * const trie = Trie.empty().pipe( @@ -543,7 +543,7 @@ export const getUnsafe: { * @example * ```ts * import * as assert from "node:assert" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * import * as Trie from "effect/collections/Trie" * * const trie = Trie.empty().pipe( @@ -697,7 +697,7 @@ export const filter: { * import * as assert from "node:assert" * import * as Trie from "effect/collections/Trie" * import * as Equal from "effect/interfaces/Equal" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * const trie = Trie.empty().pipe( * Trie.insert("shells", 0), @@ -737,7 +737,7 @@ export const filterMap: { * import * as assert from "node:assert" * import * as Trie from "effect/collections/Trie" * import * as Equal from "effect/interfaces/Equal" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * const trie = Trie.empty>().pipe( * Trie.insert("shells", Option.some(0)), @@ -796,7 +796,7 @@ export const forEach: { * import * as assert from "node:assert" * import * as Trie from "effect/collections/Trie" * import * as Equal from "effect/interfaces/Equal" - * import * as Option from "effect/data/Option" + * import * as Option from "effect/Option" * * const trie = Trie.empty().pipe( * Trie.insert("shells", 0), diff --git a/packages/effect/src/data/index.ts b/packages/effect/src/data/index.ts deleted file mode 100644 index ffc9a01fe4..0000000000 --- a/packages/effect/src/data/index.ts +++ /dev/null @@ -1,245 +0,0 @@ -/** - * @since 4.0.0 - */ - -/** - * This module provides types and utility functions to create and work with - * branded types, which are TypeScript types with an added type tag to prevent - * accidental usage of a value in the wrong context. - * - * @since 2.0.0 - */ -export * as Brand from "./Brand.ts" - -/** - * @since 4.0.0 - */ -export * as Combiner from "./Combiner.ts" - -/** - * This module provides utilities for creating data types with structural equality - * semantics. Unlike regular JavaScript objects, `Data` types support value-based - * equality comparison using the `Equal` module. - * - * The main benefits of using `Data` types are: - * - **Structural equality**: Two `Data` objects are equal if their contents are equal - * - **Immutability**: `Data` types are designed to be immutable - * - **Type safety**: Constructors ensure type safety and consistency - * - **Effect integration**: Error types work seamlessly with Effect's error handling - * - * @since 2.0.0 - */ -export * as Data from "./Data.ts" - -/** - * This module provides utilities for working with equivalence relations - binary relations that are - * reflexive, symmetric, and transitive. Equivalence relations define when two values of the same type - * should be considered equivalent, which is fundamental for comparing, deduplicating, and organizing data. - * - * An equivalence relation must satisfy three properties: - * - **Reflexive**: Every value is equivalent to itself - * - **Symmetric**: If `a` is equivalent to `b`, then `b` is equivalent to `a` - * - **Transitive**: If `a` is equivalent to `b` and `b` is equivalent to `c`, then `a` is equivalent to `c` - * - * @example - * ```ts - * import { Equivalence } from "effect/data" - * import { Array } from "effect/collections" - * - * // Case-insensitive string equivalence - * const caseInsensitive = Equivalence.make((a, b) => - * a.toLowerCase() === b.toLowerCase() - * ) - * - * // Use with array deduplication - * const strings = ["Hello", "world", "HELLO", "World"] - * const deduplicated = Array.dedupeWith(strings, caseInsensitive) - * console.log(deduplicated) // ["Hello", "world"] - * - * // Product type equivalence - * interface Person { - * name: string - * age: number - * } - * - * const personEquivalence = Equivalence.struct({ - * name: caseInsensitive, - * age: Equivalence.strict() - * }) - * ``` - * - * @since 2.0.0 - */ -export * as Equivalence from "./Equivalence.ts" - -/** - * @since 4.0.0 - */ -export * as Filter from "./Filter.ts" - -/** - * @since 4.0.0 - */ -export * as Formatter from "./Formatter.ts" - -/** - * This module provides small, allocation-free utilities for working with values of type - * `A | null`, where `null` means "no value". - * - * Why not `Option`? - * In TypeScript, `Option` is often unnecessary. If `null` already models absence - * in your domain, using `A | null` keeps types simple, avoids extra wrappers, and - * reduces overhead. The key is that `A` itself must not include `null`; in this - * module `null` is reserved to mean "no value". - * - * When to use `A | null`: - * - Absence can be represented by `null` in your domain model. - * - You do not need to distinguish between "no value" and "value is null". - * - You want straightforward ergonomics and zero extra allocations. - * - * When to prefer `Option`: - * - You must distinguish `None` from `Some(null)` (that is, `null` is a valid - * payload and carries meaning on its own). - * - You need a tagged representation for serialization or pattern matching across - * boundaries where `null` would be ambiguous. - * - You want the richer `Option` API and are comfortable with the extra wrapper. - * - * Lawfulness note: - * All helpers treat `null` as absence. Do not use these utilities with payloads - * where `A` can itself be `null`, or you will lose information. If you need to - * carry `null` as a valid payload, use `Option` instead. - * - * @since 4.0.0 - */ -export * as NullOr from "./NullOr.ts" - -/** - * @since 2.0.0 - */ -export * as Option from "./Option.ts" - -/** - * This module provides an implementation of the `Order` type class which is used to define a total ordering on some type `A`. - * An order is defined by a relation `<=`, which obeys the following laws: - * - * - either `x <= y` or `y <= x` (totality) - * - if `x <= y` and `y <= x`, then `x == y` (antisymmetry) - * - if `x <= y` and `y <= z`, then `x <= z` (transitivity) - * - * The truth table for compare is defined as follows: - * - * | `x <= y` | `x >= y` | Ordering | | - * | -------- | -------- | -------- | --------------------- | - * | `true` | `true` | `0` | corresponds to x == y | - * | `true` | `false` | `< 0` | corresponds to x < y | - * | `false` | `true` | `> 0` | corresponds to x > y | - * - * @since 2.0.0 - */ -export * as Order from "./Order.ts" - -/** - * @fileoverview - * The Ordering module provides utilities for working with comparison results and ordering operations. - * An Ordering represents the result of comparing two values, expressing whether the first value is - * less than (-1), equal to (0), or greater than (1) the second value. - * - * This module is fundamental for building comparison functions, sorting algorithms, and implementing - * ordered data structures. It provides composable operations for combining multiple comparison results - * and pattern matching on ordering outcomes. - * - * Key Features: - * - Type-safe representation of comparison results (-1, 0, 1) - * - Composable operations for combining multiple orderings - * - Pattern matching utilities for handling different ordering cases - * - Ordering reversal and combination functions - * - Integration with Effect's functional programming patterns - * - * Common Use Cases: - * - Implementing custom comparison functions - * - Building complex sorting criteria - * - Combining multiple comparison results - * - Creating ordered data structures - * - Pattern matching on comparison outcomes - * - * @since 2.0.0 - * @category utilities - */ -export * as Ordering from "./Ordering.ts" - -/** - * @since 2.0.0 - */ -export * as Predicate from "./Predicate.ts" - -/** - * This module provides utility functions for working with records in TypeScript. - * - * @since 2.0.0 - */ -export * as Record from "./Record.ts" - -/** - * The Redacted module provides functionality for handling sensitive information - * securely within your application. By using the `Redacted` data type, you can - * ensure that sensitive values are not accidentally exposed in logs or error - * messages. - * - * @since 3.3.0 - */ -export * as Redacted from "./Redacted.ts" - -/** - * @since 4.0.0 - */ -export * as Reducer from "./Reducer.ts" - -/** - * @since 4.0.0 - */ -export * as Result from "./Result.ts" - -/** - * This module provides utility functions for working with structs in TypeScript. - * - * @since 2.0.0 - */ -export * as Struct from "./Struct.ts" - -/** - * This module provides utility functions for working with tuples in TypeScript. - * - * @since 2.0.0 - */ -export * as Tuple from "./Tuple.ts" - -/** - * This module provides small, allocation-free utilities for working with values of type - * `A | undefined`, where `undefined` means "no value". - * - * Why not `Option`? - * In TypeScript, `Option` is often unnecessary. If `undefined` already models absence - * in your domain, using `A | undefined` keeps types simple, avoids extra wrappers, and - * reduces overhead. The key is that `A` itself must not include `undefined`; in this - * module `undefined` is reserved to mean "no value". - * - * When to use `A | undefined`: - * - Absence can be represented by `undefined` in your domain model. - * - You do not need to distinguish between "no value" and "value is undefined". - * - You want straightforward ergonomics and zero extra allocations. - * - * When to prefer `Option`: - * - You must distinguish `None` from `Some(undefined)` (that is, `undefined` is a valid - * payload and carries meaning on its own). - * - You need a tagged representation for serialization or pattern matching across - * boundaries where `undefined` would be ambiguous. - * - You want the richer `Option` API and are comfortable with the extra wrapper. - * - * Lawfulness note: - * All helpers treat `undefined` as absence. Do not use these utilities with payloads - * where `A` can itself be `undefined`, or you will lose information. If you need to - * carry `undefined` as a valid payload, use `Option` instead. - * - * @since 4.0.0 - */ -export * as UndefinedOr from "./UndefinedOr.ts" diff --git a/packages/effect/src/data/index.ts.tpl b/packages/effect/src/data/index.ts.tpl deleted file mode 100644 index c2aac82f76..0000000000 --- a/packages/effect/src/data/index.ts.tpl +++ /dev/null @@ -1,3 +0,0 @@ -/** - * @since 4.0.0 - */ diff --git a/packages/effect/src/encoding/Base64.ts b/packages/effect/src/encoding/Base64.ts index f384d9164c..151fe6b05f 100644 --- a/packages/effect/src/encoding/Base64.ts +++ b/packages/effect/src/encoding/Base64.ts @@ -7,7 +7,7 @@ * * @since 2.0.0 */ -import * as Result from "../data/Result.ts" +import * as Result from "../Result.ts" import { EncodingError } from "./EncodingError.ts" /** @@ -68,7 +68,7 @@ const encodeUint8Array = (bytes: Uint8Array) => { * @example * ```ts * import { Base64 } from "effect/encoding" - * import { Result } from "effect/data" + * import { Result } from "effect" * * const result = Base64.decode("SGVsbG8=") * if (Result.isSuccess(result)) { @@ -138,7 +138,7 @@ export const decode = (str: string): Result.Result => * @example * ```ts * import { Base64 } from "effect/encoding" - * import { Result } from "effect/data" + * import { Result } from "effect" * * const result = Base64.decodeString("aGVsbG8=") * if (Result.isSuccess(result)) { diff --git a/packages/effect/src/encoding/Base64Url.ts b/packages/effect/src/encoding/Base64Url.ts index b8ed75d4b6..d9edacd040 100644 --- a/packages/effect/src/encoding/Base64Url.ts +++ b/packages/effect/src/encoding/Base64Url.ts @@ -1,7 +1,7 @@ /** * @since 2.0.0 */ -import * as Result from "../data/Result.ts" +import * as Result from "../Result.ts" import * as Base64 from "./Base64.ts" import { EncodingError } from "./EncodingError.ts" @@ -34,7 +34,7 @@ const encodeUint8Array = (data: Uint8Array) => * @example * ```ts * import { Base64Url } from "effect/encoding" - * import { Result } from "effect/data" + * import { Result } from "effect" * * const result = Base64Url.decode("SGVsbG8_") * if (Result.isSuccess(result)) { @@ -83,7 +83,7 @@ export const decode = (str: string): Result.Result => * @example * ```ts * import { Base64Url } from "effect/encoding" - * import { Result } from "effect/data" + * import { Result } from "effect" * * const result = Base64Url.decodeString("aGVsbG8_") * if (Result.isSuccess(result)) { diff --git a/packages/effect/src/encoding/EncodingError.ts b/packages/effect/src/encoding/EncodingError.ts index 7c4f29968d..6c4d357df9 100644 --- a/packages/effect/src/encoding/EncodingError.ts +++ b/packages/effect/src/encoding/EncodingError.ts @@ -1,8 +1,8 @@ /** * @since 4.0.0 */ -import * as Data from "../data/Data.ts" -import { hasProperty } from "../data/Predicate.ts" +import * as Data from "../Data.ts" +import { hasProperty } from "../Predicate.ts" const EncodingErrorTypeId = "~effect/encoding/EncodingError" as const diff --git a/packages/effect/src/encoding/Hex.ts b/packages/effect/src/encoding/Hex.ts index 6339ac6410..592e18eab9 100644 --- a/packages/effect/src/encoding/Hex.ts +++ b/packages/effect/src/encoding/Hex.ts @@ -1,7 +1,7 @@ /** * @since 2.0.0 */ -import * as Result from "../data/Result.ts" +import * as Result from "../Result.ts" import { EncodingError } from "./EncodingError.ts" /** @@ -40,7 +40,7 @@ const encodeUint8Array = (bytes: Uint8Array) => { * @example * ```ts * import { Hex } from "effect/encoding" - * import { Result } from "effect/data" + * import { Result } from "effect" * * const result = Hex.decode("48656c6c6f") * if (Result.isSuccess(result)) { @@ -92,7 +92,7 @@ export const decode = (str: string): Result.Result => * @example * ```ts * import { Hex } from "effect/encoding" - * import { Result } from "effect/data" + * import { Result } from "effect" * * const result = Hex.decodeString("68656c6c6f") * if (Result.isSuccess(result)) { diff --git a/packages/effect/src/index.ts b/packages/effect/src/index.ts index 95216ac44d..f0980b48d3 100644 --- a/packages/effect/src/index.ts +++ b/packages/effect/src/index.ts @@ -64,6 +64,15 @@ export * as BigInt from "./BigInt.ts" */ export * as Boolean from "./Boolean.ts" +/** + * This module provides types and utility functions to create and work with + * branded types, which are TypeScript types with an added type tag to prevent + * accidental usage of a value in the wrong context. + * + * @since 2.0.0 + */ +export * as Brand from "./Brand.ts" + /** * @since 4.0.0 */ @@ -239,6 +248,11 @@ export * as ChannelSchema from "./ChannelSchema.ts" */ export * as Clock from "./Clock.ts" +/** + * @since 4.0.0 + */ +export * as Combiner from "./Combiner.ts" + /** * @since 4.0.0 */ @@ -328,6 +342,21 @@ export * as Console from "./Console.ts" */ export * as Cron from "./Cron.ts" +/** + * This module provides utilities for creating data types with structural equality + * semantics. Unlike regular JavaScript objects, `Data` types support value-based + * equality comparison using the `Equal` module. + * + * The main benefits of using `Data` types are: + * - **Structural equality**: Two `Data` objects are equal if their contents are equal + * - **Immutability**: `Data` types are designed to be immutable + * - **Type safety**: Constructors ensure type safety and consistency + * - **Effect integration**: Error types work seamlessly with Effect's error handling + * + * @since 2.0.0 + */ +export * as Data from "./Data.ts" + /** * @since 3.6.0 */ @@ -498,6 +527,47 @@ export * as Duration from "./Duration.ts" */ export * as Effect from "./Effect.ts" +/** + * This module provides utilities for working with equivalence relations - binary relations that are + * reflexive, symmetric, and transitive. Equivalence relations define when two values of the same type + * should be considered equivalent, which is fundamental for comparing, deduplicating, and organizing data. + * + * An equivalence relation must satisfy three properties: + * - **Reflexive**: Every value is equivalent to itself + * - **Symmetric**: If `a` is equivalent to `b`, then `b` is equivalent to `a` + * - **Transitive**: If `a` is equivalent to `b` and `b` is equivalent to `c`, then `a` is equivalent to `c` + * + * @example + * ```ts + * import { Equivalence } from "effect" + * import { Array } from "effect/collections" + * + * // Case-insensitive string equivalence + * const caseInsensitive = Equivalence.make((a, b) => + * a.toLowerCase() === b.toLowerCase() + * ) + * + * // Use with array deduplication + * const strings = ["Hello", "world", "HELLO", "World"] + * const deduplicated = Array.dedupeWith(strings, caseInsensitive) + * console.log(deduplicated) // ["Hello", "world"] + * + * // Product type equivalence + * interface Person { + * name: string + * age: number + * } + * + * const personEquivalence = Equivalence.struct({ + * name: caseInsensitive, + * age: Equivalence.strict() + * }) + * ``` + * + * @since 2.0.0 + */ +export * as Equivalence from "./Equivalence.ts" + /** * @since 3.16.0 */ @@ -609,6 +679,16 @@ export * as FiberMap from "./FiberMap.ts" */ export * as FiberSet from "./FiberSet.ts" +/** + * @since 4.0.0 + */ +export * as Filter from "./Filter.ts" + +/** + * @since 4.0.0 + */ +export * as Formatter from "./Formatter.ts" + /** * @since 2.0.0 */ @@ -1054,6 +1134,37 @@ export * as Metric from "./Metric.ts" */ export * as MutableRef from "./MutableRef.ts" +/** + * This module provides small, allocation-free utilities for working with values of type + * `A | null`, where `null` means "no value". + * + * Why not `Option`? + * In TypeScript, `Option` is often unnecessary. If `null` already models absence + * in your domain, using `A | null` keeps types simple, avoids extra wrappers, and + * reduces overhead. The key is that `A` itself must not include `null`; in this + * module `null` is reserved to mean "no value". + * + * When to use `A | null`: + * - Absence can be represented by `null` in your domain model. + * - You do not need to distinguish between "no value" and "value is null". + * - You want straightforward ergonomics and zero extra allocations. + * + * When to prefer `Option`: + * - You must distinguish `None` from `Some(null)` (that is, `null` is a valid + * payload and carries meaning on its own). + * - You need a tagged representation for serialization or pattern matching across + * boundaries where `null` would be ambiguous. + * - You want the richer `Option` API and are comfortable with the extra wrapper. + * + * Lawfulness note: + * All helpers treat `null` as absence. Do not use these utilities with payloads + * where `A` can itself be `null`, or you will lose information. If you need to + * carry `null` as a valid payload, use `Option` instead. + * + * @since 4.0.0 + */ +export * as NullOr from "./NullOr.ts" + /** * This module provides utility functions and type class instances for working with the `number` type in TypeScript. * It includes functions for basic arithmetic operations, as well as type class instances for @@ -1072,11 +1183,70 @@ export * as Number from "./Number.ts" */ export * as Optic from "./Optic.ts" +/** + * @since 2.0.0 + */ +export * as Option from "./Option.ts" + +/** + * This module provides an implementation of the `Order` type class which is used to define a total ordering on some type `A`. + * An order is defined by a relation `<=`, which obeys the following laws: + * + * - either `x <= y` or `y <= x` (totality) + * - if `x <= y` and `y <= x`, then `x == y` (antisymmetry) + * - if `x <= y` and `y <= z`, then `x <= z` (transitivity) + * + * The truth table for compare is defined as follows: + * + * | `x <= y` | `x >= y` | Ordering | | + * | -------- | -------- | -------- | --------------------- | + * | `true` | `true` | `0` | corresponds to x == y | + * | `true` | `false` | `< 0` | corresponds to x < y | + * | `false` | `true` | `> 0` | corresponds to x > y | + * + * @since 2.0.0 + */ +export * as Order from "./Order.ts" + +/** + * @fileoverview + * The Ordering module provides utilities for working with comparison results and ordering operations. + * An Ordering represents the result of comparing two values, expressing whether the first value is + * less than (-1), equal to (0), or greater than (1) the second value. + * + * This module is fundamental for building comparison functions, sorting algorithms, and implementing + * ordered data structures. It provides composable operations for combining multiple comparison results + * and pattern matching on ordering outcomes. + * + * Key Features: + * - Type-safe representation of comparison results (-1, 0, 1) + * - Composable operations for combining multiple orderings + * - Pattern matching utilities for handling different ordering cases + * - Ordering reversal and combination functions + * - Integration with Effect's functional programming patterns + * + * Common Use Cases: + * - Implementing custom comparison functions + * - Building complex sorting criteria + * - Combining multiple comparison results + * - Creating ordered data structures + * - Pattern matching on comparison outcomes + * + * @since 2.0.0 + * @category utilities + */ +export * as Ordering from "./Ordering.ts" + /** * @since 2.0.0 */ export * as Pool from "./Pool.ts" +/** + * @since 2.0.0 + */ +export * as Predicate from "./Predicate.ts" + /** * This module provides utilities for working with publish-subscribe (PubSub) systems. * @@ -1188,6 +1358,28 @@ export * as RcMap from "./RcMap.ts" */ export * as RcRef from "./RcRef.ts" +/** + * This module provides utility functions for working with records in TypeScript. + * + * @since 2.0.0 + */ +export * as Record from "./Record.ts" + +/** + * The Redacted module provides functionality for handling sensitive information + * securely within your application. By using the `Redacted` data type, you can + * ensure that sensitive values are not accidentally exposed in logs or error + * messages. + * + * @since 3.3.0 + */ +export * as Redacted from "./Redacted.ts" + +/** + * @since 4.0.0 + */ +export * as Reducer from "./Reducer.ts" + /** * This module provides utilities for working with mutable references in a functional context. * @@ -1264,6 +1456,11 @@ export * as Request from "./Request.ts" */ export * as RequestResolver from "./RequestResolver.ts" +/** + * @since 4.0.0 + */ +export * as Result from "./Result.ts" + /** * This module provides utilities for running Effect programs and managing their execution lifecycle. * @@ -1396,6 +1593,13 @@ export * as Stream from "./Stream.ts" */ export * as String from "./String.ts" +/** + * This module provides utility functions for working with structs in TypeScript. + * + * @since 2.0.0 + */ +export * as Struct from "./Struct.ts" + /** * @since 2.0.0 */ @@ -1421,6 +1625,44 @@ export * as Take from "./Take.ts" */ export * as Tracer from "./Tracer.ts" +/** + * This module provides utility functions for working with tuples in TypeScript. + * + * @since 2.0.0 + */ +export * as Tuple from "./Tuple.ts" + +/** + * This module provides small, allocation-free utilities for working with values of type + * `A | undefined`, where `undefined` means "no value". + * + * Why not `Option`? + * In TypeScript, `Option` is often unnecessary. If `undefined` already models absence + * in your domain, using `A | undefined` keeps types simple, avoids extra wrappers, and + * reduces overhead. The key is that `A` itself must not include `undefined`; in this + * module `undefined` is reserved to mean "no value". + * + * When to use `A | undefined`: + * - Absence can be represented by `undefined` in your domain model. + * - You do not need to distinguish between "no value" and "value is undefined". + * - You want straightforward ergonomics and zero extra allocations. + * + * When to prefer `Option`: + * - You must distinguish `None` from `Some(undefined)` (that is, `undefined` is a valid + * payload and carries meaning on its own). + * - You need a tagged representation for serialization or pattern matching across + * boundaries where `undefined` would be ambiguous. + * - You want the richer `Option` API and are comfortable with the extra wrapper. + * + * Lawfulness note: + * All helpers treat `undefined` as absence. Do not use these utilities with payloads + * where `A` can itself be `undefined`, or you will lose information. If you need to + * carry `undefined` as a valid payload, use `Option` instead. + * + * @since 4.0.0 + */ +export * as UndefinedOr from "./UndefinedOr.ts" + /** * @since 2.0.0 */ diff --git a/packages/effect/src/interfaces/Equal.ts b/packages/effect/src/interfaces/Equal.ts index 6b21936206..84f4ed3f13 100644 --- a/packages/effect/src/interfaces/Equal.ts +++ b/packages/effect/src/interfaces/Equal.ts @@ -5,10 +5,10 @@ * * @since 2.0.0 */ -import type { Equivalence } from "../data/Equivalence.ts" -import { hasProperty } from "../data/Predicate.ts" +import type { Equivalence } from "../Equivalence.ts" import * as Hash from "../interfaces/Hash.ts" import { byReferenceInstances, getAllObjectKeys } from "../internal/equal.ts" +import { hasProperty } from "../Predicate.ts" /** * The unique identifier used to identify objects that implement the `Equal` interface. diff --git a/packages/effect/src/interfaces/Hash.ts b/packages/effect/src/interfaces/Hash.ts index 4f2ad97bcb..f04f3d1cc9 100644 --- a/packages/effect/src/interfaces/Hash.ts +++ b/packages/effect/src/interfaces/Hash.ts @@ -7,9 +7,9 @@ * * @since 2.0.0 */ -import { hasProperty } from "../data/Predicate.ts" import { dual } from "../Function.ts" import { byReferenceInstances, getAllObjectKeys } from "../internal/equal.ts" +import { hasProperty } from "../Predicate.ts" /** * The unique identifier used to identify objects that implement the Hash interface. diff --git a/packages/effect/src/interfaces/Inspectable.ts b/packages/effect/src/interfaces/Inspectable.ts index d784334c94..396e2506a6 100644 --- a/packages/effect/src/interfaces/Inspectable.ts +++ b/packages/effect/src/interfaces/Inspectable.ts @@ -11,7 +11,7 @@ * @example * ```ts * import { Inspectable } from "effect/interfaces" - * import { format } from "effect/data/Formatter" + * import { format } from "effect/Formatter" * * class User extends Inspectable.Class { * constructor( @@ -37,8 +37,8 @@ * * @since 2.0.0 */ -import { format } from "../data/Formatter.ts" -import * as Predicate from "../data/Predicate.ts" +import { format } from "../Formatter.ts" +import * as Predicate from "../Predicate.ts" import { redact } from "./Redactable.ts" /** @@ -105,7 +105,7 @@ export type NodeInspectSymbol = typeof NodeInspectSymbol * @example * ```ts * import { Inspectable } from "effect/interfaces" - * import { format } from "effect/data/Formatter" + * import { format } from "effect/Formatter" * * class Result implements Inspectable.Inspectable { * constructor( diff --git a/packages/effect/src/interfaces/PrimaryKey.ts b/packages/effect/src/interfaces/PrimaryKey.ts index 71ceab14b5..ff2c78ae0c 100644 --- a/packages/effect/src/interfaces/PrimaryKey.ts +++ b/packages/effect/src/interfaces/PrimaryKey.ts @@ -10,7 +10,7 @@ * @since 2.0.0 */ -import { hasProperty } from "../data/Predicate.ts" +import { hasProperty } from "../Predicate.ts" /** * The unique identifier used to identify objects that implement the `PrimaryKey` interface. diff --git a/packages/effect/src/interfaces/Redactable.ts b/packages/effect/src/interfaces/Redactable.ts index 096f4361e5..83562dd31d 100644 --- a/packages/effect/src/interfaces/Redactable.ts +++ b/packages/effect/src/interfaces/Redactable.ts @@ -1,8 +1,8 @@ /** * @since 4.0.0 */ -import { hasProperty } from "../data/Predicate.ts" import { pipeArguments } from "../interfaces/Pipeable.ts" +import { hasProperty } from "../Predicate.ts" import type * as ServiceMap from "../ServiceMap.ts" /** diff --git a/packages/effect/src/interfaces/index.ts b/packages/effect/src/interfaces/index.ts index a93ed1d4bd..6be267ecf3 100644 --- a/packages/effect/src/interfaces/index.ts +++ b/packages/effect/src/interfaces/index.ts @@ -35,7 +35,7 @@ export * as Hash from "./Hash.ts" * @example * ```ts * import { Inspectable } from "effect/interfaces" - * import { format } from "effect/data/Formatter" + * import { format } from "effect/Formatter" * * class User extends Inspectable.Class { * constructor( diff --git a/packages/effect/src/internal/arbitrary.ts b/packages/effect/src/internal/arbitrary.ts index f9685e84dd..45f54d4b19 100644 --- a/packages/effect/src/internal/arbitrary.ts +++ b/packages/effect/src/internal/arbitrary.ts @@ -1,16 +1,16 @@ import * as Boolean from "../Boolean.ts" import * as Array from "../collections/Array.ts" -import type * as Combiner from "../data/Combiner.ts" -import * as Option from "../data/Option.ts" -import * as Predicate from "../data/Predicate.ts" -import * as Struct from "../data/Struct.ts" -import * as UndefinedOr from "../data/UndefinedOr.ts" +import type * as Combiner from "../Combiner.ts" import { memoize } from "../Function.ts" import * as Number from "../Number.ts" +import * as Option from "../Option.ts" +import * as Predicate from "../Predicate.ts" import * as Annotations from "../schema/Annotations.ts" import * as AST from "../schema/AST.ts" import type * as Schema from "../schema/Schema.ts" +import * as Struct from "../Struct.ts" import type * as FastCheck from "../testing/FastCheck.ts" +import * as UndefinedOr from "../UndefinedOr.ts" import { errorWithPath } from "./errors.ts" const arbitraryMemoMap = new WeakMap>() diff --git a/packages/effect/src/internal/core.ts b/packages/effect/src/internal/core.ts index 32067d4cb6..ece12745cf 100644 --- a/packages/effect/src/internal/core.ts +++ b/packages/effect/src/internal/core.ts @@ -1,13 +1,13 @@ import type * as Cause from "../Cause.ts" -import { format } from "../data/Formatter.ts" -import { hasProperty } from "../data/Predicate.ts" import type * as Effect from "../Effect.ts" import type * as Exit from "../Exit.ts" +import { format } from "../Formatter.ts" import { dual, identity } from "../Function.ts" import * as Equal from "../interfaces/Equal.ts" import * as Hash from "../interfaces/Hash.ts" import { NodeInspectSymbol } from "../interfaces/Inspectable.ts" import { pipeArguments } from "../interfaces/Pipeable.ts" +import { hasProperty } from "../Predicate.ts" import type { StackFrame } from "../References.ts" import type * as ServiceMap from "../ServiceMap.ts" import type { Equals } from "../types/Types.ts" diff --git a/packages/effect/src/internal/dateTime.ts b/packages/effect/src/internal/dateTime.ts index 1fb3f6f239..170ad0d6e9 100644 --- a/packages/effect/src/internal/dateTime.ts +++ b/packages/effect/src/internal/dateTime.ts @@ -1,20 +1,20 @@ import { IllegalArgumentError } from "../Cause.ts" import * as Clock from "../Clock.ts" -import * as equivalence from "../data/Equivalence.ts" -import * as order from "../data/Order.ts" -import * as Predicate from "../data/Predicate.ts" -import * as Result from "../data/Result.ts" -import * as UndefinedOr from "../data/UndefinedOr.ts" import type * as DateTime from "../DateTime.ts" import * as Duration from "../Duration.ts" import type * as Effect from "../Effect.ts" +import * as equivalence from "../Equivalence.ts" import type { LazyArg } from "../Function.ts" import { dual } from "../Function.ts" import * as Equal from "../interfaces/Equal.ts" import * as Hash from "../interfaces/Hash.ts" import * as Inspectable from "../interfaces/Inspectable.ts" import { pipeArguments } from "../interfaces/Pipeable.ts" +import * as order from "../Order.ts" +import * as Predicate from "../Predicate.ts" +import * as Result from "../Result.ts" import type { Mutable } from "../types/Types.ts" +import * as UndefinedOr from "../UndefinedOr.ts" import * as effect from "./effect.ts" /** @internal */ diff --git a/packages/effect/src/internal/differ.ts b/packages/effect/src/internal/differ.ts index 575db18777..2f8a857404 100644 --- a/packages/effect/src/internal/differ.ts +++ b/packages/effect/src/internal/differ.ts @@ -1,4 +1,4 @@ -import * as Predicate from "../data/Predicate.ts" +import * as Predicate from "../Predicate.ts" import type * as Schema from "../schema/Schema.ts" // Mutates op.path in place for perf; safe because child ops are freshly created and not shared. diff --git a/packages/effect/src/internal/effect.ts b/packages/effect/src/internal/effect.ts index 703207fd00..abf0db07db 100644 --- a/packages/effect/src/internal/effect.ts +++ b/packages/effect/src/internal/effect.ts @@ -2,16 +2,12 @@ import type * as Cause from "../Cause.ts" import type * as Clock from "../Clock.ts" import * as Arr from "../collections/Array.ts" import type * as Console from "../Console.ts" -import * as Filter from "../data/Filter.ts" -import { formatJson } from "../data/Formatter.ts" -import * as Option from "../data/Option.ts" -import * as Order from "../data/Order.ts" -import { hasProperty, isIterable, isString, isTagged } from "../data/Predicate.ts" -import * as Result from "../data/Result.ts" import * as Duration from "../Duration.ts" import type * as Effect from "../Effect.ts" import type * as Exit from "../Exit.ts" import type * as Fiber from "../Fiber.ts" +import * as Filter from "../Filter.ts" +import { formatJson } from "../Formatter.ts" import type { LazyArg } from "../Function.ts" import { constant, constFalse, constTrue, constUndefined, constVoid, dual, identity } from "../Function.ts" import * as Equal from "../interfaces/Equal.ts" @@ -22,6 +18,9 @@ import { currentFiberTypeId, redact } from "../interfaces/Redactable.ts" import type * as Logger from "../Logger.ts" import type * as LogLevel from "../LogLevel.ts" import type * as Metric from "../Metric.ts" +import * as Option from "../Option.ts" +import * as Order from "../Order.ts" +import { hasProperty, isIterable, isString, isTagged } from "../Predicate.ts" import { CurrentConcurrency, CurrentLogAnnotations, @@ -34,6 +33,7 @@ import { TracerSpanAnnotations, TracerSpanLinks } from "../References.ts" +import * as Result from "../Result.ts" import * as Scheduler from "../Scheduler.ts" import type * as Scope from "../Scope.ts" import * as ServiceMap from "../ServiceMap.ts" diff --git a/packages/effect/src/internal/equivalence.ts b/packages/effect/src/internal/equivalence.ts index 6bdacb45aa..de588ca21b 100644 --- a/packages/effect/src/internal/equivalence.ts +++ b/packages/effect/src/internal/equivalence.ts @@ -1,7 +1,7 @@ -import * as Equivalence from "../data/Equivalence.ts" -import * as Predicate from "../data/Predicate.ts" +import * as Equivalence from "../Equivalence.ts" import { memoize } from "../Function.ts" import * as Equal from "../interfaces/Equal.ts" +import * as Predicate from "../Predicate.ts" import * as Annotations from "../schema/Annotations.ts" import * as AST from "../schema/AST.ts" import * as Parser from "../schema/Parser.ts" diff --git a/packages/effect/src/internal/errors.ts b/packages/effect/src/internal/errors.ts index 0dce6e8a3d..66f4415e32 100644 --- a/packages/effect/src/internal/errors.ts +++ b/packages/effect/src/internal/errors.ts @@ -1,4 +1,4 @@ -import { formatPath } from "../data/Formatter.ts" +import { formatPath } from "../Formatter.ts" /** @internal */ export function errorWithPath(message: string, path: ReadonlyArray) { diff --git a/packages/effect/src/internal/executionPlan.ts b/packages/effect/src/internal/executionPlan.ts index e407292eed..a103936f97 100644 --- a/packages/effect/src/internal/executionPlan.ts +++ b/packages/effect/src/internal/executionPlan.ts @@ -1,7 +1,7 @@ -import * as Result from "../data/Result.ts" import type { Effect } from "../Effect.ts" import * as Api from "../ExecutionPlan.ts" import { dual } from "../Function.ts" +import * as Result from "../Result.ts" import * as Schedule from "../Schedule.ts" import * as effect from "./effect.ts" import * as internalLayer from "./layer.ts" diff --git a/packages/effect/src/internal/hashMap.ts b/packages/effect/src/internal/hashMap.ts index 26b4cd47cc..5b8b9250b1 100644 --- a/packages/effect/src/internal/hashMap.ts +++ b/packages/effect/src/internal/hashMap.ts @@ -2,9 +2,7 @@ * @since 2.0.0 */ -import { format } from "../data/Formatter.ts" -import * as Option from "../data/Option.ts" -import { hasProperty } from "../data/Predicate.ts" +import { format } from "../Formatter.ts" import { dual, pipe } from "../Function.ts" import * as Equal_ from "../interfaces/Equal.ts" import * as Hash from "../interfaces/Hash.ts" @@ -12,6 +10,8 @@ import type { Inspectable } from "../interfaces/Inspectable.ts" import { NodeInspectSymbol, toJson } from "../interfaces/Inspectable.ts" import type { Pipeable } from "../interfaces/Pipeable.ts" import { pipeArguments } from "../interfaces/Pipeable.ts" +import * as Option from "../Option.ts" +import { hasProperty } from "../Predicate.ts" import type { NoInfer } from "../types/Types.ts" /** @internal */ diff --git a/packages/effect/src/internal/hashSet.ts b/packages/effect/src/internal/hashSet.ts index fff58c9de1..8af89a63ae 100644 --- a/packages/effect/src/internal/hashSet.ts +++ b/packages/effect/src/internal/hashSet.ts @@ -2,14 +2,14 @@ * @since 2.0.0 */ -import { format } from "../data/Formatter.ts" -import { hasProperty } from "../data/Predicate.ts" +import { format } from "../Formatter.ts" import * as Equal from "../interfaces/Equal.ts" import * as Hash from "../interfaces/Hash.ts" import type { Inspectable } from "../interfaces/Inspectable.ts" import { NodeInspectSymbol, toJson } from "../interfaces/Inspectable.ts" import type { Pipeable } from "../interfaces/Pipeable.ts" import { pipeArguments } from "../interfaces/Pipeable.ts" +import { hasProperty } from "../Predicate.ts" import * as HashMap from "./hashMap.ts" /** @internal */ diff --git a/packages/effect/src/internal/json-schema.ts b/packages/effect/src/internal/json-schema.ts index 3b61336cd1..8a2da0fe85 100644 --- a/packages/effect/src/internal/json-schema.ts +++ b/packages/effect/src/internal/json-schema.ts @@ -1,5 +1,5 @@ -import { format } from "../data/Formatter.ts" -import * as Predicate from "../data/Predicate.ts" +import { format } from "../Formatter.ts" +import * as Predicate from "../Predicate.ts" import * as Annotations from "../schema/Annotations.ts" import * as AST from "../schema/AST.ts" import type * as Schema from "../schema/Schema.ts" diff --git a/packages/effect/src/internal/matcher.ts b/packages/effect/src/internal/matcher.ts index b7deb51bfd..c1a6ef38de 100644 --- a/packages/effect/src/internal/matcher.ts +++ b/packages/effect/src/internal/matcher.ts @@ -1,9 +1,9 @@ -import * as Option from "../data/Option.ts" -import type * as Predicate from "../data/Predicate.ts" -import * as Result from "../data/Result.ts" import { dual, identity } from "../Function.ts" import { pipeArguments } from "../interfaces/Pipeable.ts" import type { Case, Matcher, Not, SafeRefinement, TypeMatcher, Types, ValueMatcher, When } from "../Match.ts" +import * as Option from "../Option.ts" +import type * as Predicate from "../Predicate.ts" +import * as Result from "../Result.ts" import type { Unify } from "../types/Unify.ts" /** @internal */ diff --git a/packages/effect/src/internal/option.ts b/packages/effect/src/internal/option.ts index 8a925852e6..2f0014d211 100644 --- a/packages/effect/src/internal/option.ts +++ b/packages/effect/src/internal/option.ts @@ -1,12 +1,12 @@ /** * @since 2.0.0 */ -import { format } from "../data/Formatter.ts" -import type * as Option from "../data/Option.ts" -import { hasProperty } from "../data/Predicate.ts" +import { format } from "../Formatter.ts" import * as Equal from "../interfaces/Equal.ts" import * as Hash from "../interfaces/Hash.ts" import { toJson } from "../interfaces/Inspectable.ts" +import type * as Option from "../Option.ts" +import { hasProperty } from "../Predicate.ts" import { exitFail, exitSucceed, NoSuchElementError, PipeInspectableProto, YieldableProto } from "./core.ts" const TypeId = "~effect/data/Option" diff --git a/packages/effect/src/internal/redacted.ts b/packages/effect/src/internal/redacted.ts index d3ada0d05f..6043e1f99c 100644 --- a/packages/effect/src/internal/redacted.ts +++ b/packages/effect/src/internal/redacted.ts @@ -1,4 +1,4 @@ -import type * as Redacted from "../data/Redacted.ts" +import type * as Redacted from "../Redacted.ts" /** @internal */ export const redactedRegistry = new WeakMap, any>() diff --git a/packages/effect/src/internal/result.ts b/packages/effect/src/internal/result.ts index 30d43ace0b..2d3e44c1f7 100644 --- a/packages/effect/src/internal/result.ts +++ b/packages/effect/src/internal/result.ts @@ -1,11 +1,11 @@ -import { format } from "../data/Formatter.ts" -import type { Option } from "../data/Option.ts" -import { hasProperty } from "../data/Predicate.ts" -import type * as Result from "../data/Result.ts" +import { format } from "../Formatter.ts" import { dual } from "../Function.ts" import * as Equal from "../interfaces/Equal.ts" import * as Hash from "../interfaces/Hash.ts" import { toJson } from "../interfaces/Inspectable.ts" +import type { Option } from "../Option.ts" +import { hasProperty } from "../Predicate.ts" +import type * as Result from "../Result.ts" import { exitFail, exitSucceed, PipeInspectableProto, YieldableProto } from "./core.ts" import * as option from "./option.ts" diff --git a/packages/effect/src/internal/schedule.ts b/packages/effect/src/internal/schedule.ts index f965a907a7..6a807f876c 100644 --- a/packages/effect/src/internal/schedule.ts +++ b/packages/effect/src/internal/schedule.ts @@ -1,6 +1,6 @@ -import * as Option from "../data/Option.ts" import type { Effect, Repeat, Retry } from "../Effect.ts" import { constant, constTrue, dual } from "../Function.ts" +import * as Option from "../Option.ts" import * as Pull from "../Pull.ts" import * as Schedule from "../Schedule.ts" import type { NoInfer } from "../types/Types.ts" diff --git a/packages/effect/src/internal/tracing/otlpExporter.ts b/packages/effect/src/internal/tracing/otlpExporter.ts index e6d5f44b29..ccf7ebe461 100644 --- a/packages/effect/src/internal/tracing/otlpExporter.ts +++ b/packages/effect/src/internal/tracing/otlpExporter.ts @@ -1,11 +1,11 @@ import { Clock } from "../../Clock.ts" -import * as UndefinedOr from "../../data/UndefinedOr.ts" import * as Duration from "../../Duration.ts" import * as Effect from "../../Effect.ts" import * as Fiber from "../../Fiber.ts" import * as Num from "../../Number.ts" import * as Schedule from "../../Schedule.ts" import * as Scope from "../../Scope.ts" +import * as UndefinedOr from "../../UndefinedOr.ts" import * as Headers from "../../unstable/http/Headers.ts" import * as HttpClient from "../../unstable/http/HttpClient.ts" import * as HttpClientError from "../../unstable/http/HttpClientError.ts" diff --git a/packages/effect/src/internal/trie.ts b/packages/effect/src/internal/trie.ts index 506f341281..de81e172a0 100644 --- a/packages/effect/src/internal/trie.ts +++ b/packages/effect/src/internal/trie.ts @@ -1,13 +1,13 @@ import type * as TR from "../collections/Trie.ts" -import { format } from "../data/Formatter.ts" -import * as Option from "../data/Option.ts" -import type * as Ordering from "../data/Ordering.ts" -import { hasProperty } from "../data/Predicate.ts" +import { format } from "../Formatter.ts" import { dual, identity, pipe } from "../Function.ts" import * as Equal from "../interfaces/Equal.ts" import * as Hash from "../interfaces/Hash.ts" import { NodeInspectSymbol, toJson } from "../interfaces/Inspectable.ts" import { pipeArguments } from "../interfaces/Pipeable.ts" +import * as Option from "../Option.ts" +import type * as Ordering from "../Ordering.ts" +import { hasProperty } from "../Predicate.ts" import type { NoInfer } from "../types/Types.ts" /** @internal */ diff --git a/packages/effect/src/platform/FileSystem.ts b/packages/effect/src/platform/FileSystem.ts index 11f8cbbee4..60da571614 100644 --- a/packages/effect/src/platform/FileSystem.ts +++ b/packages/effect/src/platform/FileSystem.ts @@ -37,9 +37,8 @@ * * @since 4.0.0 */ +import * as Brand from "../Brand.ts" import * as Arr from "../collections/Array.ts" -import * as Brand from "../data/Brand.ts" -import * as UndefinedOr from "../data/UndefinedOr.ts" import * as Effect from "../Effect.ts" import { pipe } from "../Function.ts" import * as Layer from "../Layer.ts" @@ -48,6 +47,7 @@ import type { Scope } from "../Scope.ts" import * as ServiceMap from "../ServiceMap.ts" import * as Sink from "../Sink.ts" import * as Stream from "../Stream.ts" +import * as UndefinedOr from "../UndefinedOr.ts" import type { PlatformError } from "./PlatformError.ts" import { BadArgument, SystemError } from "./PlatformError.ts" diff --git a/packages/effect/src/platform/PlatformError.ts b/packages/effect/src/platform/PlatformError.ts index c24d72ea9f..b863fd479f 100644 --- a/packages/effect/src/platform/PlatformError.ts +++ b/packages/effect/src/platform/PlatformError.ts @@ -1,7 +1,7 @@ /** * @since 4.0.0 */ -import * as Data from "../data/Data.ts" +import * as Data from "../Data.ts" const TypeId = "~effect/platform/PlatformError" diff --git a/packages/effect/src/platform/Terminal.ts b/packages/effect/src/platform/Terminal.ts index 373fc2ba1d..b68c8260cc 100644 --- a/packages/effect/src/platform/Terminal.ts +++ b/packages/effect/src/platform/Terminal.ts @@ -1,8 +1,8 @@ /** * @since 4.0.0 */ -import * as Predicate from "../data/Predicate.ts" import type * as Effect from "../Effect.ts" +import * as Predicate from "../Predicate.ts" import type * as Queue from "../Queue.ts" import * as Schema from "../schema/Schema.ts" import type * as Scope from "../Scope.ts" diff --git a/packages/effect/src/schema/AST.ts b/packages/effect/src/schema/AST.ts index 6b614b23dd..1f4368c193 100644 --- a/packages/effect/src/schema/AST.ts +++ b/packages/effect/src/schema/AST.ts @@ -4,19 +4,19 @@ import * as Cause from "../Cause.ts" import * as Arr from "../collections/Array.ts" -import type * as Combiner from "../data/Combiner.ts" -import * as Filter_ from "../data/Filter.ts" -import { format, formatPropertyKey } from "../data/Formatter.ts" -import * as Option from "../data/Option.ts" -import * as Predicate from "../data/Predicate.ts" -import * as Result from "../data/Result.ts" +import type * as Combiner from "../Combiner.ts" import * as Effect from "../Effect.ts" import type * as Exit from "../Exit.ts" +import * as Filter_ from "../Filter.ts" +import { format, formatPropertyKey } from "../Formatter.ts" import { memoize } from "../Function.ts" import * as Pipeable from "../interfaces/Pipeable.ts" import { effectIsExit } from "../internal/effect.ts" import * as internalRecord from "../internal/record.ts" +import * as Option from "../Option.ts" +import * as Predicate from "../Predicate.ts" import * as RegEx from "../RegExp.ts" +import * as Result from "../Result.ts" import type * as Annotations from "./Annotations.ts" import * as Getter from "./Getter.ts" import * as Issue from "./Issue.ts" diff --git a/packages/effect/src/schema/Annotations.ts b/packages/effect/src/schema/Annotations.ts index 9dc1da714d..0ba32e3783 100644 --- a/packages/effect/src/schema/Annotations.ts +++ b/packages/effect/src/schema/Annotations.ts @@ -2,8 +2,8 @@ * @since 4.0.0 */ -import type { Equivalence } from "../data/Equivalence.ts" -import type { Formatter } from "../data/Formatter.ts" +import type { Equivalence } from "../Equivalence.ts" +import type { Formatter } from "../Formatter.ts" import { memoize } from "../Function.ts" import type * as FastCheck from "../testing/FastCheck.ts" import type * as AST from "./AST.ts" diff --git a/packages/effect/src/schema/FromJsonSchema.ts b/packages/effect/src/schema/FromJsonSchema.ts index ccc6aea5c1..326c7c3c0c 100644 --- a/packages/effect/src/schema/FromJsonSchema.ts +++ b/packages/effect/src/schema/FromJsonSchema.ts @@ -17,13 +17,13 @@ * @since 4.0.0 */ import * as Arr from "../collections/Array.ts" -import * as Combiner from "../data/Combiner.ts" -import { format, formatPropertyKey } from "../data/Formatter.ts" -import { isObject } from "../data/Predicate.ts" -import * as Reducer from "../data/Reducer.ts" -import * as UndefinedOr from "../data/UndefinedOr.ts" +import * as Combiner from "../Combiner.ts" +import { format, formatPropertyKey } from "../Formatter.ts" import { remainder } from "../Number.ts" +import { isObject } from "../Predicate.ts" +import * as Reducer from "../Reducer.ts" import { type Mutable } from "../types/Types.ts" +import * as UndefinedOr from "../UndefinedOr.ts" import type { Annotations } from "./Annotations.ts" import type * as AST from "./AST.ts" import type * as Schema from "./Schema.ts" diff --git a/packages/effect/src/schema/Getter.ts b/packages/effect/src/schema/Getter.ts index 8fbf8c0a62..3f38b9fab4 100644 --- a/packages/effect/src/schema/Getter.ts +++ b/packages/effect/src/schema/Getter.ts @@ -1,15 +1,15 @@ /** * @since 4.0.0 */ -import * as Option from "../data/Option.ts" -import * as Predicate from "../data/Predicate.ts" -import * as Result from "../data/Result.ts" import * as DateTime from "../DateTime.ts" import * as Effect from "../Effect.ts" import * as Base64 from "../encoding/Base64.ts" import * as Base64Url from "../encoding/Base64Url.ts" import * as Hex from "../encoding/Hex.ts" import { Class } from "../interfaces/Pipeable.ts" +import * as Option from "../Option.ts" +import * as Predicate from "../Predicate.ts" +import * as Result from "../Result.ts" import * as Str from "../String.ts" import type * as Annotations from "./Annotations.ts" import type * as AST from "./AST.ts" diff --git a/packages/effect/src/schema/Issue.ts b/packages/effect/src/schema/Issue.ts index ed1a2e9b04..e980fd4396 100644 --- a/packages/effect/src/schema/Issue.ts +++ b/packages/effect/src/schema/Issue.ts @@ -2,9 +2,9 @@ * @since 4.0.0 */ import type { StandardSchemaV1 } from "@standard-schema/spec" -import { format, formatPath, type Formatter as FormatterI } from "../data/Formatter.ts" -import * as Option from "../data/Option.ts" -import { hasProperty } from "../data/Predicate.ts" +import { format, formatPath, type Formatter as FormatterI } from "../Formatter.ts" +import * as Option from "../Option.ts" +import { hasProperty } from "../Predicate.ts" import * as Annotations from "./Annotations.ts" import type * as AST from "./AST.ts" diff --git a/packages/effect/src/schema/Parser.ts b/packages/effect/src/schema/Parser.ts index cb6208d22e..fe7b1004c4 100644 --- a/packages/effect/src/schema/Parser.ts +++ b/packages/effect/src/schema/Parser.ts @@ -4,12 +4,12 @@ import * as Cause from "../Cause.ts" import * as Arr from "../collections/Array.ts" -import * as Filter from "../data/Filter.ts" -import * as Option from "../data/Option.ts" -import * as Predicate from "../data/Predicate.ts" import * as Effect from "../Effect.ts" import * as Exit from "../Exit.ts" +import * as Filter from "../Filter.ts" import { memoize } from "../Function.ts" +import * as Option from "../Option.ts" +import * as Predicate from "../Predicate.ts" import * as Annotations from "./Annotations.ts" import * as AST from "./AST.ts" import * as Issue from "./Issue.ts" diff --git a/packages/effect/src/schema/Schema.ts b/packages/effect/src/schema/Schema.ts index 692d2a085d..9550c1b3a3 100644 --- a/packages/effect/src/schema/Schema.ts +++ b/packages/effect/src/schema/Schema.ts @@ -3,27 +3,19 @@ */ import type { StandardJSONSchemaV1, StandardSchemaV1 } from "@standard-schema/spec" +import type * as Brand from "../Brand.ts" import * as Cause_ from "../Cause.ts" import * as Arr from "../collections/Array.ts" -import type * as Brand from "../data/Brand.ts" -import type * as Combiner from "../data/Combiner.ts" -import * as Data from "../data/Data.ts" -import type * as Equivalence from "../data/Equivalence.ts" -import type { Formatter } from "../data/Formatter.ts" -import { format, formatDate, formatPropertyKey } from "../data/Formatter.ts" -import * as Option_ from "../data/Option.ts" -import * as Order from "../data/Order.ts" -import * as Predicate from "../data/Predicate.ts" -import * as Record_ from "../data/Record.ts" -import * as Redacted_ from "../data/Redacted.ts" -import * as Result_ from "../data/Result.ts" -import type { Assign, Lambda, Mutable, Simplify } from "../data/Struct.ts" -import * as Struct_ from "../data/Struct.ts" +import type * as Combiner from "../Combiner.ts" +import * as Data from "../Data.ts" import * as DateTime from "../DateTime.ts" import type { Differ } from "../Differ.ts" import * as Duration_ from "../Duration.ts" import * as Effect from "../Effect.ts" +import type * as Equivalence from "../Equivalence.ts" import * as Exit_ from "../Exit.ts" +import type { Formatter } from "../Formatter.ts" +import { format, formatDate, formatPropertyKey } from "../Formatter.ts" import { identity, memoize } from "../Function.ts" import * as Equal from "../interfaces/Equal.ts" import * as Pipeable from "../interfaces/Pipeable.ts" @@ -34,8 +26,16 @@ import * as InternalEquivalence from "../internal/equivalence.ts" import * as InternalJsonSchema from "../internal/json-schema.ts" import { remainder } from "../Number.ts" import * as Optic_ from "../Optic.ts" +import * as Option_ from "../Option.ts" +import * as Order from "../Order.ts" +import * as Predicate from "../Predicate.ts" +import * as Record_ from "../Record.ts" +import * as Redacted_ from "../Redacted.ts" import * as Request from "../Request.ts" +import * as Result_ from "../Result.ts" import * as Scheduler from "../Scheduler.ts" +import type { Assign, Lambda, Mutable, Simplify } from "../Struct.ts" +import * as Struct_ from "../Struct.ts" import * as FastCheck from "../testing/FastCheck.ts" import type { UnionToIntersection } from "../types/Types.ts" import * as Annotations from "./Annotations.ts" @@ -1670,7 +1670,7 @@ interface fieldsAssign extends Lambda { * * ```ts * import { Schema } from "effect/schema" - * import { Tuple } from "effect/data" + * import { Tuple } from "effect" * * // Add a new field to all members of a union of structs * const schema = Schema.Union([ diff --git a/packages/effect/src/schema/Standard.ts b/packages/effect/src/schema/Standard.ts index 8372381bbc..caa7cdce41 100644 --- a/packages/effect/src/schema/Standard.ts +++ b/packages/effect/src/schema/Standard.ts @@ -2,10 +2,10 @@ * @since 4.0.0 */ import * as Arr from "../collections/Array.ts" -import { format, formatPropertyKey } from "../data/Formatter.ts" -import * as Option from "../data/Option.ts" -import * as Predicate from "../data/Predicate.ts" -import * as Rec from "../data/Record.ts" +import { format, formatPropertyKey } from "../Formatter.ts" +import * as Option from "../Option.ts" +import * as Predicate from "../Predicate.ts" +import * as Rec from "../Record.ts" import * as RegEx from "../RegExp.ts" import type * as Types from "../types/Types.ts" import * as Annotations from "./Annotations.ts" diff --git a/packages/effect/src/schema/Transformation.ts b/packages/effect/src/schema/Transformation.ts index 8f91f67166..40ccbe585b 100644 --- a/packages/effect/src/schema/Transformation.ts +++ b/packages/effect/src/schema/Transformation.ts @@ -2,10 +2,10 @@ * @since 4.0.0 */ -import * as Option from "../data/Option.ts" -import * as Predicate from "../data/Predicate.ts" import * as Duration from "../Duration.ts" import * as Effect from "../Effect.ts" +import * as Option from "../Option.ts" +import * as Predicate from "../Predicate.ts" import type * as AST from "./AST.ts" import * as Getter from "./Getter.ts" import * as Issue from "./Issue.ts" diff --git a/packages/effect/src/stm/TxChunk.ts b/packages/effect/src/stm/TxChunk.ts index 659410dd24..5f07fbddbf 100644 --- a/packages/effect/src/stm/TxChunk.ts +++ b/packages/effect/src/stm/TxChunk.ts @@ -10,8 +10,8 @@ * @since 4.0.0 */ import * as Chunk from "../collections/Chunk.ts" -import { format } from "../data/Formatter.ts" import * as Effect from "../Effect.ts" +import { format } from "../Formatter.ts" import { dual } from "../Function.ts" import type { Inspectable } from "../interfaces/Inspectable.ts" import { NodeInspectSymbol, toJson } from "../interfaces/Inspectable.ts" diff --git a/packages/effect/src/stm/TxHashMap.ts b/packages/effect/src/stm/TxHashMap.ts index d8a990cf10..f01a6426aa 100644 --- a/packages/effect/src/stm/TxHashMap.ts +++ b/packages/effect/src/stm/TxHashMap.ts @@ -3,14 +3,14 @@ */ import * as HashMap from "../collections/HashMap.ts" -import { format } from "../data/Formatter.ts" -import * as Option from "../data/Option.ts" import * as Effect from "../Effect.ts" +import { format } from "../Formatter.ts" import { dual } from "../Function.ts" import type { Inspectable } from "../interfaces/Inspectable.ts" import { NodeInspectSymbol, toJson } from "../interfaces/Inspectable.ts" import type { Pipeable } from "../interfaces/Pipeable.ts" import { pipeArguments } from "../interfaces/Pipeable.ts" +import * as Option from "../Option.ts" import * as TxRef from "../stm/TxRef.ts" const TypeId = "~effect/transactions/TxHashMap" @@ -42,7 +42,7 @@ const TxHashMapProto = { * @example * ```ts * import { Effect } from "effect" - * import { Option } from "effect/data" + * import { Option } from "effect" * import { TxHashMap } from "effect/stm" * * const program = Effect.gen(function*() { @@ -336,7 +336,7 @@ export const fromIterable = (entries: Iterable): Effect.E * @example * ```ts * import { Effect } from "effect" - * import { Option } from "effect/data" + * import { Option } from "effect" * import { TxHashMap } from "effect/stm" * * const program = Effect.gen(function*() { @@ -732,7 +732,7 @@ export const modify: { * @example * ```ts * import { Effect } from "effect" - * import { Option } from "effect/data" + * import { Option } from "effect" * import { TxHashMap } from "effect/stm" * * const program = Effect.gen(function*() { @@ -794,7 +794,7 @@ export const modifyAt: { * @example * ```ts * import { Effect } from "effect" - * import { Option } from "effect/data" + * import { Option } from "effect" * import { TxHashMap } from "effect/stm" * * const program = Effect.gen(function*() { @@ -1464,7 +1464,7 @@ export const reduce: { * @example * ```ts * import { Effect } from "effect" - * import { Option } from "effect/data" + * import { Option } from "effect" * import { TxHashMap } from "effect/stm" * * const program = Effect.gen(function*() { @@ -1877,7 +1877,7 @@ export const flatMap: { * @example * ```ts * import { Effect } from "effect" - * import { Option } from "effect/data" + * import { Option } from "effect" * import { TxHashMap } from "effect/stm" * * const program = Effect.gen(function*() { diff --git a/packages/effect/src/stm/TxHashSet.ts b/packages/effect/src/stm/TxHashSet.ts index 689b8502ba..bb6067cf58 100644 --- a/packages/effect/src/stm/TxHashSet.ts +++ b/packages/effect/src/stm/TxHashSet.ts @@ -3,14 +3,14 @@ */ import * as HashSet from "../collections/HashSet.ts" -import { format } from "../data/Formatter.ts" -import type { Predicate, Refinement } from "../data/Predicate.ts" import * as Effect from "../Effect.ts" +import { format } from "../Formatter.ts" import { dual } from "../Function.ts" import type { Inspectable } from "../interfaces/Inspectable.ts" import { NodeInspectSymbol, toJson } from "../interfaces/Inspectable.ts" import type { Pipeable } from "../interfaces/Pipeable.ts" import { pipeArguments } from "../interfaces/Pipeable.ts" +import type { Predicate, Refinement } from "../Predicate.ts" import * as TxRef from "../stm/TxRef.ts" import type { NoInfer } from "../types/Types.ts" diff --git a/packages/effect/src/stm/TxQueue.ts b/packages/effect/src/stm/TxQueue.ts index 1249631d9d..9e3c15a635 100644 --- a/packages/effect/src/stm/TxQueue.ts +++ b/packages/effect/src/stm/TxQueue.ts @@ -11,12 +11,12 @@ */ import * as Cause from "../Cause.ts" import * as Chunk from "../collections/Chunk.ts" -import * as Option from "../data/Option.ts" -import { hasProperty } from "../data/Predicate.ts" import * as Effect from "../Effect.ts" import { dual } from "../Function.ts" import type { Inspectable } from "../interfaces/Inspectable.ts" import { NodeInspectSymbol, toJson } from "../interfaces/Inspectable.ts" +import * as Option from "../Option.ts" +import { hasProperty } from "../Predicate.ts" import * as TxChunk from "../stm/TxChunk.ts" import * as TxRef from "../stm/TxRef.ts" import type * as Types from "../types/Types.ts" @@ -727,7 +727,7 @@ export const take = (self: TxDequeue): Effect.Effect => * @example * ```ts * import { Effect } from "effect" - * import { Option } from "effect/data" + * import { Option } from "effect" * import { TxQueue } from "effect/stm" * * const program = Effect.gen(function*() { diff --git a/packages/effect/src/testing/TestClock.ts b/packages/effect/src/testing/TestClock.ts index bdbc19b0ea..88193567de 100644 --- a/packages/effect/src/testing/TestClock.ts +++ b/packages/effect/src/testing/TestClock.ts @@ -3,12 +3,12 @@ */ import * as Clock from "../Clock.ts" import * as Arr from "../collections/Array.ts" -import * as Data from "../data/Data.ts" -import * as Order from "../data/Order.ts" +import * as Data from "../Data.ts" import * as Duration from "../Duration.ts" import * as Effect from "../Effect.ts" import * as Fiber from "../Fiber.ts" import * as Layer from "../Layer.ts" +import * as Order from "../Order.ts" /** * A `TestClock` simplifies deterministically and efficiently testing effects @@ -26,7 +26,7 @@ import * as Layer from "../Layer.ts" * import * as assert from "node:assert" * import { Duration } from "effect" * import { Effect, pipe } from "effect" - * import { Option } from "effect/data" + * import { Option } from "effect" * import { Fiber } from "effect" * import { TestClock } from "effect/testing" * diff --git a/packages/effect/src/testing/TestConsole.ts b/packages/effect/src/testing/TestConsole.ts index 518da28ada..43159bdeab 100644 --- a/packages/effect/src/testing/TestConsole.ts +++ b/packages/effect/src/testing/TestConsole.ts @@ -3,9 +3,9 @@ */ import * as Array from "../collections/Array.ts" import * as Console from "../Console.ts" -import * as Option from "../data/Option.ts" import * as Effect from "../Effect.ts" import * as Layer from "../Layer.ts" +import * as Option from "../Option.ts" /** * A `TestConsole` provides a testable implementation of the Console interface. diff --git a/packages/effect/src/testing/TestSchema.ts b/packages/effect/src/testing/TestSchema.ts index 61b920af52..6b70a1d31d 100644 --- a/packages/effect/src/testing/TestSchema.ts +++ b/packages/effect/src/testing/TestSchema.ts @@ -4,9 +4,9 @@ * @since 4.0.0 */ import * as assert from "node:assert" -import * as Record from "../data/Record.ts" -import * as Result from "../data/Result.ts" import * as Effect from "../Effect.ts" +import * as Record from "../Record.ts" +import * as Result from "../Result.ts" import * as AST from "../schema/AST.ts" import type * as Issue from "../schema/Issue.ts" import * as Parser from "../schema/Parser.ts" diff --git a/packages/effect/src/types/HKT.ts b/packages/effect/src/types/HKT.ts index 0430880f99..d431c3ff4f 100644 --- a/packages/effect/src/types/HKT.ts +++ b/packages/effect/src/types/HKT.ts @@ -150,7 +150,7 @@ export interface TypeLambda { * @example * ```ts * import { Effect } from "effect" - * import { Option } from "effect/data" + * import { Option } from "effect" * import { HKT } from "effect/types" * * // Define TypeLambdas diff --git a/packages/effect/src/unstable/ai/AiError.ts b/packages/effect/src/unstable/ai/AiError.ts index f64a585b7f..3f341decdc 100644 --- a/packages/effect/src/unstable/ai/AiError.ts +++ b/packages/effect/src/unstable/ai/AiError.ts @@ -69,10 +69,10 @@ * * @since 4.0.0 */ -import { format } from "../../data/Formatter.ts" -import * as Predicate from "../../data/Predicate.ts" import * as Effect from "../../Effect.ts" +import { format } from "../../Formatter.ts" import { redact } from "../../interfaces/Redactable.ts" +import * as Predicate from "../../Predicate.ts" import * as Schema from "../../schema/Schema.ts" import type * as HttpClientError from "../http/HttpClientError.ts" diff --git a/packages/effect/src/unstable/ai/Chat.ts b/packages/effect/src/unstable/ai/Chat.ts index c9dc09d575..868753a446 100644 --- a/packages/effect/src/unstable/ai/Chat.ts +++ b/packages/effect/src/unstable/ai/Chat.ts @@ -48,11 +48,11 @@ * @since 4.0.0 */ import * as Channel from "../../Channel.ts" -import * as Option from "../../data/Option.ts" -import * as Predicate from "../../data/Predicate.ts" import * as Duration from "../../Duration.ts" import * as Effect from "../../Effect.ts" import * as Layer from "../../Layer.ts" +import * as Option from "../../Option.ts" +import * as Predicate from "../../Predicate.ts" import * as Ref from "../../Ref.ts" import * as Schema from "../../schema/Schema.ts" import * as ServiceMap from "../../ServiceMap.ts" diff --git a/packages/effect/src/unstable/ai/IdGenerator.ts b/packages/effect/src/unstable/ai/IdGenerator.ts index d4f1c81e65..f96d76bfad 100644 --- a/packages/effect/src/unstable/ai/IdGenerator.ts +++ b/packages/effect/src/unstable/ai/IdGenerator.ts @@ -46,9 +46,9 @@ * @since 4.0.0 */ import * as Cause from "../../Cause.ts" -import * as Predicate from "../../data/Predicate.ts" import * as Effect from "../../Effect.ts" import * as Layer from "../../Layer.ts" +import * as Predicate from "../../Predicate.ts" import * as Random from "../../Random.ts" import * as ServiceMap from "../../ServiceMap.ts" diff --git a/packages/effect/src/unstable/ai/LanguageModel.ts b/packages/effect/src/unstable/ai/LanguageModel.ts index bf03ab6c0b..67b8f1ac4c 100644 --- a/packages/effect/src/unstable/ai/LanguageModel.ts +++ b/packages/effect/src/unstable/ai/LanguageModel.ts @@ -49,9 +49,9 @@ * * @since 4.0.0 */ -import * as Option from "../../data/Option.ts" -import * as Predicate from "../../data/Predicate.ts" import * as Effect from "../../Effect.ts" +import * as Option from "../../Option.ts" +import * as Predicate from "../../Predicate.ts" import * as Queue from "../../Queue.ts" import * as SchemaAnnotations from "../../schema/Annotations.ts" import * as Schema from "../../schema/Schema.ts" diff --git a/packages/effect/src/unstable/ai/McpSchema.ts b/packages/effect/src/unstable/ai/McpSchema.ts index 36186c2593..a9f4fcf03d 100644 --- a/packages/effect/src/unstable/ai/McpSchema.ts +++ b/packages/effect/src/unstable/ai/McpSchema.ts @@ -1,10 +1,10 @@ /** * @since 4.0.0 */ -import * as Option from "../../data/Option.ts" -import * as Predicate from "../../data/Predicate.ts" import type * as Effect from "../../Effect.ts" import { constFalse, constTrue } from "../../Function.ts" +import * as Option from "../../Option.ts" +import * as Predicate from "../../Predicate.ts" import * as Getter from "../../schema/Getter.ts" import * as Schema from "../../schema/Schema.ts" import type * as Scope from "../../Scope.ts" diff --git a/packages/effect/src/unstable/ai/McpServer.ts b/packages/effect/src/unstable/ai/McpServer.ts index 1de312ea2c..70cb8a91a3 100644 --- a/packages/effect/src/unstable/ai/McpServer.ts +++ b/packages/effect/src/unstable/ai/McpServer.ts @@ -3,10 +3,10 @@ */ import * as Cause from "../../Cause.ts" import * as Arr from "../../collections/Array.ts" -import * as Option from "../../data/Option.ts" import * as Effect from "../../Effect.ts" import * as Exit from "../../Exit.ts" import * as Layer from "../../Layer.ts" +import * as Option from "../../Option.ts" import * as Queue from "../../Queue.ts" import * as RcMap from "../../RcMap.ts" import * as SchemaAnnotations from "../../schema/Annotations.ts" diff --git a/packages/effect/src/unstable/ai/Prompt.ts b/packages/effect/src/unstable/ai/Prompt.ts index 640bcfec71..f6596c8609 100644 --- a/packages/effect/src/unstable/ai/Prompt.ts +++ b/packages/effect/src/unstable/ai/Prompt.ts @@ -52,11 +52,11 @@ * @since 4.0.0 */ import * as Arr from "../../collections/Array.ts" -import * as Option from "../../data/Option.ts" -import * as Predicate from "../../data/Predicate.ts" import * as Effect from "../../Effect.ts" import { constFalse, dual } from "../../Function.ts" import { type Pipeable, pipeArguments } from "../../interfaces/Pipeable.ts" +import * as Option from "../../Option.ts" +import * as Predicate from "../../Predicate.ts" import * as SchemaIssue from "../../schema/Issue.ts" import * as Parser from "../../schema/Parser.ts" import * as Schema from "../../schema/Schema.ts" diff --git a/packages/effect/src/unstable/ai/Response.ts b/packages/effect/src/unstable/ai/Response.ts index 453976e956..f56881eefe 100644 --- a/packages/effect/src/unstable/ai/Response.ts +++ b/packages/effect/src/unstable/ai/Response.ts @@ -26,9 +26,9 @@ * * @since 4.0.0 */ -import * as Predicate from "../../data/Predicate.ts" import type * as DateTime from "../../DateTime.ts" import { constFalse, identity } from "../../Function.ts" +import * as Predicate from "../../Predicate.ts" import * as Schema from "../../schema/Schema.ts" import * as SchemaTransformation from "../../schema/Transformation.ts" import type * as Tool from "./Tool.ts" @@ -2046,7 +2046,7 @@ export const UrlSourcePart: Schema.Struct<{ * @example * ```ts * import { DateTime } from "effect" - * import { Option } from "effect/data" + * import { Option } from "effect" * import { Response } from "effect/unstable/ai" * * const metadataPart: Response.ResponseMetadataPart = Response.makePart("response-metadata", { diff --git a/packages/effect/src/unstable/ai/Telemetry.ts b/packages/effect/src/unstable/ai/Telemetry.ts index 85a65123cf..5baf79d774 100644 --- a/packages/effect/src/unstable/ai/Telemetry.ts +++ b/packages/effect/src/unstable/ai/Telemetry.ts @@ -31,11 +31,11 @@ * * @since 4.0.0 */ -import * as Predicate from "../../data/Predicate.ts" -import type * as Struct from "../../data/Struct.ts" import { dual } from "../../Function.ts" +import * as Predicate from "../../Predicate.ts" import * as ServiceMap from "../../ServiceMap.ts" import * as String from "../../String.ts" +import type * as Struct from "../../Struct.ts" import type { Span } from "../../Tracer.ts" import type { ProviderOptions } from "./LanguageModel.ts" import type * as Response from "./Response.ts" diff --git a/packages/effect/src/unstable/ai/Tokenizer.ts b/packages/effect/src/unstable/ai/Tokenizer.ts index 2489c0e18f..6a02079ccc 100644 --- a/packages/effect/src/unstable/ai/Tokenizer.ts +++ b/packages/effect/src/unstable/ai/Tokenizer.ts @@ -35,8 +35,8 @@ * * @since 4.0.0 */ -import * as Predicate from "../../data/Predicate.ts" import * as Effect from "../../Effect.ts" +import * as Predicate from "../../Predicate.ts" import * as ServiceMap from "../../ServiceMap.ts" import type * as AiError from "./AiError.ts" import * as Prompt from "./Prompt.ts" diff --git a/packages/effect/src/unstable/ai/Tool.ts b/packages/effect/src/unstable/ai/Tool.ts index 11728583ab..1878a9c3b6 100644 --- a/packages/effect/src/unstable/ai/Tool.ts +++ b/packages/effect/src/unstable/ai/Tool.ts @@ -26,15 +26,15 @@ * * @since 4.0.0 */ -import * as Predicate from "../../data/Predicate.ts" -import type * as Struct from "../../data/Struct.ts" import type * as Effect from "../../Effect.ts" import { constFalse, constTrue, identity } from "../../Function.ts" import { pipeArguments } from "../../interfaces/Pipeable.ts" +import * as Predicate from "../../Predicate.ts" import * as Annotations from "../../schema/Annotations.ts" import * as AST from "../../schema/AST.ts" import * as Schema from "../../schema/Schema.ts" import * as ServiceMap from "../../ServiceMap.ts" +import type * as Struct from "../../Struct.ts" import type * as Types from "../../types/Types.ts" // ============================================================================= diff --git a/packages/effect/src/unstable/ai/Toolkit.ts b/packages/effect/src/unstable/ai/Toolkit.ts index 13c582b10f..b23a5f9b9e 100644 --- a/packages/effect/src/unstable/ai/Toolkit.ts +++ b/packages/effect/src/unstable/ai/Toolkit.ts @@ -38,13 +38,13 @@ * * @since 1.0.0 */ -import * as Predicate from "../../data/Predicate.ts" import * as Effect from "../../Effect.ts" import { identity } from "../../Function.ts" import type { Inspectable } from "../../interfaces/Inspectable.ts" import type { Pipeable } from "../../interfaces/Pipeable.ts" import { PipeInspectableProto, YieldableProto } from "../../internal/core.ts" import * as Layer from "../../Layer.ts" +import * as Predicate from "../../Predicate.ts" import * as Schema from "../../schema/Schema.ts" import type * as Scope from "../../Scope.ts" import * as ServiceMap from "../../ServiceMap.ts" diff --git a/packages/effect/src/unstable/cli/Argument.ts b/packages/effect/src/unstable/cli/Argument.ts index a193bc902d..02e7a9ac56 100644 --- a/packages/effect/src/unstable/cli/Argument.ts +++ b/packages/effect/src/unstable/cli/Argument.ts @@ -1,13 +1,13 @@ /** * @since 4.0.0 */ -import type * as Option from "../../data/Option.ts" -import type * as Redacted from "../../data/Redacted.ts" -import type * as Result from "../../data/Result.ts" import type * as Effect from "../../Effect.ts" import { dual, type LazyArg } from "../../Function.ts" +import type * as Option from "../../Option.ts" import type * as FileSystem from "../../platform/FileSystem.ts" import type * as Path from "../../platform/Path.ts" +import type * as Redacted from "../../Redacted.ts" +import type * as Result from "../../Result.ts" import type * as Schema from "../../schema/Schema.ts" import type * as CliError from "./CliError.ts" import type { Environment } from "./Command.ts" @@ -585,7 +585,7 @@ export const filter: { * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * import { Argument } from "effect/unstable/cli" * * const positiveInt = Argument.integer("count").pipe( diff --git a/packages/effect/src/unstable/cli/CliError.ts b/packages/effect/src/unstable/cli/CliError.ts index 5c23205ffd..955603591e 100644 --- a/packages/effect/src/unstable/cli/CliError.ts +++ b/packages/effect/src/unstable/cli/CliError.ts @@ -1,7 +1,7 @@ /** * @since 4.0.0 */ -import * as Predicate from "../../data/Predicate.ts" +import * as Predicate from "../../Predicate.ts" import * as Schema from "../../schema/Schema.ts" /** diff --git a/packages/effect/src/unstable/cli/Command.ts b/packages/effect/src/unstable/cli/Command.ts index bdbd706221..7a5a0cc99e 100644 --- a/packages/effect/src/unstable/cli/Command.ts +++ b/packages/effect/src/unstable/cli/Command.ts @@ -2,7 +2,6 @@ * @since 4.0.0 */ import * as Console from "../../Console.ts" -import * as Predicate from "../../data/Predicate.ts" import * as Effect from "../../Effect.ts" import { dual } from "../../Function.ts" import type { Pipeable } from "../../interfaces/Pipeable.ts" @@ -10,6 +9,7 @@ import type * as Layer from "../../Layer.ts" import type * as FileSystem from "../../platform/FileSystem.ts" import type * as Path from "../../platform/Path.ts" import type * as Terminal from "../../platform/Terminal.ts" +import * as Predicate from "../../Predicate.ts" import * as References from "../../References.ts" import type * as ServiceMap from "../../ServiceMap.ts" import type { Simplify } from "../../types/Types.ts" diff --git a/packages/effect/src/unstable/cli/Flag.ts b/packages/effect/src/unstable/cli/Flag.ts index df30c57967..89f604caa3 100644 --- a/packages/effect/src/unstable/cli/Flag.ts +++ b/packages/effect/src/unstable/cli/Flag.ts @@ -1,13 +1,13 @@ /** * @since 4.0.0 */ -import type * as Option from "../../data/Option.ts" -import type * as Redacted from "../../data/Redacted.ts" -import type * as Result from "../../data/Result.ts" import type * as Effect from "../../Effect.ts" import { dual, type LazyArg } from "../../Function.ts" +import type * as Option from "../../Option.ts" import type * as FileSystem from "../../platform/FileSystem.ts" import type * as Path from "../../platform/Path.ts" +import type * as Redacted from "../../Redacted.ts" +import type * as Result from "../../Result.ts" import type * as Schema from "../../schema/Schema.ts" import type * as CliError from "./CliError.ts" import * as Param from "./Param.ts" @@ -231,7 +231,7 @@ export const directory = (name: string, options?: { * @example * ```ts * import { Effect } from "effect" - * import { Redacted } from "effect/data" + * import { Redacted } from "effect" * import { Flag } from "effect/unstable/cli" * * const passwordFlag = Flag.redacted("password") @@ -451,7 +451,7 @@ export const withMetavar: { * @example * ```ts * import { Effect } from "effect" - * import { Option } from "effect/data" + * import { Option } from "effect" * import { Flag } from "effect/unstable/cli" * * const optionalPort = Flag.optional(Flag.integer("port")) @@ -677,7 +677,7 @@ export const between: { * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * import { Flag } from "effect/unstable/cli" * * // Parse positive integers only @@ -779,7 +779,7 @@ export const orElse: { * @example * ```ts * import { Effect } from "effect" - * import { Result } from "effect/data" + * import { Result } from "effect" * import { Flag } from "effect/unstable/cli" * * // Try file path, fallback to URL diff --git a/packages/effect/src/unstable/cli/Param.ts b/packages/effect/src/unstable/cli/Param.ts index 4478364c3f..35d5275a2e 100644 --- a/packages/effect/src/unstable/cli/Param.ts +++ b/packages/effect/src/unstable/cli/Param.ts @@ -10,16 +10,16 @@ * * @since 4.0.0 */ -import * as Option from "../../data/Option.ts" -import * as Predicate from "../../data/Predicate.ts" -import type * as Redacted from "../../data/Redacted.ts" -import * as Result from "../../data/Result.ts" import * as Effect from "../../Effect.ts" import type { LazyArg } from "../../Function.ts" import { dual, identity } from "../../Function.ts" import { type Pipeable, pipeArguments } from "../../interfaces/Pipeable.ts" +import * as Option from "../../Option.ts" import type * as FileSystem from "../../platform/FileSystem.ts" import type * as Path from "../../platform/Path.ts" +import * as Predicate from "../../Predicate.ts" +import type * as Redacted from "../../Redacted.ts" +import * as Result from "../../Result.ts" import * as Schema from "../../schema/Schema.ts" import type { Covariant } from "../../types/Types.ts" import * as CliError from "./CliError.ts" @@ -1323,7 +1323,7 @@ export const atLeast: { * * @example * ```ts - * import { Option } from "effect/data" + * import { Option } from "effect" * import * as Param from "effect/unstable/cli/Param" * // @internal - this module is not exported publicly * diff --git a/packages/effect/src/unstable/cli/Primitive.ts b/packages/effect/src/unstable/cli/Primitive.ts index 624fd8deb9..2ff6861ed4 100644 --- a/packages/effect/src/unstable/cli/Primitive.ts +++ b/packages/effect/src/unstable/cli/Primitive.ts @@ -15,15 +15,15 @@ import * as Ini from "ini" import * as Toml from "toml" import * as Yaml from "yaml" import * as Config from "../../Config.ts" -import { format } from "../../data/Formatter.ts" -import * as Redacted from "../../data/Redacted.ts" -import type * as Struct from "../../data/Struct.ts" import * as Effect from "../../Effect.ts" +import { format } from "../../Formatter.ts" import { identity } from "../../Function.ts" import * as FileSystem from "../../platform/FileSystem.ts" import * as Path from "../../platform/Path.ts" +import * as Redacted from "../../Redacted.ts" import type { Formatter } from "../../schema/Issue.ts" import * as Schema from "../../schema/Schema.ts" +import type * as Struct from "../../Struct.ts" import type { Covariant } from "../../types/Types.ts" const TypeId = "~effect/cli/Primitive" @@ -398,7 +398,7 @@ export const path = ( * @example * ```ts * import { Effect } from "effect" - * import { Redacted } from "effect/data" + * import { Redacted } from "effect" * import { Primitive } from "effect/unstable/cli" * * const parseRedacted = Effect.gen(function*() { diff --git a/packages/effect/src/unstable/cli/Prompt.ts b/packages/effect/src/unstable/cli/Prompt.ts index b7a86ba359..6574604065 100644 --- a/packages/effect/src/unstable/cli/Prompt.ts +++ b/packages/effect/src/unstable/cli/Prompt.ts @@ -3,20 +3,20 @@ */ import type { NoSuchElementError } from "../../Cause.ts" import * as Arr from "../../collections/Array.ts" -import * as Data from "../../data/Data.ts" -import * as Filter from "../../data/Filter.ts" -import * as Option from "../../data/Option.ts" -import * as Predicate from "../../data/Predicate.ts" -import * as Redacted from "../../data/Redacted.ts" +import * as Data from "../../Data.ts" import * as Effect from "../../Effect.ts" +import * as Filter from "../../Filter.ts" import { dual, pipe } from "../../Function.ts" import * as Pipeable from "../../interfaces/Pipeable.ts" import { YieldableProto } from "../../internal/core.ts" import * as EffectNumber from "../../Number.ts" +import * as Option from "../../Option.ts" import * as FileSystem from "../../platform/FileSystem.ts" import * as Path from "../../platform/Path.ts" import * as Terminal from "../../platform/Terminal.ts" +import * as Predicate from "../../Predicate.ts" import * as Queue from "../../Queue.ts" +import * as Redacted from "../../Redacted.ts" import type { Covariant } from "../../types/Types.ts" import * as Ansi from "./internal/ansi.ts" import type * as Primitive from "./Primitive.ts" diff --git a/packages/effect/src/unstable/cli/internal/builtInFlags.ts b/packages/effect/src/unstable/cli/internal/builtInFlags.ts index 0c9d3e161e..99453f86f4 100644 --- a/packages/effect/src/unstable/cli/internal/builtInFlags.ts +++ b/packages/effect/src/unstable/cli/internal/builtInFlags.ts @@ -4,8 +4,8 @@ * @internal */ -import * as Option from "../../../data/Option.ts" import type { LogLevel } from "../../../LogLevel.ts" +import * as Option from "../../../Option.ts" import * as Flag from "../Flag.ts" /** diff --git a/packages/effect/src/unstable/cli/internal/command.ts b/packages/effect/src/unstable/cli/internal/command.ts index c1a6d7eb33..73bf51a36c 100644 --- a/packages/effect/src/unstable/cli/internal/command.ts +++ b/packages/effect/src/unstable/cli/internal/command.ts @@ -5,10 +5,10 @@ * Internal implementation details for CLI commands. * Public API is in ../Command.ts */ -import * as Predicate from "../../../data/Predicate.ts" import * as Effect from "../../../Effect.ts" import { pipeArguments } from "../../../interfaces/Pipeable.ts" import { YieldableProto } from "../../../internal/core.ts" +import * as Predicate from "../../../Predicate.ts" import * as ServiceMap from "../../../ServiceMap.ts" import * as CliError from "../CliError.ts" import type { ArgDoc, FlagDoc, HelpDoc, SubcommandDoc } from "../HelpDoc.ts" diff --git a/packages/effect/src/unstable/cli/internal/config.ts b/packages/effect/src/unstable/cli/internal/config.ts index 05ebb36a09..34d3e77766 100644 --- a/packages/effect/src/unstable/cli/internal/config.ts +++ b/packages/effect/src/unstable/cli/internal/config.ts @@ -46,7 +46,7 @@ * 1. Flat iteration over all params for parsing/validation * 2. Reconstruction of original nested shape for handler input */ -import * as Predicate from "../../../data/Predicate.ts" +import * as Predicate from "../../../Predicate.ts" import * as Param from "../Param.ts" /* ========================================================================== */ diff --git a/packages/effect/src/unstable/cli/internal/parser.ts b/packages/effect/src/unstable/cli/internal/parser.ts index b4867689aa..1fa4bf3ca9 100644 --- a/packages/effect/src/unstable/cli/internal/parser.ts +++ b/packages/effect/src/unstable/cli/internal/parser.ts @@ -24,9 +24,9 @@ * - Only the first Value token can open a subcommand * - Errors accumulate rather than throwing exceptions */ -import * as Option from "../../../data/Option.ts" import * as Effect from "../../../Effect.ts" import type { LogLevel } from "../../../LogLevel.ts" +import * as Option from "../../../Option.ts" import type { FileSystem } from "../../../platform/FileSystem.ts" import type { Path } from "../../../platform/Path.ts" import * as CliError from "../CliError.ts" diff --git a/packages/effect/src/unstable/cluster/ClusterCron.ts b/packages/effect/src/unstable/cluster/ClusterCron.ts index 3c593febf9..771354c031 100644 --- a/packages/effect/src/unstable/cluster/ClusterCron.ts +++ b/packages/effect/src/unstable/cluster/ClusterCron.ts @@ -2,13 +2,13 @@ * @since 4.0.0 */ import * as Cron from "../../Cron.ts" -import * as Option from "../../data/Option.ts" import * as DateTime from "../../DateTime.ts" import * as Duration from "../../Duration.ts" import * as Effect from "../../Effect.ts" import * as Exit from "../../Exit.ts" import * as PrimaryKey from "../../interfaces/PrimaryKey.ts" import * as Layer from "../../Layer.ts" +import * as Option from "../../Option.ts" import * as Schedule from "../../Schedule.ts" import * as Schema from "../../schema/Schema.ts" import type { Scope } from "../../Scope.ts" diff --git a/packages/effect/src/unstable/cluster/ClusterError.ts b/packages/effect/src/unstable/cluster/ClusterError.ts index 09b6fba5e6..91da8cee7e 100644 --- a/packages/effect/src/unstable/cluster/ClusterError.ts +++ b/packages/effect/src/unstable/cluster/ClusterError.ts @@ -2,8 +2,8 @@ * @since 4.0.0 */ import * as Cause from "../../Cause.ts" -import { hasProperty, isTagged } from "../../data/Predicate.ts" import * as Effect from "../../Effect.ts" +import { hasProperty, isTagged } from "../../Predicate.ts" import * as Schema from "../../schema/Schema.ts" import { EntityAddress } from "./EntityAddress.ts" import { RunnerAddress } from "./RunnerAddress.ts" diff --git a/packages/effect/src/unstable/cluster/ClusterWorkflowEngine.ts b/packages/effect/src/unstable/cluster/ClusterWorkflowEngine.ts index b302feeb84..5dd1eb850f 100644 --- a/packages/effect/src/unstable/cluster/ClusterWorkflowEngine.ts +++ b/packages/effect/src/unstable/cluster/ClusterWorkflowEngine.ts @@ -1,7 +1,6 @@ /** * @since 4.0.0 */ -import type * as Record from "../../data/Record.ts" import * as DateTime from "../../DateTime.ts" import * as Duration from "../../Duration.ts" import * as Effect from "../../Effect.ts" @@ -10,6 +9,7 @@ import * as Fiber from "../../Fiber.ts" import * as PrimaryKey from "../../interfaces/PrimaryKey.ts" import * as Layer from "../../Layer.ts" import * as RcMap from "../../RcMap.ts" +import type * as Record from "../../Record.ts" import * as Schedule from "../../Schedule.ts" import * as Schema from "../../schema/Schema.ts" import type * as Scope from "../../Scope.ts" diff --git a/packages/effect/src/unstable/cluster/DeliverAt.ts b/packages/effect/src/unstable/cluster/DeliverAt.ts index 2990ced7d8..75bc783ee8 100644 --- a/packages/effect/src/unstable/cluster/DeliverAt.ts +++ b/packages/effect/src/unstable/cluster/DeliverAt.ts @@ -1,8 +1,8 @@ /** * @since 4.0.0 */ -import { hasProperty } from "../../data/Predicate.ts" import type { DateTime } from "../../DateTime.ts" +import { hasProperty } from "../../Predicate.ts" /** * @since 4.0.0 diff --git a/packages/effect/src/unstable/cluster/Entity.ts b/packages/effect/src/unstable/cluster/Entity.ts index a5123e0f0e..6c177eb4bc 100644 --- a/packages/effect/src/unstable/cluster/Entity.ts +++ b/packages/effect/src/unstable/cluster/Entity.ts @@ -3,9 +3,7 @@ */ import type * as Cause from "../../Cause.ts" import * as Arr from "../../collections/Array.ts" -import * as Data from "../../data/Data.ts" -import * as Predicate from "../../data/Predicate.ts" -import * as UndefinedOr from "../../data/UndefinedOr.ts" +import * as Data from "../../Data.ts" import type { DurationInput } from "../../Duration.ts" import * as Effect from "../../Effect.ts" import * as Exit from "../../Exit.ts" @@ -13,11 +11,13 @@ import { identity } from "../../Function.ts" import * as Equal from "../../interfaces/Equal.ts" import * as Hash from "../../interfaces/Hash.ts" import * as Layer from "../../Layer.ts" +import * as Predicate from "../../Predicate.ts" import * as Queue from "../../Queue.ts" import type * as Schedule from "../../Schedule.ts" import { Scope } from "../../Scope.ts" import * as ServiceMap from "../../ServiceMap.ts" import type * as Stream from "../../Stream.ts" +import * as UndefinedOr from "../../UndefinedOr.ts" import * as Headers from "../http/Headers.ts" import * as Rpc from "../rpc/Rpc.ts" import * as RpcClient from "../rpc/RpcClient.ts" diff --git a/packages/effect/src/unstable/cluster/Envelope.ts b/packages/effect/src/unstable/cluster/Envelope.ts index 7e30330525..ef3cb40095 100644 --- a/packages/effect/src/unstable/cluster/Envelope.ts +++ b/packages/effect/src/unstable/cluster/Envelope.ts @@ -1,9 +1,9 @@ /** * @since 4.0.0 */ -import * as Predicate from "../../data/Predicate.ts" -import type { ReadonlyRecord } from "../../data/Record.ts" import * as PrimaryKey from "../../interfaces/PrimaryKey.ts" +import * as Predicate from "../../Predicate.ts" +import type { ReadonlyRecord } from "../../Record.ts" import * as Schema from "../../schema/Schema.ts" import * as Transformation from "../../schema/Transformation.ts" import * as Headers from "../http/Headers.ts" diff --git a/packages/effect/src/unstable/cluster/K8sHttpClient.ts b/packages/effect/src/unstable/cluster/K8sHttpClient.ts index 834cc84b66..34777d69f4 100644 --- a/packages/effect/src/unstable/cluster/K8sHttpClient.ts +++ b/packages/effect/src/unstable/cluster/K8sHttpClient.ts @@ -2,11 +2,11 @@ * @since 4.0.0 */ import type * as v1 from "kubernetes-types/core/v1.d.ts" -import * as Filter from "../../data/Filter.ts" -import * as Option from "../../data/Option.ts" import * as Effect from "../../Effect.ts" +import * as Filter from "../../Filter.ts" import { identity } from "../../Function.ts" import * as Layer from "../../Layer.ts" +import * as Option from "../../Option.ts" import * as FileSystem from "../../platform/FileSystem.ts" import * as Schedule from "../../Schedule.ts" import * as Schema from "../../schema/Schema.ts" diff --git a/packages/effect/src/unstable/cluster/Message.ts b/packages/effect/src/unstable/cluster/Message.ts index d8ee02e056..2814cadc20 100644 --- a/packages/effect/src/unstable/cluster/Message.ts +++ b/packages/effect/src/unstable/cluster/Message.ts @@ -1,7 +1,7 @@ /** * @since 4.0.0 */ -import * as Data from "../../data/Data.ts" +import * as Data from "../../Data.ts" import * as Effect from "../../Effect.ts" import * as Schema from "../../schema/Schema.ts" import type { ServiceMap } from "../../ServiceMap.ts" diff --git a/packages/effect/src/unstable/cluster/MessageStorage.ts b/packages/effect/src/unstable/cluster/MessageStorage.ts index 471a511f48..6127569ddd 100644 --- a/packages/effect/src/unstable/cluster/MessageStorage.ts +++ b/packages/effect/src/unstable/cluster/MessageStorage.ts @@ -3,15 +3,15 @@ */ import { Clock } from "../../Clock.ts" import * as Arr from "../../collections/Array.ts" -import * as Data from "../../data/Data.ts" -import type * as Option from "../../data/Option.ts" -import type { Predicate } from "../../data/Predicate.ts" -import * as UndefinedOr from "../../data/UndefinedOr.ts" +import * as Data from "../../Data.ts" import * as Effect from "../../Effect.ts" import * as Exit from "../../Exit.ts" import * as Layer from "../../Layer.ts" +import type * as Option from "../../Option.ts" +import type { Predicate } from "../../Predicate.ts" import * as Schema from "../../schema/Schema.ts" import * as ServiceMap from "../../ServiceMap.ts" +import * as UndefinedOr from "../../UndefinedOr.ts" import type * as Rpc from "../rpc/Rpc.ts" import { EntityNotAssignedToRunner, type PersistenceError } from "./ClusterError.ts" import { MalformedMessage } from "./ClusterError.ts" diff --git a/packages/effect/src/unstable/cluster/Reply.ts b/packages/effect/src/unstable/cluster/Reply.ts index 9802aef5d3..03b121de98 100644 --- a/packages/effect/src/unstable/cluster/Reply.ts +++ b/packages/effect/src/unstable/cluster/Reply.ts @@ -2,11 +2,11 @@ * @since 4.0.0 */ import type { NonEmptyReadonlyArray } from "../../collections/Array.ts" -import * as Data from "../../data/Data.ts" -import * as Option from "../../data/Option.ts" -import { hasProperty } from "../../data/Predicate.ts" +import * as Data from "../../Data.ts" import * as Effect from "../../Effect.ts" import * as Exit from "../../Exit.ts" +import * as Option from "../../Option.ts" +import { hasProperty } from "../../Predicate.ts" import * as Issue from "../../schema/Issue.ts" import * as Parser from "../../schema/Parser.ts" import * as Schema from "../../schema/Schema.ts" diff --git a/packages/effect/src/unstable/cluster/Sharding.ts b/packages/effect/src/unstable/cluster/Sharding.ts index 8150a7b840..3c15f7e490 100644 --- a/packages/effect/src/unstable/cluster/Sharding.ts +++ b/packages/effect/src/unstable/cluster/Sharding.ts @@ -7,18 +7,18 @@ import * as Arr from "../../collections/Array.ts" import * as HashRing from "../../collections/HashRing.ts" import * as MutableHashMap from "../../collections/MutableHashMap.ts" import * as MutableHashSet from "../../collections/MutableHashSet.ts" -import * as Filter from "../../data/Filter.ts" -import * as Option from "../../data/Option.ts" import type { DurationInput } from "../../Duration.ts" import * as Duration from "../../Duration.ts" import * as Effect from "../../Effect.ts" import type * as Exit from "../../Exit.ts" import * as Fiber from "../../Fiber.ts" import * as FiberMap from "../../FiberMap.ts" +import * as Filter from "../../Filter.ts" import { constant, flow } from "../../Function.ts" import * as Equal from "../../interfaces/Equal.ts" import * as Layer from "../../Layer.ts" import * as MutableRef from "../../MutableRef.ts" +import * as Option from "../../Option.ts" import * as PubSub from "../../PubSub.ts" import { CurrentLogAnnotations } from "../../References.ts" import * as Schedule from "../../Schedule.ts" diff --git a/packages/effect/src/unstable/cluster/ShardingConfig.ts b/packages/effect/src/unstable/cluster/ShardingConfig.ts index 477d193f04..734cfdcb81 100644 --- a/packages/effect/src/unstable/cluster/ShardingConfig.ts +++ b/packages/effect/src/unstable/cluster/ShardingConfig.ts @@ -3,11 +3,11 @@ */ import * as Config from "../../Config.ts" import * as ConfigProvider from "../../ConfigProvider.ts" -import * as Option from "../../data/Option.ts" import type { DurationInput } from "../../Duration.ts" import * as Duration from "../../Duration.ts" import * as Effect from "../../Effect.ts" import * as Layer from "../../Layer.ts" +import * as Option from "../../Option.ts" import * as Schema from "../../schema/Schema.ts" import * as ServiceMap from "../../ServiceMap.ts" import { RunnerAddress } from "./RunnerAddress.ts" diff --git a/packages/effect/src/unstable/cluster/ShardingRegistrationEvent.ts b/packages/effect/src/unstable/cluster/ShardingRegistrationEvent.ts index 0151f25df1..ad5265c22d 100644 --- a/packages/effect/src/unstable/cluster/ShardingRegistrationEvent.ts +++ b/packages/effect/src/unstable/cluster/ShardingRegistrationEvent.ts @@ -1,7 +1,7 @@ /** * @since 4.0.0 */ -import * as Data from "../../data/Data.ts" +import * as Data from "../../Data.ts" import type { Entity } from "./Entity.ts" import type { SingletonAddress } from "./SingletonAddress.ts" diff --git a/packages/effect/src/unstable/cluster/Snowflake.ts b/packages/effect/src/unstable/cluster/Snowflake.ts index c9491be796..22107c8ea2 100644 --- a/packages/effect/src/unstable/cluster/Snowflake.ts +++ b/packages/effect/src/unstable/cluster/Snowflake.ts @@ -1,8 +1,8 @@ /** * @since 4.0.0 */ +import type * as Brand from "../../Brand.ts" import { Clock } from "../../Clock.ts" -import type * as Brand from "../../data/Brand.ts" import * as DateTime from "../../DateTime.ts" import * as Effect from "../../Effect.ts" import { identity } from "../../Function.ts" diff --git a/packages/effect/src/unstable/cluster/SqlMessageStorage.ts b/packages/effect/src/unstable/cluster/SqlMessageStorage.ts index b6bed0ceaa..5f1b58e159 100644 --- a/packages/effect/src/unstable/cluster/SqlMessageStorage.ts +++ b/packages/effect/src/unstable/cluster/SqlMessageStorage.ts @@ -2,10 +2,10 @@ * @since 4.0.0 */ import * as Arr from "../../collections/Array.ts" -import * as UndefinedOr from "../../data/UndefinedOr.ts" import * as Effect from "../../Effect.ts" import * as Layer from "../../Layer.ts" import * as Schedule from "../../Schedule.ts" +import * as UndefinedOr from "../../UndefinedOr.ts" import * as Migrator from "../sql/Migrator.ts" import * as SqlClient from "../sql/SqlClient.ts" import type { Row } from "../sql/SqlConnection.ts" diff --git a/packages/effect/src/unstable/cluster/internal/entityManager.ts b/packages/effect/src/unstable/cluster/internal/entityManager.ts index b6f2d3f9f5..3e54a12194 100644 --- a/packages/effect/src/unstable/cluster/internal/entityManager.ts +++ b/packages/effect/src/unstable/cluster/internal/entityManager.ts @@ -1,8 +1,6 @@ import * as Cause from "../../../Cause.ts" import { Clock } from "../../../Clock.ts" import * as Arr from "../../../collections/Array.ts" -import * as Option from "../../../data/Option.ts" -import * as UndefinedOr from "../../../data/UndefinedOr.ts" import * as Duration from "../../../Duration.ts" import type { DurationInput } from "../../../Duration.ts" import * as Effect from "../../../Effect.ts" @@ -11,12 +9,14 @@ import * as Fiber from "../../../Fiber.ts" import { identity } from "../../../Function.ts" import * as Equal from "../../../interfaces/Equal.ts" import * as Metric from "../../../Metric.ts" +import * as Option from "../../../Option.ts" import { CurrentLogAnnotations } from "../../../References.ts" import * as Schedule from "../../../Schedule.ts" import * as Issue from "../../../schema/Issue.ts" import * as Schema from "../../../schema/Schema.ts" import * as Scope from "../../../Scope.ts" import * as ServiceMap from "../../../ServiceMap.ts" +import * as UndefinedOr from "../../../UndefinedOr.ts" import type * as Rpc from "../../rpc/Rpc.ts" import { RequestId } from "../../rpc/RpcMessage.ts" import * as RpcServer from "../../rpc/RpcServer.ts" diff --git a/packages/effect/src/unstable/cluster/internal/resourceMap.ts b/packages/effect/src/unstable/cluster/internal/resourceMap.ts index 0f34963695..914a6eadf2 100644 --- a/packages/effect/src/unstable/cluster/internal/resourceMap.ts +++ b/packages/effect/src/unstable/cluster/internal/resourceMap.ts @@ -1,9 +1,9 @@ import * as MutableHashMap from "../../../collections/MutableHashMap.ts" -import * as Option from "../../../data/Option.ts" import * as Deferred from "../../../Deferred.ts" import * as Effect from "../../../Effect.ts" import * as Exit from "../../../Exit.ts" import * as MutableRef from "../../../MutableRef.ts" +import * as Option from "../../../Option.ts" import * as Scope from "../../../Scope.ts" import * as ServiceMap from "../../../ServiceMap.ts" diff --git a/packages/effect/src/unstable/cluster/internal/resourceRef.ts b/packages/effect/src/unstable/cluster/internal/resourceRef.ts index 22e47b448b..987d166d4e 100644 --- a/packages/effect/src/unstable/cluster/internal/resourceRef.ts +++ b/packages/effect/src/unstable/cluster/internal/resourceRef.ts @@ -1,7 +1,7 @@ -import * as Option from "../../../data/Option.ts" import * as Effect from "../../../Effect.ts" import * as Exit from "../../../Exit.ts" import * as MutableRef from "../../../MutableRef.ts" +import * as Option from "../../../Option.ts" import * as Scope from "../../../Scope.ts" import { internalInterruptors } from "./interruptors.ts" diff --git a/packages/effect/src/unstable/encoding/Msgpack.ts b/packages/effect/src/unstable/encoding/Msgpack.ts index 2f58d37998..269e4a8751 100644 --- a/packages/effect/src/unstable/encoding/Msgpack.ts +++ b/packages/effect/src/unstable/encoding/Msgpack.ts @@ -6,11 +6,11 @@ import * as Msgpackr from "msgpackr" import * as Channel from "../../Channel.ts" import * as ChannelSchema from "../../ChannelSchema.ts" import * as Arr from "../../collections/Array.ts" -import * as Data from "../../data/Data.ts" -import * as Option from "../../data/Option.ts" -import * as Predicate from "../../data/Predicate.ts" +import * as Data from "../../Data.ts" import * as Effect from "../../Effect.ts" import { dual } from "../../Function.ts" +import * as Option from "../../Option.ts" +import * as Predicate from "../../Predicate.ts" import type * as Pull from "../../Pull.ts" import * as Issue from "../../schema/Issue.ts" import * as Schema from "../../schema/Schema.ts" diff --git a/packages/effect/src/unstable/encoding/Ndjson.ts b/packages/effect/src/unstable/encoding/Ndjson.ts index 38e5d76e0d..074ca4e8d6 100644 --- a/packages/effect/src/unstable/encoding/Ndjson.ts +++ b/packages/effect/src/unstable/encoding/Ndjson.ts @@ -4,9 +4,9 @@ import * as Channel from "../../Channel.ts" import * as ChannelSchema from "../../ChannelSchema.ts" import * as Arr from "../../collections/Array.ts" -import * as Data from "../../data/Data.ts" -import * as Filter from "../../data/Filter.ts" +import * as Data from "../../Data.ts" import * as Effect from "../../Effect.ts" +import * as Filter from "../../Filter.ts" import { dual, identity } from "../../Function.ts" import type * as Schema from "../../schema/Schema.ts" diff --git a/packages/effect/src/unstable/encoding/Sse.ts b/packages/effect/src/unstable/encoding/Sse.ts index 5754226bf8..54f9f7ce46 100644 --- a/packages/effect/src/unstable/encoding/Sse.ts +++ b/packages/effect/src/unstable/encoding/Sse.ts @@ -5,11 +5,11 @@ import * as Channel from "../../Channel.ts" import * as ChannelSchema from "../../ChannelSchema.ts" import type { NonEmptyReadonlyArray } from "../../collections/Array.ts" import * as Arr from "../../collections/Array.ts" -import * as Data from "../../data/Data.ts" -import * as Filter from "../../data/Filter.ts" -import { hasProperty } from "../../data/Predicate.ts" +import * as Data from "../../Data.ts" import * as Duration from "../../Duration.ts" import * as Effect from "../../Effect.ts" +import * as Filter from "../../Filter.ts" +import { hasProperty } from "../../Predicate.ts" import * as Pull from "../../Pull.ts" import * as Schema from "../../schema/Schema.ts" import * as Transformation from "../../schema/Transformation.ts" diff --git a/packages/effect/src/unstable/http/Cookies.ts b/packages/effect/src/unstable/http/Cookies.ts index c40aa78b1c..b2e45269c5 100644 --- a/packages/effect/src/unstable/http/Cookies.ts +++ b/packages/effect/src/unstable/http/Cookies.ts @@ -1,14 +1,14 @@ /** * @since 4.0.0 */ -import * as Data from "../../data/Data.ts" -import * as Predicate from "../../data/Predicate.ts" -import * as Record from "../../data/Record.ts" -import * as Result from "../../data/Result.ts" +import * as Data from "../../Data.ts" import * as Duration from "../../Duration.ts" import { dual } from "../../Function.ts" import * as Inspectable from "../../interfaces/Inspectable.ts" import { type Pipeable, pipeArguments } from "../../interfaces/Pipeable.ts" +import * as Predicate from "../../Predicate.ts" +import * as Record from "../../Record.ts" +import * as Result from "../../Result.ts" import * as Schema from "../../schema/Schema.ts" import * as Transformation from "../../schema/Transformation.ts" import type * as Types from "../../types/Types.ts" diff --git a/packages/effect/src/unstable/http/Headers.ts b/packages/effect/src/unstable/http/Headers.ts index 67fe262e51..8e47b1864f 100644 --- a/packages/effect/src/unstable/http/Headers.ts +++ b/packages/effect/src/unstable/http/Headers.ts @@ -1,15 +1,15 @@ /** * @since 4.0.0 */ -import * as Equivalence_ from "../../data/Equivalence.ts" -import * as Predicate from "../../data/Predicate.ts" -import * as Record from "../../data/Record.ts" -import * as Redacted from "../../data/Redacted.ts" +import * as Equivalence_ from "../../Equivalence.ts" import { dual } from "../../Function.ts" import * as Equal from "../../interfaces/Equal.ts" import * as Hash from "../../interfaces/Hash.ts" import * as Inspectable from "../../interfaces/Inspectable.ts" import * as Redactable from "../../interfaces/Redactable.ts" +import * as Predicate from "../../Predicate.ts" +import * as Record from "../../Record.ts" +import * as Redacted from "../../Redacted.ts" import * as Schema from "../../schema/Schema.ts" import * as Transformation from "../../schema/Transformation.ts" import * as ServiceMap from "../../ServiceMap.ts" diff --git a/packages/effect/src/unstable/http/HttpBody.ts b/packages/effect/src/unstable/http/HttpBody.ts index 8015b6a09e..1c05b056fb 100644 --- a/packages/effect/src/unstable/http/HttpBody.ts +++ b/packages/effect/src/unstable/http/HttpBody.ts @@ -1,13 +1,13 @@ /** * @since 4.0.0 */ -import * as Data from "../../data/Data.ts" -import { format } from "../../data/Formatter.ts" -import * as Predicate from "../../data/Predicate.ts" +import * as Data from "../../Data.ts" import * as Effect from "../../Effect.ts" +import { format } from "../../Formatter.ts" import * as Inspectable from "../../interfaces/Inspectable.ts" import * as FileSystem from "../../platform/FileSystem.ts" import type * as PlatformError from "../../platform/PlatformError.ts" +import * as Predicate from "../../Predicate.ts" import type { ParseOptions } from "../../schema/AST.ts" import type { Issue } from "../../schema/Issue.ts" import * as Parser from "../../schema/Parser.ts" diff --git a/packages/effect/src/unstable/http/HttpClient.ts b/packages/effect/src/unstable/http/HttpClient.ts index 8ea2f314e9..97661e9d78 100644 --- a/packages/effect/src/unstable/http/HttpClient.ts +++ b/packages/effect/src/unstable/http/HttpClient.ts @@ -3,17 +3,17 @@ */ import * as Cause from "../../Cause.ts" import type { NonEmptyReadonlyArray } from "../../collections/Array.ts" -import type * as Filter from "../../data/Filter.ts" -import * as Predicate from "../../data/Predicate.ts" -import * as Result from "../../data/Result.ts" import * as Effect from "../../Effect.ts" import * as Exit from "../../Exit.ts" import type { Fiber } from "../../Fiber.ts" +import type * as Filter from "../../Filter.ts" import { constFalse, constTrue, dual } from "../../Function.ts" import * as Inspectable from "../../interfaces/Inspectable.ts" import { type Pipeable, pipeArguments } from "../../interfaces/Pipeable.ts" import * as Layer from "../../Layer.ts" +import * as Predicate from "../../Predicate.ts" import * as Ref from "../../Ref.ts" +import * as Result from "../../Result.ts" import * as Schedule from "../../Schedule.ts" import type * as Scope from "../../Scope.ts" import * as ServiceMap from "../../ServiceMap.ts" diff --git a/packages/effect/src/unstable/http/HttpClientError.ts b/packages/effect/src/unstable/http/HttpClientError.ts index 21a026240b..982d679817 100644 --- a/packages/effect/src/unstable/http/HttpClientError.ts +++ b/packages/effect/src/unstable/http/HttpClientError.ts @@ -1,8 +1,8 @@ /** * @since 4.0.0 */ -import * as Data from "../../data/Data.ts" -import { hasProperty } from "../../data/Predicate.ts" +import * as Data from "../../Data.ts" +import { hasProperty } from "../../Predicate.ts" import type * as HttpClientRequest from "./HttpClientRequest.ts" import type * as ClientResponse from "./HttpClientResponse.ts" diff --git a/packages/effect/src/unstable/http/HttpClientRequest.ts b/packages/effect/src/unstable/http/HttpClientRequest.ts index e08419d93c..5027aeb1ab 100644 --- a/packages/effect/src/unstable/http/HttpClientRequest.ts +++ b/packages/effect/src/unstable/http/HttpClientRequest.ts @@ -1,9 +1,6 @@ /** * @since 4.0.0 */ -import { hasProperty } from "../../data/Predicate.ts" -import * as Redacted from "../../data/Redacted.ts" -import * as Result from "../../data/Result.ts" import * as Effect from "../../Effect.ts" import { dual } from "../../Function.ts" import * as Inspectable from "../../interfaces/Inspectable.ts" @@ -11,6 +8,9 @@ import { type Pipeable, pipeArguments } from "../../interfaces/Pipeable.ts" import { redact } from "../../interfaces/Redactable.ts" import type * as FileSystem from "../../platform/FileSystem.ts" import type * as PlatformError from "../../platform/PlatformError.ts" +import { hasProperty } from "../../Predicate.ts" +import * as Redacted from "../../Redacted.ts" +import * as Result from "../../Result.ts" import type { ParseOptions } from "../../schema/AST.ts" import type * as Schema from "../../schema/Schema.ts" import type * as Stream from "../../Stream.ts" diff --git a/packages/effect/src/unstable/http/HttpEffect.ts b/packages/effect/src/unstable/http/HttpEffect.ts index 2002682961..5a7ac12e4a 100644 --- a/packages/effect/src/unstable/http/HttpEffect.ts +++ b/packages/effect/src/unstable/http/HttpEffect.ts @@ -2,7 +2,6 @@ * @since 4.0.0 */ import type { Cause } from "../../Cause.ts" -import * as UndefinedOr from "../../data/UndefinedOr.ts" import * as Effect from "../../Effect.ts" import * as Exit from "../../Exit.ts" import * as Fiber from "../../Fiber.ts" @@ -12,6 +11,7 @@ import * as Layer from "../../Layer.ts" import * as Scope from "../../Scope.ts" import * as ServiceMap from "../../ServiceMap.ts" import * as Stream from "../../Stream.ts" +import * as UndefinedOr from "../../UndefinedOr.ts" import * as HttpBody from "./HttpBody.ts" import { type HttpMiddleware, tracer } from "./HttpMiddleware.ts" import { causeResponse, clientAbortFiberId, RequestError } from "./HttpServerError.ts" diff --git a/packages/effect/src/unstable/http/HttpIncomingMessage.ts b/packages/effect/src/unstable/http/HttpIncomingMessage.ts index 1235ab517a..b7468b4196 100644 --- a/packages/effect/src/unstable/http/HttpIncomingMessage.ts +++ b/packages/effect/src/unstable/http/HttpIncomingMessage.ts @@ -1,11 +1,11 @@ /** * @since 4.0.0 */ -import { hasProperty } from "../../data/Predicate.ts" import * as Effect from "../../Effect.ts" import type * as Inspectable from "../../interfaces/Inspectable.ts" import { redact } from "../../interfaces/Redactable.ts" import type * as FileSystem from "../../platform/FileSystem.ts" +import { hasProperty } from "../../Predicate.ts" import type { ParseOptions } from "../../schema/AST.ts" import * as Schema from "../../schema/Schema.ts" import * as ServiceMap from "../../ServiceMap.ts" diff --git a/packages/effect/src/unstable/http/HttpMiddleware.ts b/packages/effect/src/unstable/http/HttpMiddleware.ts index c35971a858..95ca810606 100644 --- a/packages/effect/src/unstable/http/HttpMiddleware.ts +++ b/packages/effect/src/unstable/http/HttpMiddleware.ts @@ -2,12 +2,12 @@ * @since 4.0.0 */ import { Clock } from "../../Clock.ts" -import type { Predicate } from "../../data/Predicate.ts" -import type { ReadonlyRecord } from "../../data/Record.ts" import * as Effect from "../../Effect.ts" import { constant, constFalse } from "../../Function.ts" import * as internalEffect from "../../internal/effect.ts" import * as Layer from "../../Layer.ts" +import type { Predicate } from "../../Predicate.ts" +import type { ReadonlyRecord } from "../../Record.ts" import { TracerEnabled } from "../../References.ts" import * as ServiceMap from "../../ServiceMap.ts" import { ParentSpan } from "../../Tracer.ts" diff --git a/packages/effect/src/unstable/http/HttpRouter.ts b/packages/effect/src/unstable/http/HttpRouter.ts index 4e87410c9a..5653d3dd1b 100644 --- a/packages/effect/src/unstable/http/HttpRouter.ts +++ b/packages/effect/src/unstable/http/HttpRouter.ts @@ -2,17 +2,17 @@ * @since 4.0.0 */ import * as Arr from "../../collections/Array.ts" -import type { ReadonlyRecord } from "../../data/Record.ts" -import * as UndefinedOr from "../../data/UndefinedOr.ts" import * as Effect from "../../Effect.ts" import { compose, dual, identity } from "../../Function.ts" import * as Layer from "../../Layer.ts" +import type { ReadonlyRecord } from "../../Record.ts" import type { ParseOptions } from "../../schema/AST.ts" import * as Schema from "../../schema/Schema.ts" import * as Scope from "../../Scope.ts" import * as ServiceMap from "../../ServiceMap.ts" import * as Tracer from "../../Tracer.ts" import type * as Types from "../../types/Types.ts" +import * as UndefinedOr from "../../UndefinedOr.ts" import * as FindMyWay from "./FindMyWay.ts" import * as HttpEffect from "./HttpEffect.ts" import type * as HttpMethod from "./HttpMethod.ts" diff --git a/packages/effect/src/unstable/http/HttpServerError.ts b/packages/effect/src/unstable/http/HttpServerError.ts index c26f14bdeb..8fb365850e 100644 --- a/packages/effect/src/unstable/http/HttpServerError.ts +++ b/packages/effect/src/unstable/http/HttpServerError.ts @@ -2,10 +2,10 @@ * @since 4.0.0 */ import * as Cause from "../../Cause.ts" -import * as Data from "../../data/Data.ts" -import { hasProperty } from "../../data/Predicate.ts" +import * as Data from "../../Data.ts" import * as Effect from "../../Effect.ts" import type * as Exit from "../../Exit.ts" +import { hasProperty } from "../../Predicate.ts" import type * as Request from "./HttpServerRequest.ts" import * as Respondable from "./HttpServerRespondable.ts" import * as Response from "./HttpServerResponse.ts" diff --git a/packages/effect/src/unstable/http/HttpServerRequest.ts b/packages/effect/src/unstable/http/HttpServerRequest.ts index 7f03e26323..d583e8d0aa 100644 --- a/packages/effect/src/unstable/http/HttpServerRequest.ts +++ b/packages/effect/src/unstable/http/HttpServerRequest.ts @@ -3,12 +3,12 @@ */ import * as Channel from "../../Channel.ts" import type * as Arr from "../../collections/Array.ts" -import type { ReadonlyRecord } from "../../data/Record.ts" -import * as Result from "../../data/Result.ts" import * as Effect from "../../Effect.ts" import * as Inspectable from "../../interfaces/Inspectable.ts" import type * as FileSystem from "../../platform/FileSystem.ts" import type * as Path from "../../platform/Path.ts" +import type { ReadonlyRecord } from "../../Record.ts" +import * as Result from "../../Result.ts" import type { ParseOptions } from "../../schema/AST.ts" import * as Schema from "../../schema/Schema.ts" import type * as Scope from "../../Scope.ts" diff --git a/packages/effect/src/unstable/http/HttpServerRespondable.ts b/packages/effect/src/unstable/http/HttpServerRespondable.ts index 14e62d0693..ee6f652090 100644 --- a/packages/effect/src/unstable/http/HttpServerRespondable.ts +++ b/packages/effect/src/unstable/http/HttpServerRespondable.ts @@ -2,8 +2,8 @@ * @since 4.0.0 */ import * as Cause from "../../Cause.ts" -import { hasProperty } from "../../data/Predicate.ts" import * as Effect from "../../Effect.ts" +import { hasProperty } from "../../Predicate.ts" import * as Schema from "../../schema/Schema.ts" import type { HttpServerResponse } from "./HttpServerResponse.ts" import * as Response from "./HttpServerResponse.ts" diff --git a/packages/effect/src/unstable/http/HttpServerResponse.ts b/packages/effect/src/unstable/http/HttpServerResponse.ts index 56b06e08cc..2b0acf86d1 100644 --- a/packages/effect/src/unstable/http/HttpServerResponse.ts +++ b/packages/effect/src/unstable/http/HttpServerResponse.ts @@ -1,7 +1,6 @@ /** * @since 4.0.0 */ -import { hasProperty } from "../../data/Predicate.ts" import * as Effect from "../../Effect.ts" import { dual } from "../../Function.ts" import type * as Inspectable from "../../interfaces/Inspectable.ts" @@ -10,6 +9,7 @@ import { redact } from "../../interfaces/Redactable.ts" import { PipeInspectableProto } from "../../internal/core.ts" import type * as FileSystem from "../../platform/FileSystem.ts" import type { PlatformError } from "../../platform/PlatformError.ts" +import { hasProperty } from "../../Predicate.ts" import type { ParseOptions } from "../../schema/AST.ts" import type * as Schema from "../../schema/Schema.ts" import * as ServiceMap from "../../ServiceMap.ts" diff --git a/packages/effect/src/unstable/http/Multipart.ts b/packages/effect/src/unstable/http/Multipart.ts index 5e6d603f51..c05a18d739 100644 --- a/packages/effect/src/unstable/http/Multipart.ts +++ b/packages/effect/src/unstable/http/Multipart.ts @@ -3,15 +3,14 @@ */ import * as Channel from "../../Channel.ts" import * as Arr from "../../collections/Array.ts" -import * as Option from "../../data/Option.ts" -import * as Predicate from "../../data/Predicate.ts" -import * as UndefinedOr from "../../data/UndefinedOr.ts" import * as Effect from "../../Effect.ts" import * as Exit from "../../Exit.ts" import { constant, dual } from "../../Function.ts" import * as Inspectable from "../../interfaces/Inspectable.ts" +import * as Option from "../../Option.ts" import * as FileSystem from "../../platform/FileSystem.ts" import * as Path from "../../platform/Path.ts" +import * as Predicate from "../../Predicate.ts" import * as Pull from "../../Pull.ts" import type { ParseOptions } from "../../schema/AST.ts" import * as Schema from "../../schema/Schema.ts" @@ -19,6 +18,7 @@ import * as Transformation from "../../schema/Transformation.ts" import type * as Scope from "../../Scope.ts" import * as ServiceMap from "../../ServiceMap.ts" import * as Stream from "../../Stream.ts" +import * as UndefinedOr from "../../UndefinedOr.ts" import * as IncomingMessage from "./HttpIncomingMessage.ts" import * as MP from "./Multipasta.ts" diff --git a/packages/effect/src/unstable/http/Template.ts b/packages/effect/src/unstable/http/Template.ts index 8f6bfed882..5b75a73e17 100644 --- a/packages/effect/src/unstable/http/Template.ts +++ b/packages/effect/src/unstable/http/Template.ts @@ -1,9 +1,9 @@ /** * @since 4.0.0 */ -import * as Option from "../../data/Option.ts" import * as Effect from "../../Effect.ts" import * as Exit from "../../Exit.ts" +import * as Option from "../../Option.ts" import * as Stream from "../../Stream.ts" /** diff --git a/packages/effect/src/unstable/http/UrlParams.ts b/packages/effect/src/unstable/http/UrlParams.ts index 6d6dbaca30..2b0dee8af7 100644 --- a/packages/effect/src/unstable/http/UrlParams.ts +++ b/packages/effect/src/unstable/http/UrlParams.ts @@ -2,24 +2,24 @@ * @since 4.0.0 */ import * as Arr from "../../collections/Array.ts" -import * as Data from "../../data/Data.ts" -import * as Equivalence_ from "../../data/Equivalence.ts" -import * as Option from "../../data/Option.ts" -import { hasProperty } from "../../data/Predicate.ts" -import type { ReadonlyRecord } from "../../data/Record.ts" -import * as Result from "../../data/Result.ts" -import * as Tuple from "../../data/Tuple.ts" -import * as UndefinedOr from "../../data/UndefinedOr.ts" +import * as Data from "../../Data.ts" import * as Effect from "../../Effect.ts" +import * as Equivalence_ from "../../Equivalence.ts" import { dual } from "../../Function.ts" import * as Equal from "../../interfaces/Equal.ts" import * as Hash from "../../interfaces/Hash.ts" import { type Inspectable } from "../../interfaces/Inspectable.ts" import type { Pipeable } from "../../interfaces/Pipeable.ts" import { PipeInspectableProto } from "../../internal/core.ts" +import * as Option from "../../Option.ts" +import { hasProperty } from "../../Predicate.ts" +import type { ReadonlyRecord } from "../../Record.ts" +import * as Result from "../../Result.ts" import * as Issue from "../../schema/Issue.ts" import * as Schema from "../../schema/Schema.ts" import * as Transformation from "../../schema/Transformation.ts" +import * as Tuple from "../../Tuple.ts" +import * as UndefinedOr from "../../UndefinedOr.ts" const TypeId = "~effect/http/UrlParams" diff --git a/packages/effect/src/unstable/httpapi/HttpApi.ts b/packages/effect/src/unstable/httpapi/HttpApi.ts index 9b1c9bb744..c0da740481 100644 --- a/packages/effect/src/unstable/httpapi/HttpApi.ts +++ b/packages/effect/src/unstable/httpapi/HttpApi.ts @@ -2,15 +2,15 @@ * @since 4.0.0 */ import type { NonEmptyReadonlyArray } from "../../collections/Array.ts" -import * as Predicate from "../../data/Predicate.ts" -import * as Record from "../../data/Record.ts" -import * as UndefinedOr from "../../data/UndefinedOr.ts" import { type Pipeable, pipeArguments } from "../../interfaces/Pipeable.ts" +import * as Predicate from "../../Predicate.ts" +import * as Record from "../../Record.ts" import * as Annotations from "../../schema/Annotations.ts" import * as AST from "../../schema/AST.ts" import type * as Schema from "../../schema/Schema.ts" import * as ServiceMap from "../../ServiceMap.ts" import type { Mutable } from "../../types/Types.ts" +import * as UndefinedOr from "../../UndefinedOr.ts" import type { PathInput } from "../http/HttpRouter.ts" import type * as HttpApiEndpoint from "./HttpApiEndpoint.ts" import type * as HttpApiGroup from "./HttpApiGroup.ts" diff --git a/packages/effect/src/unstable/httpapi/HttpApiBuilder.ts b/packages/effect/src/unstable/httpapi/HttpApiBuilder.ts index 3aecf68ddf..709fcd975a 100644 --- a/packages/effect/src/unstable/httpapi/HttpApiBuilder.ts +++ b/packages/effect/src/unstable/httpapi/HttpApiBuilder.ts @@ -2,20 +2,19 @@ * @since 4.0.0 */ import * as Cause from "../../Cause.ts" -import * as Filter from "../../data/Filter.ts" -import * as Option from "../../data/Option.ts" -import type { ReadonlyRecord } from "../../data/Record.ts" -import * as Redacted from "../../data/Redacted.ts" -import * as Result from "../../data/Result.ts" -import * as UndefinedOr from "../../data/UndefinedOr.ts" import * as Effect from "../../Effect.ts" import * as Base64 from "../../encoding/Base64.ts" import * as Fiber from "../../Fiber.ts" +import * as Filter from "../../Filter.ts" import { identity } from "../../Function.ts" import { type Pipeable, pipeArguments } from "../../interfaces/Pipeable.ts" import * as Layer from "../../Layer.ts" +import * as Option from "../../Option.ts" import type { FileSystem } from "../../platform/FileSystem.ts" import type { Path } from "../../platform/Path.ts" +import type { ReadonlyRecord } from "../../Record.ts" +import * as Redacted from "../../Redacted.ts" +import * as Result from "../../Result.ts" import * as AST from "../../schema/AST.ts" import * as Issue from "../../schema/Issue.ts" import * as Schema from "../../schema/Schema.ts" @@ -24,6 +23,7 @@ import type * as Scope from "../../Scope.ts" import * as ServiceMap from "../../ServiceMap.ts" import * as Stream from "../../Stream.ts" import type { Covariant } from "../../types/Types.ts" +import * as UndefinedOr from "../../UndefinedOr.ts" import type * as Etag from "../http/Etag.ts" import * as HttpMethod from "../http/HttpMethod.ts" import type { HttpPlatform } from "../http/HttpPlatform.ts" diff --git a/packages/effect/src/unstable/httpapi/HttpApiClient.ts b/packages/effect/src/unstable/httpapi/HttpApiClient.ts index 9f9f2039ea..49fac34dd3 100644 --- a/packages/effect/src/unstable/httpapi/HttpApiClient.ts +++ b/packages/effect/src/unstable/httpapi/HttpApiClient.ts @@ -2,10 +2,10 @@ * @since 4.0.0 */ import * as Cause from "../../Cause.ts" -import * as Option from "../../data/Option.ts" -import type * as Predicate from "../../data/Predicate.ts" import * as Effect from "../../Effect.ts" import { identity } from "../../Function.ts" +import * as Option from "../../Option.ts" +import type * as Predicate from "../../Predicate.ts" import * as AST from "../../schema/AST.ts" import * as Issue from "../../schema/Issue.ts" import * as Schema from "../../schema/Schema.ts" diff --git a/packages/effect/src/unstable/httpapi/HttpApiEndpoint.ts b/packages/effect/src/unstable/httpapi/HttpApiEndpoint.ts index 018f5a9e63..091c929fc7 100644 --- a/packages/effect/src/unstable/httpapi/HttpApiEndpoint.ts +++ b/packages/effect/src/unstable/httpapi/HttpApiEndpoint.ts @@ -1,17 +1,17 @@ /** * @since 4.0.0 */ -import type { Brand } from "../../data/Brand.ts" -import * as Predicate from "../../data/Predicate.ts" -import type { ReadonlyRecord } from "../../data/Record.ts" -import type { Simplify } from "../../data/Struct.ts" -import * as UndefinedOr from "../../data/UndefinedOr.ts" +import type { Brand } from "../../Brand.ts" import type { Effect } from "../../Effect.ts" import { type Pipeable, pipeArguments } from "../../interfaces/Pipeable.ts" +import * as Predicate from "../../Predicate.ts" +import type { ReadonlyRecord } from "../../Record.ts" import * as Schema from "../../schema/Schema.ts" import * as ServiceMap from "../../ServiceMap.ts" import type * as Stream from "../../Stream.ts" +import type { Simplify } from "../../Struct.ts" import type * as Types from "../../types/Types.ts" +import * as UndefinedOr from "../../UndefinedOr.ts" import type { HttpMethod } from "../http/HttpMethod.ts" import * as HttpRouter from "../http/HttpRouter.ts" import type { HttpServerRequest } from "../http/HttpServerRequest.ts" diff --git a/packages/effect/src/unstable/httpapi/HttpApiGroup.ts b/packages/effect/src/unstable/httpapi/HttpApiGroup.ts index bdebd93f46..622227acc4 100644 --- a/packages/effect/src/unstable/httpapi/HttpApiGroup.ts +++ b/packages/effect/src/unstable/httpapi/HttpApiGroup.ts @@ -2,9 +2,9 @@ * @since 4.0.0 */ import type { NonEmptyReadonlyArray } from "../../collections/Array.ts" -import * as Predicate from "../../data/Predicate.ts" -import * as Record from "../../data/Record.ts" import { type Pipeable, pipeArguments } from "../../interfaces/Pipeable.ts" +import * as Predicate from "../../Predicate.ts" +import * as Record from "../../Record.ts" import * as ServiceMap from "../../ServiceMap.ts" import type { PathInput } from "../http/HttpRouter.ts" import type * as HttpApiEndpoint from "./HttpApiEndpoint.ts" diff --git a/packages/effect/src/unstable/httpapi/HttpApiMiddleware.ts b/packages/effect/src/unstable/httpapi/HttpApiMiddleware.ts index b576cd26c9..4c6589b490 100644 --- a/packages/effect/src/unstable/httpapi/HttpApiMiddleware.ts +++ b/packages/effect/src/unstable/httpapi/HttpApiMiddleware.ts @@ -1,11 +1,11 @@ /** * @since 4.0.0 */ -import { hasProperty } from "../../data/Predicate.ts" -import type { Simplify } from "../../data/Struct.ts" import type * as Effect from "../../Effect.ts" +import { hasProperty } from "../../Predicate.ts" import * as Schema from "../../schema/Schema.ts" import * as ServiceMap from "../../ServiceMap.ts" +import type { Simplify } from "../../Struct.ts" import type { unhandled } from "../../types/Types.ts" import type * as HttpRouter from "../http/HttpRouter.ts" import type { HttpServerResponse } from "../http/HttpServerResponse.ts" diff --git a/packages/effect/src/unstable/httpapi/HttpApiSecurity.ts b/packages/effect/src/unstable/httpapi/HttpApiSecurity.ts index 31abcc08fb..dc1e85dc67 100644 --- a/packages/effect/src/unstable/httpapi/HttpApiSecurity.ts +++ b/packages/effect/src/unstable/httpapi/HttpApiSecurity.ts @@ -1,9 +1,9 @@ /** * @since 4.0.0 */ -import type { Redacted } from "../../data/Redacted.ts" import { dual } from "../../Function.ts" import { type Pipeable, pipeArguments } from "../../interfaces/Pipeable.ts" +import type { Redacted } from "../../Redacted.ts" import * as ServiceMap from "../../ServiceMap.ts" import type { Covariant } from "../../types/Types.ts" diff --git a/packages/effect/src/unstable/httpapi/OpenApi.ts b/packages/effect/src/unstable/httpapi/OpenApi.ts index 1db1e7ca81..beeab0150c 100644 --- a/packages/effect/src/unstable/httpapi/OpenApi.ts +++ b/packages/effect/src/unstable/httpapi/OpenApi.ts @@ -2,8 +2,8 @@ * @since 4.0.0 */ import type { NonEmptyArray } from "../../collections/Array.ts" -import * as Option from "../../data/Option.ts" import { constFalse } from "../../Function.ts" +import * as Option from "../../Option.ts" import type * as AST from "../../schema/AST.ts" import * as Schema from "../../schema/Schema.ts" import * as ServiceMap from "../../ServiceMap.ts" diff --git a/packages/effect/src/unstable/jsonschema/Rewriter.ts b/packages/effect/src/unstable/jsonschema/Rewriter.ts index c35af86173..855450dad7 100644 --- a/packages/effect/src/unstable/jsonschema/Rewriter.ts +++ b/packages/effect/src/unstable/jsonschema/Rewriter.ts @@ -1,15 +1,15 @@ /** * @since 4.0.0 */ -import * as Predicate from "effect/data/Predicate" import { constTrue } from "effect/Function" +import * as Predicate from "effect/Predicate" import * as Array_ from "../../collections/Array.ts" -import * as Combiner from "../../data/Combiner.ts" -import { formatPath } from "../../data/Formatter.ts" -import * as Record_ from "../../data/Record.ts" -import * as Struct from "../../data/Struct.ts" -import * as UndefinedOr from "../../data/UndefinedOr.ts" +import * as Combiner from "../../Combiner.ts" +import { formatPath } from "../../Formatter.ts" +import * as Record_ from "../../Record.ts" import type * as Schema from "../../schema/Schema.ts" +import * as Struct from "../../Struct.ts" +import * as UndefinedOr from "../../UndefinedOr.ts" /** * @since 4.0.0 diff --git a/packages/effect/src/unstable/observability/OtlpResource.ts b/packages/effect/src/unstable/observability/OtlpResource.ts index a9ebf41642..cf30489cd5 100644 --- a/packages/effect/src/unstable/observability/OtlpResource.ts +++ b/packages/effect/src/unstable/observability/OtlpResource.ts @@ -2,8 +2,8 @@ * @since 4.0.0 */ import * as Config from "../../Config.ts" -import { format } from "../../data/Formatter.ts" import * as Effect from "../../Effect.ts" +import { format } from "../../Formatter.ts" import * as Schema from "../../schema/Schema.ts" /** diff --git a/packages/effect/src/unstable/persistence/KeyValueStore.ts b/packages/effect/src/unstable/persistence/KeyValueStore.ts index 931abf921a..04327011b7 100644 --- a/packages/effect/src/unstable/persistence/KeyValueStore.ts +++ b/packages/effect/src/unstable/persistence/KeyValueStore.ts @@ -1,20 +1,20 @@ /** * @since 4.0.0 */ -import * as Data from "../../data/Data.ts" -import * as Option from "../../data/Option.ts" -import * as Predicate from "../../data/Predicate.ts" -import * as Result from "../../data/Result.ts" -import * as UndefinedOr from "../../data/UndefinedOr.ts" +import * as Data from "../../Data.ts" import * as Effect from "../../Effect.ts" import * as Base64 from "../../encoding/Base64.ts" import { dual, identity, type LazyArg } from "../../Function.ts" import * as Layer from "../../Layer.ts" +import * as Option from "../../Option.ts" import * as FileSystem from "../../platform/FileSystem.ts" import * as Path from "../../platform/Path.ts" import type { PlatformError } from "../../platform/PlatformError.ts" +import * as Predicate from "../../Predicate.ts" +import * as Result from "../../Result.ts" import * as Schema from "../../schema/Schema.ts" import * as ServiceMap from "../../ServiceMap.ts" +import * as UndefinedOr from "../../UndefinedOr.ts" const TypeId = "~effect/persistence/KeyValueStore" as const diff --git a/packages/effect/src/unstable/persistence/PersistedQueue.ts b/packages/effect/src/unstable/persistence/PersistedQueue.ts index 5e5ed4946b..69d8265af9 100644 --- a/packages/effect/src/unstable/persistence/PersistedQueue.ts +++ b/packages/effect/src/unstable/persistence/PersistedQueue.ts @@ -4,7 +4,7 @@ import * as Cause from "../../Cause.ts" import type * as Arr from "../../collections/Array.ts" import * as Iterable from "../../collections/Iterable.ts" -import * as Data from "../../data/Data.ts" +import * as Data from "../../Data.ts" import * as Duration from "../../Duration.ts" import * as Effect from "../../Effect.ts" import * as Exit from "../../Exit.ts" diff --git a/packages/effect/src/unstable/process/ChildProcess.ts b/packages/effect/src/unstable/process/ChildProcess.ts index a5403b6954..2d85ed7848 100644 --- a/packages/effect/src/unstable/process/ChildProcess.ts +++ b/packages/effect/src/unstable/process/ChildProcess.ts @@ -41,13 +41,13 @@ * * @since 4.0.0 */ -import * as Predicate from "../../data/Predicate.ts" import type * as Duration from "../../Duration.ts" import * as Effect from "../../Effect.ts" import { dual } from "../../Function.ts" import type { Pipeable } from "../../interfaces/Pipeable.ts" import { PipeInspectableProto, YieldableProto } from "../../internal/core.ts" import type * as PlatformError from "../../platform/PlatformError.ts" +import * as Predicate from "../../Predicate.ts" import type * as Scope from "../../Scope.ts" import type * as Sink from "../../Sink.ts" import type * as Stream from "../../Stream.ts" diff --git a/packages/effect/src/unstable/process/ChildProcessSpawner.ts b/packages/effect/src/unstable/process/ChildProcessSpawner.ts index bd3f70c1e5..95f40c1850 100644 --- a/packages/effect/src/unstable/process/ChildProcessSpawner.ts +++ b/packages/effect/src/unstable/process/ChildProcessSpawner.ts @@ -6,7 +6,7 @@ * * @since 4.0.0 */ -import * as Brand from "../../data/Brand.ts" +import * as Brand from "../../Brand.ts" import type * as Effect from "../../Effect.ts" import * as Inspectable from "../../interfaces/Inspectable.ts" import type * as PlatformError from "../../platform/PlatformError.ts" diff --git a/packages/effect/src/unstable/reactivity/Reactivity.ts b/packages/effect/src/unstable/reactivity/Reactivity.ts index 38e275270f..d99e78de73 100644 --- a/packages/effect/src/unstable/reactivity/Reactivity.ts +++ b/packages/effect/src/unstable/reactivity/Reactivity.ts @@ -1,7 +1,6 @@ /** * @since 4.0.0 */ -import type { ReadonlyRecord } from "../../data/Record.ts" import * as Effect from "../../Effect.ts" import * as Exit from "../../Exit.ts" import * as FiberHandle from "../../FiberHandle.ts" @@ -9,6 +8,7 @@ import { dual } from "../../Function.ts" import * as Hash from "../../interfaces/Hash.ts" import * as Layer from "../../Layer.ts" import * as Queue from "../../Queue.ts" +import type { ReadonlyRecord } from "../../Record.ts" import * as Scope from "../../Scope.ts" import * as ServiceMap from "../../ServiceMap.ts" import * as Stream from "../../Stream.ts" diff --git a/packages/effect/src/unstable/rpc/Rpc.ts b/packages/effect/src/unstable/rpc/Rpc.ts index 1f4d3bb898..41e03c1bbd 100644 --- a/packages/effect/src/unstable/rpc/Rpc.ts +++ b/packages/effect/src/unstable/rpc/Rpc.ts @@ -1,16 +1,16 @@ /** * @since 4.0.0 */ -import * as Predicate from "../../data/Predicate.ts" -import type * as Struct from "../../data/Struct.ts" import type { Effect } from "../../Effect.ts" import type { Exit as Exit_ } from "../../Exit.ts" import { type Pipeable, pipeArguments } from "../../interfaces/Pipeable.ts" import * as PrimaryKey from "../../interfaces/PrimaryKey.ts" +import * as Predicate from "../../Predicate.ts" import type * as Queue from "../../Queue.ts" import * as Schema from "../../schema/Schema.ts" import * as ServiceMap from "../../ServiceMap.ts" import type { Stream } from "../../Stream.ts" +import type * as Struct from "../../Struct.ts" import type { Headers } from "../http/Headers.ts" import type { RequestId } from "./RpcMessage.ts" import type * as RpcMiddleware from "./RpcMiddleware.ts" diff --git a/packages/effect/src/unstable/rpc/RpcClient.ts b/packages/effect/src/unstable/rpc/RpcClient.ts index b1adbd3823..f501472936 100644 --- a/packages/effect/src/unstable/rpc/RpcClient.ts +++ b/packages/effect/src/unstable/rpc/RpcClient.ts @@ -3,15 +3,14 @@ */ import * as Cause from "../../Cause.ts" import type { NonEmptyReadonlyArray } from "../../collections/Array.ts" -import * as Filter from "../../data/Filter.ts" -import * as Option from "../../data/Option.ts" -import type * as Struct from "../../data/Struct.ts" import type * as Duration from "../../Duration.ts" import * as Effect from "../../Effect.ts" import * as Exit from "../../Exit.ts" import * as Fiber from "../../Fiber.ts" +import * as Filter from "../../Filter.ts" import { constVoid, dual, identity } from "../../Function.ts" import * as Layer from "../../Layer.ts" +import * as Option from "../../Option.ts" import * as Pool from "../../Pool.ts" import * as Queue from "../../Queue.ts" import * as Schedule from "../../Schedule.ts" @@ -19,6 +18,7 @@ import * as Schema from "../../schema/Schema.ts" import * as Scope from "../../Scope.ts" import * as ServiceMap from "../../ServiceMap.ts" import * as Stream from "../../Stream.ts" +import type * as Struct from "../../Struct.ts" import type { Span } from "../../Tracer.ts" import type { Mutable } from "../../types/Types.ts" import * as Headers from "../http/Headers.ts" diff --git a/packages/effect/src/unstable/rpc/RpcGroup.ts b/packages/effect/src/unstable/rpc/RpcGroup.ts index 5b972add58..d22d6b2725 100644 --- a/packages/effect/src/unstable/rpc/RpcGroup.ts +++ b/packages/effect/src/unstable/rpc/RpcGroup.ts @@ -1,12 +1,12 @@ /** * @since 4.0.0 */ -import type * as Record from "../../data/Record.ts" import * as Effect from "../../Effect.ts" import { identity } from "../../Function.ts" import { type Pipeable } from "../../interfaces/Pipeable.ts" import * as Layer from "../../Layer.ts" import type * as Queue from "../../Queue.ts" +import type * as Record from "../../Record.ts" import type { Scope } from "../../Scope.ts" import * as ServiceMap from "../../ServiceMap.ts" import * as Stream from "../../Stream.ts" diff --git a/packages/effect/src/unstable/rpc/RpcMessage.ts b/packages/effect/src/unstable/rpc/RpcMessage.ts index 649cb81b2d..4e2c48f00f 100644 --- a/packages/effect/src/unstable/rpc/RpcMessage.ts +++ b/packages/effect/src/unstable/rpc/RpcMessage.ts @@ -1,8 +1,8 @@ /** * @since 4.0.0 */ +import type { Branded } from "../../Brand.ts" import type { NonEmptyReadonlyArray } from "../../collections/Array.ts" -import type { Branded } from "../../data/Brand.ts" import * as Schema from "../../schema/Schema.ts" import type { Headers } from "../http/Headers.ts" import type * as Rpc from "./Rpc.ts" diff --git a/packages/effect/src/unstable/rpc/RpcSchema.ts b/packages/effect/src/unstable/rpc/RpcSchema.ts index bfe4a42f6f..69a9df421c 100644 --- a/packages/effect/src/unstable/rpc/RpcSchema.ts +++ b/packages/effect/src/unstable/rpc/RpcSchema.ts @@ -1,7 +1,7 @@ /** * @since 4.0.0 */ -import * as Predicate from "../../data/Predicate.ts" +import * as Predicate from "../../Predicate.ts" import type * as AST from "../../schema/AST.ts" import * as Schema from "../../schema/Schema.ts" import * as Stream_ from "../../Stream.ts" diff --git a/packages/effect/src/unstable/rpc/RpcSerialization.ts b/packages/effect/src/unstable/rpc/RpcSerialization.ts index 7a1355a1f7..1571c4d130 100644 --- a/packages/effect/src/unstable/rpc/RpcSerialization.ts +++ b/packages/effect/src/unstable/rpc/RpcSerialization.ts @@ -2,9 +2,9 @@ * @since 4.0.0 */ import * as Msgpackr from "msgpackr" -import { Predicate } from "../../data/index.ts" -import { hasProperty } from "../../data/Predicate.ts" +import { Predicate } from "../../index.ts" import * as Layer from "../../Layer.ts" +import { hasProperty } from "../../Predicate.ts" import * as ServiceMap from "../../ServiceMap.ts" import type * as RpcMessage from "./RpcMessage.ts" diff --git a/packages/effect/src/unstable/rpc/RpcServer.ts b/packages/effect/src/unstable/rpc/RpcServer.ts index 2c503433cc..6c31c78466 100644 --- a/packages/effect/src/unstable/rpc/RpcServer.ts +++ b/packages/effect/src/unstable/rpc/RpcServer.ts @@ -3,15 +3,15 @@ */ import * as Cause from "../../Cause.ts" import type { NonEmptyReadonlyArray } from "../../collections/Array.ts" -import * as Filter from "../../data/Filter.ts" -import type * as Option from "../../data/Option.ts" -import * as Predicate from "../../data/Predicate.ts" import * as Deferred from "../../Deferred.ts" import * as Effect from "../../Effect.ts" import * as Exit from "../../Exit.ts" import * as Fiber from "../../Fiber.ts" +import * as Filter from "../../Filter.ts" import { constant, constTrue, constVoid, identity } from "../../Function.ts" import * as Layer from "../../Layer.ts" +import type * as Option from "../../Option.ts" +import * as Predicate from "../../Predicate.ts" import * as Pull from "../../Pull.ts" import * as Queue from "../../Queue.ts" import * as Schedule from "../../Schedule.ts" diff --git a/packages/effect/src/unstable/schema/Model.ts b/packages/effect/src/unstable/schema/Model.ts index f4e39c4773..8c449c7c60 100644 --- a/packages/effect/src/unstable/schema/Model.ts +++ b/packages/effect/src/unstable/schema/Model.ts @@ -2,11 +2,11 @@ * @since 4.0.0 */ import * as Uuid from "uuid" -import type { Brand } from "../../data/Brand.ts" -import * as Option from "../../data/Option.ts" -import * as Predicate from "../../data/Predicate.ts" +import type { Brand } from "../../Brand.ts" import * as DateTime from "../../DateTime.ts" import * as Effect from "../../Effect.ts" +import * as Option from "../../Option.ts" +import * as Predicate from "../../Predicate.ts" import * as Getter from "../../schema/Getter.ts" import * as Schema from "../../schema/Schema.ts" import * as Transformation from "../../schema/Transformation.ts" diff --git a/packages/effect/src/unstable/schema/VariantSchema.ts b/packages/effect/src/unstable/schema/VariantSchema.ts index e025db1386..f71249d0b7 100644 --- a/packages/effect/src/unstable/schema/VariantSchema.ts +++ b/packages/effect/src/unstable/schema/VariantSchema.ts @@ -1,15 +1,15 @@ /** * @since 4.0.0 */ -import type { Brand } from "../../data/Brand.ts" -import * as Predicate from "../../data/Predicate.ts" -import * as Struct_ from "../../data/Struct.ts" +import type { Brand } from "../../Brand.ts" import * as Effect from "../../Effect.ts" import { constant, dual } from "../../Function.ts" import { type Pipeable, pipeArguments } from "../../interfaces/Pipeable.ts" +import * as Predicate from "../../Predicate.ts" import type * as Annotations from "../../schema/Annotations.ts" import type * as AST from "../../schema/AST.ts" import * as Schema from "../../schema/Schema.ts" +import * as Struct_ from "../../Struct.ts" /** * @since 4.0.0 diff --git a/packages/effect/src/unstable/socket/Socket.ts b/packages/effect/src/unstable/socket/Socket.ts index 122c335ce0..ecf075d3ea 100644 --- a/packages/effect/src/unstable/socket/Socket.ts +++ b/packages/effect/src/unstable/socket/Socket.ts @@ -3,16 +3,16 @@ */ import * as Channel from "../../Channel.ts" import type { NonEmptyReadonlyArray } from "../../collections/Array.ts" -import * as Data from "../../data/Data.ts" -import * as Filter from "../../data/Filter.ts" -import * as Predicate from "../../data/Predicate.ts" +import * as Data from "../../Data.ts" import * as Deferred from "../../Deferred.ts" import type { DurationInput } from "../../Duration.ts" import * as Effect from "../../Effect.ts" import * as Exit from "../../Exit.ts" import * as FiberSet from "../../FiberSet.ts" +import * as Filter from "../../Filter.ts" import { constVoid, dual } from "../../Function.ts" import * as Layer from "../../Layer.ts" +import * as Predicate from "../../Predicate.ts" import * as Pull from "../../Pull.ts" import * as Queue from "../../Queue.ts" import * as Scope from "../../Scope.ts" diff --git a/packages/effect/src/unstable/socket/SocketServer.ts b/packages/effect/src/unstable/socket/SocketServer.ts index 1cfa708480..c3e570faa3 100644 --- a/packages/effect/src/unstable/socket/SocketServer.ts +++ b/packages/effect/src/unstable/socket/SocketServer.ts @@ -1,7 +1,7 @@ /** * @since 4.0.0 */ -import * as Data from "../../data/Data.ts" +import * as Data from "../../Data.ts" import type * as Effect from "../../Effect.ts" import * as ServiceMap from "../../ServiceMap.ts" import type * as Socket from "./Socket.ts" diff --git a/packages/effect/src/unstable/sql/Migrator.ts b/packages/effect/src/unstable/sql/Migrator.ts index 894708a5a3..4b54f88ffe 100644 --- a/packages/effect/src/unstable/sql/Migrator.ts +++ b/packages/effect/src/unstable/sql/Migrator.ts @@ -2,12 +2,12 @@ * @since 4.0.0 */ import * as Arr from "../../collections/Array.ts" -import * as Data from "../../data/Data.ts" -import * as Filter from "../../data/Filter.ts" -import * as Option from "../../data/Option.ts" -import * as Order from "../../data/Order.ts" +import * as Data from "../../Data.ts" import * as Effect from "../../Effect.ts" +import * as Filter from "../../Filter.ts" import { pipe } from "../../Function.ts" +import * as Option from "../../Option.ts" +import * as Order from "../../Order.ts" import { FileSystem } from "../../platform/FileSystem.ts" import * as Client from "./SqlClient.ts" import type { SqlError } from "./SqlError.ts" diff --git a/packages/effect/src/unstable/sql/SqlClient.ts b/packages/effect/src/unstable/sql/SqlClient.ts index 73dfb3ee63..91f556e329 100644 --- a/packages/effect/src/unstable/sql/SqlClient.ts +++ b/packages/effect/src/unstable/sql/SqlClient.ts @@ -2,11 +2,11 @@ * @since 4.0.0 */ import { Clock } from "../../Clock.ts" -import * as Option from "../../data/Option.ts" -import type { ReadonlyRecord } from "../../data/Record.ts" import * as Effect from "../../Effect.ts" import * as Exit from "../../Exit.ts" +import * as Option from "../../Option.ts" import type * as Queue from "../../Queue.ts" +import type { ReadonlyRecord } from "../../Record.ts" import * as Scope from "../../Scope.ts" import * as ServiceMap from "../../ServiceMap.ts" import * as Stream from "../../Stream.ts" diff --git a/packages/effect/src/unstable/sql/SqlError.ts b/packages/effect/src/unstable/sql/SqlError.ts index 26dde2d733..36ce8a6f95 100644 --- a/packages/effect/src/unstable/sql/SqlError.ts +++ b/packages/effect/src/unstable/sql/SqlError.ts @@ -1,7 +1,7 @@ /** * @since 4.0.0 */ -import * as Data from "../../data/Data.ts" +import * as Data from "../../Data.ts" const TypeId = "~effect/sql/SqlError" diff --git a/packages/effect/src/unstable/sql/Statement.ts b/packages/effect/src/unstable/sql/Statement.ts index 988cc7dde5..855f7993a8 100644 --- a/packages/effect/src/unstable/sql/Statement.ts +++ b/packages/effect/src/unstable/sql/Statement.ts @@ -2,7 +2,6 @@ * @since 4.0.0 */ import { Clock } from "../../Clock.ts" -import { hasProperty } from "../../data/Predicate.ts" import * as Effect from "../../Effect.ts" import type * as Fiber from "../../Fiber.ts" import { constUndefined } from "../../Function.ts" @@ -10,6 +9,7 @@ import type { Inspectable } from "../../interfaces/Inspectable.ts" import type { Pipeable } from "../../interfaces/Pipeable.ts" import * as core from "../../internal/core.ts" import * as internalEffect from "../../internal/effect.ts" +import { hasProperty } from "../../Predicate.ts" import * as ServiceMap from "../../ServiceMap.ts" import * as Stream from "../../Stream.ts" import type * as Tracer from "../../Tracer.ts" diff --git a/packages/effect/src/unstable/workers/WorkerError.ts b/packages/effect/src/unstable/workers/WorkerError.ts index db12cef488..a2d7450927 100644 --- a/packages/effect/src/unstable/workers/WorkerError.ts +++ b/packages/effect/src/unstable/workers/WorkerError.ts @@ -1,7 +1,7 @@ /** * @since 4.0.0 */ -import { hasProperty } from "../../data/Predicate.ts" +import { hasProperty } from "../../Predicate.ts" import * as Schema from "../../schema/Schema.ts" const TypeId = "~effect/workers/WorkerError" as const diff --git a/packages/effect/src/unstable/workflow/DurableDeferred.ts b/packages/effect/src/unstable/workflow/DurableDeferred.ts index 7443b734f3..6b4e7c20d3 100644 --- a/packages/effect/src/unstable/workflow/DurableDeferred.ts +++ b/packages/effect/src/unstable/workflow/DurableDeferred.ts @@ -1,14 +1,14 @@ /** * @since 4.0.0 */ +import type * as Brand from "../../Brand.ts" import type * as Cause from "../../Cause.ts" import type { NonEmptyReadonlyArray } from "../../collections/Array.ts" -import type * as Brand from "../../data/Brand.ts" -import * as Predicate from "../../data/Predicate.ts" import * as Effect from "../../Effect.ts" import * as Base64Url from "../../encoding/Base64Url.ts" import * as Exit from "../../Exit.ts" import { dual } from "../../Function.ts" +import * as Predicate from "../../Predicate.ts" import * as Getter from "../../schema/Getter.ts" import * as Schema from "../../schema/Schema.ts" import * as ServiceMap from "../../ServiceMap.ts" diff --git a/packages/effect/src/unstable/workflow/Workflow.ts b/packages/effect/src/unstable/workflow/Workflow.ts index b22b7da514..6cd4320e98 100644 --- a/packages/effect/src/unstable/workflow/Workflow.ts +++ b/packages/effect/src/unstable/workflow/Workflow.ts @@ -2,14 +2,14 @@ * @since 4.0.0 */ import * as Cause from "../../Cause.ts" -import * as Data from "../../data/Data.ts" -import * as Option from "../../data/Option.ts" -import * as Predicate from "../../data/Predicate.ts" +import * as Data from "../../Data.ts" import * as Effect from "../../Effect.ts" import * as Exit from "../../Exit.ts" import * as Fiber from "../../Fiber.ts" import { constFalse, constTrue, dual, identity } from "../../Function.ts" import * as Layer from "../../Layer.ts" +import * as Option from "../../Option.ts" +import * as Predicate from "../../Predicate.ts" import type * as Schedule from "../../Schedule.ts" import * as Issue from "../../schema/Issue.ts" import * as Parser from "../../schema/Parser.ts" diff --git a/packages/effect/src/unstable/workflow/WorkflowEngine.ts b/packages/effect/src/unstable/workflow/WorkflowEngine.ts index c84e837abb..4e12470c4c 100644 --- a/packages/effect/src/unstable/workflow/WorkflowEngine.ts +++ b/packages/effect/src/unstable/workflow/WorkflowEngine.ts @@ -2,9 +2,9 @@ * @since 4.0.0 */ import type * as Cause from "../../Cause.ts" -import * as Option from "../../data/Option.ts" import * as Effect from "../../Effect.ts" import * as Exit from "../../Exit.ts" +import * as Option from "../../Option.ts" import * as Schedule from "../../Schedule.ts" import * as Schema from "../../schema/Schema.ts" import * as Scope from "../../Scope.ts" diff --git a/packages/effect/test/data/Brand.test.ts b/packages/effect/test/Brand.test.ts similarity index 99% rename from packages/effect/test/data/Brand.test.ts rename to packages/effect/test/Brand.test.ts index 46f22ac50f..1a55f82e13 100644 --- a/packages/effect/test/data/Brand.test.ts +++ b/packages/effect/test/Brand.test.ts @@ -9,7 +9,7 @@ import { strictEqual, throws } from "@effect/vitest/utils" -import { Brand, Result } from "effect/data" +import { Brand, Result } from "effect" import { Schema } from "effect/schema" function assertSuccess>(ctor: Brand.Constructor, value: Brand.Brand.Unbranded) { diff --git a/packages/effect/test/stream/Channel.test.ts b/packages/effect/test/Channel.test.ts similarity index 100% rename from packages/effect/test/stream/Channel.test.ts rename to packages/effect/test/Channel.test.ts diff --git a/packages/effect/test/data/Combiner.test.ts b/packages/effect/test/Combiner.test.ts similarity index 87% rename from packages/effect/test/data/Combiner.test.ts rename to packages/effect/test/Combiner.test.ts index 5db86bc9ee..a26e25414a 100644 --- a/packages/effect/test/data/Combiner.test.ts +++ b/packages/effect/test/Combiner.test.ts @@ -1,7 +1,6 @@ -import { Number, String } from "effect" -import { Combiner } from "effect/data" +import { Combiner, Number, String } from "effect" import { describe, it } from "vitest" -import { strictEqual } from "../utils/assert.ts" +import { strictEqual } from "./utils/assert.ts" describe("Combiner", () => { it("flip", () => { diff --git a/packages/effect/test/Deferred.test.ts b/packages/effect/test/Deferred.test.ts index 3995275c70..899e994c70 100644 --- a/packages/effect/test/Deferred.test.ts +++ b/packages/effect/test/Deferred.test.ts @@ -1,7 +1,6 @@ import { assert, describe, it } from "@effect/vitest" -import { Deferred } from "effect" +import { Deferred, UndefinedOr } from "effect" import * as Cause from "effect/Cause" -import { UndefinedOr } from "effect/data" import * as Effect from "effect/Effect" import * as Exit from "effect/Exit" diff --git a/packages/effect/test/Effect.test.ts b/packages/effect/test/Effect.test.ts index c443dc9360..5ff7e4ea3b 100644 --- a/packages/effect/test/Effect.test.ts +++ b/packages/effect/test/Effect.test.ts @@ -1,7 +1,6 @@ import { assert, describe, it } from "@effect/vitest" -import { Duration, Fiber, Schedule, Scope, ServiceMap } from "effect" +import { Data, Duration, Fiber, Filter, Option, Result, Schedule, Scope, ServiceMap } from "effect" import * as Cause from "effect/Cause" -import { Data, Filter, Option, Result } from "effect/data" import * as Effect from "effect/Effect" import * as Exit from "effect/Exit" import { constFalse, constTrue, pipe } from "effect/Function" diff --git a/packages/effect/test/Equal.test.ts b/packages/effect/test/Equal.test.ts index a917cd99cf..66d473a13d 100644 --- a/packages/effect/test/Equal.test.ts +++ b/packages/effect/test/Equal.test.ts @@ -1,7 +1,7 @@ import * as HashMap from "effect/collections/HashMap" -import * as Option from "effect/data/Option" import * as Equal from "effect/interfaces/Equal" import * as Hash from "effect/interfaces/Hash" +import * as Option from "effect/Option" import { describe, expect, it } from "vitest" describe("Equal - Structural Equality Behavior", () => { diff --git a/packages/effect/test/data/Equivalence.test.ts b/packages/effect/test/Equivalence.test.ts similarity index 98% rename from packages/effect/test/data/Equivalence.test.ts rename to packages/effect/test/Equivalence.test.ts index 16a2ab1ba1..0548786636 100644 --- a/packages/effect/test/data/Equivalence.test.ts +++ b/packages/effect/test/Equivalence.test.ts @@ -1,7 +1,6 @@ import { describe, it } from "@effect/vitest" import { assertFalse, assertTrue } from "@effect/vitest/utils" -import { pipe } from "effect" -import { Equivalence } from "effect/data" +import { Equivalence, pipe } from "effect" describe("Equivalence", () => { it("mapInput", () => { diff --git a/packages/effect/test/data/Formatter.test.ts b/packages/effect/test/Formatter.test.ts similarity index 97% rename from packages/effect/test/data/Formatter.test.ts rename to packages/effect/test/Formatter.test.ts index 42e9518097..2758f7c0b0 100644 --- a/packages/effect/test/data/Formatter.test.ts +++ b/packages/effect/test/Formatter.test.ts @@ -1,9 +1,9 @@ -import { Option, Redacted } from "effect/data" -import { format, formatJson } from "effect/data/Formatter" +import { Option, Redacted } from "effect" +import { format, formatJson } from "effect/Formatter" import { Redactable } from "effect/interfaces" import { Schema } from "effect/schema" import { describe, it } from "vitest" -import { strictEqual } from "../utils/assert.ts" +import { strictEqual } from "./utils/assert.ts" class SensitiveData implements Redactable.Redactable { constructor(private secret: string) {} diff --git a/packages/effect/test/HashMap.test.ts b/packages/effect/test/HashMap.test.ts index 2110bf54a6..96a7b498fe 100644 --- a/packages/effect/test/HashMap.test.ts +++ b/packages/effect/test/HashMap.test.ts @@ -1,5 +1,5 @@ +import { Option } from "effect" import { HashMap } from "effect/collections" -import { Option } from "effect/data" import { Equal, Hash } from "effect/interfaces" import { describe, expect, it } from "vitest" diff --git a/packages/effect/test/HttpClient.test.ts b/packages/effect/test/HttpClient.test.ts index 6c52483bef..17c8955270 100644 --- a/packages/effect/test/HttpClient.test.ts +++ b/packages/effect/test/HttpClient.test.ts @@ -1,6 +1,5 @@ import { expect, it } from "@effect/vitest" -import { Effect, Layer, ServiceMap, Stream } from "effect" -import { Struct } from "effect/data" +import { Effect, Layer, ServiceMap, Stream, Struct } from "effect" import { Schema } from "effect/schema" import { TestClock } from "effect/testing" import { FetchHttpClient, HttpClient, HttpClientRequest, HttpClientResponse } from "effect/unstable/http" diff --git a/packages/effect/test/data/NullOr.test.ts b/packages/effect/test/NullOr.test.ts similarity index 93% rename from packages/effect/test/data/NullOr.test.ts rename to packages/effect/test/NullOr.test.ts index dd74e23f35..a77463551a 100644 --- a/packages/effect/test/data/NullOr.test.ts +++ b/packages/effect/test/NullOr.test.ts @@ -1,7 +1,6 @@ -import { Number } from "effect" -import { NullOr } from "effect/data" +import { NullOr, Number } from "effect" import { describe, it } from "vitest" -import { strictEqual, throws } from "../utils/assert.ts" +import { strictEqual, throws } from "./utils/assert.ts" describe("NullOr", () => { it("map", () => { diff --git a/packages/effect/test/Optic.test.ts b/packages/effect/test/Optic.test.ts index 3401c551d4..df00b8fab3 100644 --- a/packages/effect/test/Optic.test.ts +++ b/packages/effect/test/Optic.test.ts @@ -1,5 +1,4 @@ -import { Optic } from "effect" -import { Option, Result } from "effect/data" +import { Optic, Option, Result } from "effect" import { AST, Schema } from "effect/schema" import { describe, it } from "vitest" import { assertFailure, assertSuccess, assertTrue, deepStrictEqual, strictEqual, throws } from "./utils/assert.ts" diff --git a/packages/effect/test/data/Option.test.ts b/packages/effect/test/Option.test.ts similarity index 94% rename from packages/effect/test/data/Option.test.ts rename to packages/effect/test/Option.test.ts index 2ee6038d19..0fdd060751 100644 --- a/packages/effect/test/data/Option.test.ts +++ b/packages/effect/test/Option.test.ts @@ -1,5 +1,4 @@ -import { Number } from "effect" -import { Option } from "effect/data" +import { Number, Option } from "effect" import { deepStrictEqual } from "node:assert" import { describe, it } from "vitest" diff --git a/packages/effect/test/data/Ordering.test.ts b/packages/effect/test/Ordering.test.ts similarity index 92% rename from packages/effect/test/data/Ordering.test.ts rename to packages/effect/test/Ordering.test.ts index 248b67250c..301196cb33 100644 --- a/packages/effect/test/data/Ordering.test.ts +++ b/packages/effect/test/Ordering.test.ts @@ -1,4 +1,4 @@ -import { Ordering } from "effect/data" +import { Ordering } from "effect" import { deepStrictEqual } from "node:assert" import { describe, it } from "vitest" diff --git a/packages/effect/test/data/Predicate.test.ts b/packages/effect/test/Predicate.test.ts similarity index 99% rename from packages/effect/test/data/Predicate.test.ts rename to packages/effect/test/Predicate.test.ts index 84f8358443..8f0e8e17e9 100644 --- a/packages/effect/test/data/Predicate.test.ts +++ b/packages/effect/test/Predicate.test.ts @@ -1,7 +1,6 @@ import { describe, it } from "@effect/vitest" import { assertFalse, assertTrue } from "@effect/vitest/utils" -import { Function as Fun, pipe } from "effect" -import { Predicate } from "effect/data" +import { Function as Fun, pipe, Predicate } from "effect" const isPositive: Predicate.Predicate = (n) => n > 0 const isNegative: Predicate.Predicate = (n) => n < 0 diff --git a/packages/effect/test/RcMap.test.ts b/packages/effect/test/RcMap.test.ts index 368bc103fc..ee181fcd39 100644 --- a/packages/effect/test/RcMap.test.ts +++ b/packages/effect/test/RcMap.test.ts @@ -1,6 +1,5 @@ import { assert, describe, it } from "@effect/vitest" -import { Cause, Effect, Exit, RcMap, Scope } from "effect" -import { Data } from "effect/data" +import { Cause, Data, Effect, Exit, RcMap, Scope } from "effect" import { TestClock } from "effect/testing" describe("RcMap", () => { diff --git a/packages/effect/test/data/Record.test.ts b/packages/effect/test/Record.test.ts similarity index 99% rename from packages/effect/test/data/Record.test.ts rename to packages/effect/test/Record.test.ts index 178f1915ae..2ea2b9829b 100644 --- a/packages/effect/test/data/Record.test.ts +++ b/packages/effect/test/Record.test.ts @@ -1,6 +1,5 @@ import { assertFalse, assertNone, assertSome, assertTrue, assertUndefined, deepStrictEqual } from "@effect/vitest/utils" -import { Number as Num } from "effect" -import { Equivalence, Option, Record, Result } from "effect/data" +import { Equivalence, Number as Num, Option, Record, Result } from "effect" import { pipe } from "effect/Function" import { describe, it } from "vitest" diff --git a/packages/effect/test/data/Redacted.test.ts b/packages/effect/test/Redacted.test.ts similarity index 98% rename from packages/effect/test/data/Redacted.test.ts rename to packages/effect/test/Redacted.test.ts index d658bdbdc9..e5f233382f 100644 --- a/packages/effect/test/data/Redacted.test.ts +++ b/packages/effect/test/Redacted.test.ts @@ -1,7 +1,7 @@ import { describe, it } from "@effect/vitest" import { assertFalse, assertTrue, strictEqual, throws } from "@effect/vitest/utils" +import { Redacted } from "effect" import { Chunk } from "effect/collections" -import { Redacted } from "effect/data" import { Equal, Hash } from "effect/interfaces" describe("Redacted", () => { diff --git a/packages/effect/test/data/Reducer.test.ts b/packages/effect/test/Reducer.test.ts similarity index 70% rename from packages/effect/test/data/Reducer.test.ts rename to packages/effect/test/Reducer.test.ts index 021a8a1a49..3c2ed18f2d 100644 --- a/packages/effect/test/data/Reducer.test.ts +++ b/packages/effect/test/Reducer.test.ts @@ -1,7 +1,6 @@ -import { String } from "effect" -import { Reducer } from "effect/data" +import { Reducer, String } from "effect" import { describe, it } from "vitest" -import { strictEqual } from "../utils/assert.ts" +import { strictEqual } from "./utils/assert.ts" describe("Combiner", () => { it("flip", () => { diff --git a/packages/effect/test/Ref.test.ts b/packages/effect/test/Ref.test.ts index 7149a92e53..e2f289f175 100644 --- a/packages/effect/test/Ref.test.ts +++ b/packages/effect/test/Ref.test.ts @@ -1,6 +1,5 @@ import { assert, describe, it } from "@effect/vitest" -import { Effect, Ref } from "effect" -import { Option } from "effect/data" +import { Effect, Option, Ref } from "effect" const current = "value" const update = "new value" diff --git a/packages/effect/test/data/Result.test.ts b/packages/effect/test/Result.test.ts similarity index 98% rename from packages/effect/test/data/Result.test.ts rename to packages/effect/test/Result.test.ts index ea84dec618..a11506959f 100644 --- a/packages/effect/test/data/Result.test.ts +++ b/packages/effect/test/Result.test.ts @@ -1,6 +1,5 @@ -import { Cause, Effect, flow, identity, pipe, String as Str } from "effect" +import { Cause, Effect, Equivalence, flow, identity, Option, pipe, Result, String as Str } from "effect" import { Chunk } from "effect/collections" -import { Equivalence, Option, Result } from "effect/data" import { Equal } from "effect/interfaces" import { inspect } from "node:util" import { describe, it } from "vitest" @@ -16,7 +15,7 @@ import { deepStrictEqual, strictEqual, throws -} from "../utils/assert.ts" +} from "./utils/assert.ts" describe("Result", () => { describe("Constructors", () => { diff --git a/packages/effect/test/stream/Sink.test.ts b/packages/effect/test/Sink.test.ts similarity index 100% rename from packages/effect/test/stream/Sink.test.ts rename to packages/effect/test/Sink.test.ts diff --git a/packages/effect/test/stream/Stream.test.ts b/packages/effect/test/Stream.test.ts similarity index 99% rename from packages/effect/test/stream/Stream.test.ts rename to packages/effect/test/Stream.test.ts index 755025c7f0..7ba037e687 100644 --- a/packages/effect/test/stream/Stream.test.ts +++ b/packages/effect/test/Stream.test.ts @@ -1,15 +1,29 @@ /* eslint-disable no-restricted-syntax */ import { assert, describe, it } from "@effect/vitest" import { assertExitFailure, assertSuccess, assertTrue, deepStrictEqual, strictEqual } from "@effect/vitest/utils" -import { Cause, Clock, Deferred, Duration, Effect, Exit, Fiber, Queue, Ref, Schedule, Sink, Stream } from "effect" +import { + Cause, + Clock, + Deferred, + Duration, + Effect, + Exit, + Fiber, + Filter, + Option, + Queue, + Ref, + Schedule, + Sink, + Stream +} from "effect" import { Array } from "effect/collections" import { isReadonlyArrayNonEmpty, type NonEmptyArray } from "effect/collections/Array" -import { Filter, Option } from "effect/data" import { constFalse, constTrue, constVoid, pipe } from "effect/Function" import { TestClock } from "effect/testing" import * as fc from "effect/testing/FastCheck" -import { assertFailure } from "../utils/assert.ts" -import { chunkCoordination } from "../utils/chunkCoordination.ts" +import { assertFailure } from "./utils/assert.ts" +import { chunkCoordination } from "./utils/chunkCoordination.ts" describe("Stream", () => { describe("callback", () => { diff --git a/packages/effect/test/data/Struct.test.ts b/packages/effect/test/Struct.test.ts similarity index 97% rename from packages/effect/test/data/Struct.test.ts rename to packages/effect/test/Struct.test.ts index 47c8e44d54..aab45edf5e 100644 --- a/packages/effect/test/data/Struct.test.ts +++ b/packages/effect/test/Struct.test.ts @@ -1,9 +1,8 @@ -import { Number, pipe, String, String as Str } from "effect" -import { Equivalence, Struct, UndefinedOr } from "effect/data" +import { Equivalence, Number, pipe, String, String as Str, Struct, UndefinedOr } from "effect" import { Schema } from "effect/schema" import { TestSchema } from "effect/testing" import { describe, it } from "vitest" -import { assertFalse, assertTrue, deepStrictEqual, strictEqual } from "../utils/assert.ts" +import { assertFalse, assertTrue, deepStrictEqual, strictEqual } from "./utils/assert.ts" const equals = TestSchema.Asserts.ast.fields.equals diff --git a/packages/effect/test/stream/SubscriptionRef.test.ts b/packages/effect/test/SubscriptionRef.test.ts similarity index 100% rename from packages/effect/test/stream/SubscriptionRef.test.ts rename to packages/effect/test/SubscriptionRef.test.ts diff --git a/packages/effect/test/data/Tuple.test.ts b/packages/effect/test/Tuple.test.ts similarity index 97% rename from packages/effect/test/data/Tuple.test.ts rename to packages/effect/test/Tuple.test.ts index 0301f0416d..b08fe18028 100644 --- a/packages/effect/test/data/Tuple.test.ts +++ b/packages/effect/test/Tuple.test.ts @@ -1,5 +1,4 @@ -import { Number, pipe, String } from "effect" -import { Tuple } from "effect/data" +import { Number, pipe, String, Tuple } from "effect" import { Schema } from "effect/schema" import { TestSchema } from "effect/testing" import { deepStrictEqual, strictEqual } from "node:assert" diff --git a/packages/effect/test/TxHashMap.test.ts b/packages/effect/test/TxHashMap.test.ts index 0d2b9485f4..aa53468a34 100644 --- a/packages/effect/test/TxHashMap.test.ts +++ b/packages/effect/test/TxHashMap.test.ts @@ -1,6 +1,6 @@ import { assert, describe, it } from "@effect/vitest" +import { Option } from "effect" import { HashMap } from "effect/collections" -import { Option } from "effect/data" import * as Effect from "effect/Effect" import { Hash } from "effect/interfaces" import { TxHashMap } from "effect/stm" diff --git a/packages/effect/test/TxQueue.test.ts b/packages/effect/test/TxQueue.test.ts index 1faac401d3..69a77e9b5b 100644 --- a/packages/effect/test/TxQueue.test.ts +++ b/packages/effect/test/TxQueue.test.ts @@ -1,8 +1,7 @@ import { assert, describe, it } from "@effect/vitest" -import { Fiber } from "effect" +import { Fiber, Option } from "effect" import * as Cause from "effect/Cause" import { Chunk } from "effect/collections" -import { Option } from "effect/data" import * as Effect from "effect/Effect" import { TxQueue } from "effect/stm" diff --git a/packages/effect/test/data/UndefinedOr.test.ts b/packages/effect/test/UndefinedOr.test.ts similarity index 94% rename from packages/effect/test/data/UndefinedOr.test.ts rename to packages/effect/test/UndefinedOr.test.ts index 3d37f0a9bc..b6baa1ff6e 100644 --- a/packages/effect/test/data/UndefinedOr.test.ts +++ b/packages/effect/test/UndefinedOr.test.ts @@ -1,7 +1,6 @@ -import { Number } from "effect" -import { UndefinedOr } from "effect/data" +import { Number, UndefinedOr } from "effect" import { describe, it } from "vitest" -import { strictEqual, throws } from "../utils/assert.ts" +import { strictEqual, throws } from "./utils/assert.ts" describe("UndefinedOr", () => { it("map", () => { diff --git a/packages/effect/test/batching/Request.test.ts b/packages/effect/test/batching/Request.test.ts index 8724c95720..6ce6d70fd7 100644 --- a/packages/effect/test/batching/Request.test.ts +++ b/packages/effect/test/batching/Request.test.ts @@ -1,8 +1,7 @@ import { assert, describe, expect, it } from "@effect/vitest" -import { Fiber, ServiceMap } from "effect" +import { Data, Fiber, ServiceMap } from "effect" import * as Cause from "effect/Cause" import { Array } from "effect/collections" -import { Data } from "effect/data" import * as Effect from "effect/Effect" import * as Exit from "effect/Exit" import { flow, pipe } from "effect/Function" diff --git a/packages/effect/test/caching/Cache.test.ts b/packages/effect/test/caching/Cache.test.ts index 9ae8aadbbc..17087006d1 100644 --- a/packages/effect/test/caching/Cache.test.ts +++ b/packages/effect/test/caching/Cache.test.ts @@ -1,6 +1,5 @@ import { assert, describe, it } from "@effect/vitest" -import { Cache, Deferred, Duration, Effect, Exit, Fiber, ServiceMap } from "effect" -import { Data, Option } from "effect/data" +import { Cache, Data, Deferred, Duration, Effect, Exit, Fiber, Option, ServiceMap } from "effect" import { TestClock } from "effect/testing" describe("Cache", () => { diff --git a/packages/effect/test/caching/ScopedCache.test.ts b/packages/effect/test/caching/ScopedCache.test.ts index b63bcb18ad..90da0ecf79 100644 --- a/packages/effect/test/caching/ScopedCache.test.ts +++ b/packages/effect/test/caching/ScopedCache.test.ts @@ -1,6 +1,5 @@ import { assert, describe, it } from "@effect/vitest" -import { Clock, Deferred, Duration, Effect, Exit, Fiber, ScopedCache, ServiceMap } from "effect" -import { Data, Option } from "effect/data" +import { Clock, Data, Deferred, Duration, Effect, Exit, Fiber, Option, ScopedCache, ServiceMap } from "effect" import { TestClock } from "effect/testing" describe("ScopedCache", () => { diff --git a/packages/effect/test/cluster/Sharding.test.ts b/packages/effect/test/cluster/Sharding.test.ts index 436684d39b..38ddbf4682 100644 --- a/packages/effect/test/cluster/Sharding.test.ts +++ b/packages/effect/test/cluster/Sharding.test.ts @@ -1,7 +1,6 @@ import { assert, describe, expect, it } from "@effect/vitest" -import { Cause, Clock, Effect, Exit, Fiber, Layer, MutableRef, Queue, Stream } from "effect" +import { Cause, Clock, Effect, Exit, Fiber, Layer, MutableRef, Option, Queue, Stream } from "effect" import { Array } from "effect/collections" -import { Option } from "effect/data" import { TestClock } from "effect/testing" import { MessageStorage, diff --git a/packages/effect/test/collections/Array.test.ts b/packages/effect/test/collections/Array.test.ts index 2c236320a6..39f96454c3 100644 --- a/packages/effect/test/collections/Array.test.ts +++ b/packages/effect/test/collections/Array.test.ts @@ -1,9 +1,8 @@ import { describe, it } from "@effect/vitest" import { assertNone, assertSome, assertUndefined, deepStrictEqual, strictEqual, throws } from "@effect/vitest/utils" -import { Number as Num, String as Str } from "effect" +import { Number as Num, Option, Order, Result, String as Str } from "effect" +import { Equivalence, type Predicate } from "effect" import { Array as Arr } from "effect/collections" -import { Equivalence, type Predicate } from "effect/data" -import { Option, Order, Result } from "effect/data" import { identity, pipe } from "effect/Function" import { FastCheck as fc } from "effect/testing" diff --git a/packages/effect/test/collections/Chunk.test.ts b/packages/effect/test/collections/Chunk.test.ts index 5742261ae0..bff7e9e67a 100644 --- a/packages/effect/test/collections/Chunk.test.ts +++ b/packages/effect/test/collections/Chunk.test.ts @@ -11,9 +11,9 @@ import { strictEqual, throws } from "@effect/vitest/utils" +import type { Predicate } from "effect" +import { Equivalence, Option, Order, Result } from "effect" import { Array as Arr, Chunk } from "effect/collections" -import type { Predicate } from "effect/data" -import { Equivalence, Option, Order, Result } from "effect/data" import { identity, pipe } from "effect/Function" import { Equal } from "effect/interfaces" import { FastCheck as fc } from "effect/testing" diff --git a/packages/effect/test/collections/Graph.test.ts b/packages/effect/test/collections/Graph.test.ts index f77f35a6e8..c5c1b7adc6 100644 --- a/packages/effect/test/collections/Graph.test.ts +++ b/packages/effect/test/collections/Graph.test.ts @@ -6,8 +6,8 @@ import { deepStrictEqual, strictEqual } from "@effect/vitest/utils" +import { Option } from "effect" import { Graph } from "effect/collections" -import { Option } from "effect/data" import { Equal, Hash } from "effect/interfaces" import { describe, expect, it } from "vitest" diff --git a/packages/effect/test/collections/Iterable.test.ts b/packages/effect/test/collections/Iterable.test.ts index cd3ed806ba..84adee3d54 100644 --- a/packages/effect/test/collections/Iterable.test.ts +++ b/packages/effect/test/collections/Iterable.test.ts @@ -1,9 +1,9 @@ import { describe, it } from "@effect/vitest" import { assertFalse, assertNone, assertSome, assertTrue, deepStrictEqual, strictEqual } from "@effect/vitest/utils" +import { Equivalence, Option } from "effect" import { Iterable as Iter } from "effect/collections" -import { Equivalence, Option } from "effect/data" -import type { Predicate } from "effect/data/Predicate" import { pipe } from "effect/Function" +import type { Predicate } from "effect/Predicate" const symA = Symbol.for("a") const symB = Symbol.for("b") diff --git a/packages/effect/test/collections/MutableHashMap.test.ts b/packages/effect/test/collections/MutableHashMap.test.ts index 20b6a0241b..36591ffe87 100644 --- a/packages/effect/test/collections/MutableHashMap.test.ts +++ b/packages/effect/test/collections/MutableHashMap.test.ts @@ -1,8 +1,7 @@ import { describe, it } from "@effect/vitest" import { assertFalse, assertNone, assertSome, assertTrue, deepStrictEqual, strictEqual } from "@effect/vitest/utils" -import { pipe } from "effect" +import { Option, pipe } from "effect" import { MutableHashMap as HM } from "effect/collections" -import { Option } from "effect/data" import { Equal, Hash } from "effect/interfaces" class Key implements Equal.Equal { diff --git a/packages/effect/test/collections/Pathfinding.test.ts b/packages/effect/test/collections/Pathfinding.test.ts index ca0e34b2be..a9c7b93de5 100644 --- a/packages/effect/test/collections/Pathfinding.test.ts +++ b/packages/effect/test/collections/Pathfinding.test.ts @@ -1,6 +1,6 @@ import { describe, it } from "@effect/vitest" +import { Data, Option } from "effect" import { Graph } from "effect/collections" -import { Data, Option } from "effect/data" import type { Types } from "effect/types" import { AssertionError } from "node:assert" diff --git a/packages/effect/test/collections/Trie.test.ts b/packages/effect/test/collections/Trie.test.ts index 91659b4cac..69c920da75 100644 --- a/packages/effect/test/collections/Trie.test.ts +++ b/packages/effect/test/collections/Trie.test.ts @@ -1,9 +1,9 @@ import { describe, it } from "@effect/vitest" import { assertNone, assertSome, deepStrictEqual, strictEqual, throws } from "@effect/vitest/utils" import * as Trie from "effect/collections/Trie" -import * as Option from "effect/data/Option" import { pipe } from "effect/Function" import * as Equal from "effect/interfaces/Equal" +import * as Option from "effect/Option" describe("Trie", () => { it("toString", () => { diff --git a/packages/effect/test/config/Config.test.ts b/packages/effect/test/config/Config.test.ts index 2ad2d460b3..03af194385 100644 --- a/packages/effect/test/config/Config.test.ts +++ b/packages/effect/test/config/Config.test.ts @@ -1,7 +1,6 @@ import { describe, it } from "@effect/vitest" import { deepStrictEqual } from "@effect/vitest/utils" -import { Config, ConfigProvider, Duration, Effect, pipe } from "effect" -import { Option, Redacted, Result } from "effect/data" +import { Config, ConfigProvider, Duration, Effect, Option, pipe, Redacted, Result } from "effect" import { Issue, Schema } from "effect/schema" import * as assert from "node:assert" diff --git a/packages/effect/test/config/ConfigProvider.test.ts b/packages/effect/test/config/ConfigProvider.test.ts index 4926d3a9d9..85325b0588 100644 --- a/packages/effect/test/config/ConfigProvider.test.ts +++ b/packages/effect/test/config/ConfigProvider.test.ts @@ -1,7 +1,6 @@ import { describe, it } from "@effect/vitest" import { deepStrictEqual } from "@effect/vitest/utils" -import { ConfigProvider, Effect, Layer } from "effect" -import { Result } from "effect/data" +import { ConfigProvider, Effect, Layer, Result } from "effect" import { FileSystem, Path } from "effect/platform" import { SystemError } from "effect/platform/PlatformError" diff --git a/packages/effect/test/persistence/PersistedCacheTest.ts b/packages/effect/test/persistence/PersistedCacheTest.ts index c5bcc92d9c..1edbd63ce9 100644 --- a/packages/effect/test/persistence/PersistedCacheTest.ts +++ b/packages/effect/test/persistence/PersistedCacheTest.ts @@ -1,7 +1,6 @@ import { assert, describe, it } from "@effect/vitest" import type { Layer } from "effect" -import { Effect, Exit } from "effect" -import { Data, Filter } from "effect/data" +import { Data, Effect, Exit, Filter } from "effect" import { Schema } from "effect/schema" import { Persistable, PersistedCache, Persistence } from "effect/unstable/persistence" diff --git a/packages/effect/test/schema/Equivalence.test.ts b/packages/effect/test/schema/Equivalence.test.ts index 472833c9d6..8e9b31569f 100644 --- a/packages/effect/test/schema/Equivalence.test.ts +++ b/packages/effect/test/schema/Equivalence.test.ts @@ -1,5 +1,4 @@ -import { DateTime, Duration } from "effect" -import { Equivalence, Option, Redacted, Result } from "effect/data" +import { DateTime, Duration, Equivalence, Option, Redacted, Result } from "effect" import { Schema } from "effect/schema" import { describe, it } from "vitest" import { assertFalse, assertTrue, throws } from "../utils/assert.ts" diff --git a/packages/effect/test/schema/Formatter.test.ts b/packages/effect/test/schema/Formatter.test.ts index 713ed9d5fa..77c490e6aa 100644 --- a/packages/effect/test/schema/Formatter.test.ts +++ b/packages/effect/test/schema/Formatter.test.ts @@ -1,5 +1,4 @@ -import { DateTime, Duration } from "effect" -import { Option, Redacted, Result } from "effect/data" +import { DateTime, Duration, Option, Redacted, Result } from "effect" import { Schema } from "effect/schema" import { describe, it } from "vitest" import { strictEqual } from "../utils/assert.ts" diff --git a/packages/effect/test/schema/Getter.test.ts b/packages/effect/test/schema/Getter.test.ts index 5dce8e0f72..5ceacb1a20 100644 --- a/packages/effect/test/schema/Getter.test.ts +++ b/packages/effect/test/schema/Getter.test.ts @@ -1,5 +1,4 @@ -import { Effect } from "effect" -import { Option, Result } from "effect/data" +import { Effect, Option, Result } from "effect" import { Getter } from "effect/schema" import { describe, it } from "vitest" import { assertSome, deepStrictEqual } from "../utils/assert.ts" diff --git a/packages/effect/test/schema/HMR.test.ts b/packages/effect/test/schema/HMR.test.ts index baf0e15b09..7f90b3601e 100644 --- a/packages/effect/test/schema/HMR.test.ts +++ b/packages/effect/test/schema/HMR.test.ts @@ -1,5 +1,4 @@ -import { Exit } from "effect" -import { Option } from "effect/data" +import { Exit, Option } from "effect" import { describe, expect, it, vi } from "vitest" const SCHEMA_MODULE_PATH = "../../src/schema/Schema.ts" diff --git a/packages/effect/test/schema/Optic.test.ts b/packages/effect/test/schema/Optic.test.ts index 9d24de4c7f..a92f30cf91 100644 --- a/packages/effect/test/schema/Optic.test.ts +++ b/packages/effect/test/schema/Optic.test.ts @@ -1,5 +1,4 @@ -import { Cause, Exit } from "effect" -import { Data, Option, Predicate, Record, Result } from "effect/data" +import { Cause, Data, Exit, Option, Predicate, Record, Result } from "effect" import { Schema, Transformation, Util } from "effect/schema" import { describe, it } from "vitest" import { assertNone, assertSome, deepStrictEqual, strictEqual, throws } from "../utils/assert.ts" diff --git a/packages/effect/test/schema/Schema.test.ts b/packages/effect/test/schema/Schema.test.ts index 2c8377b88e..61e78c1b3e 100644 --- a/packages/effect/test/schema/Schema.test.ts +++ b/packages/effect/test/schema/Schema.test.ts @@ -1,5 +1,22 @@ -import { Cause, DateTime, Duration, Effect, Exit, flow, pipe, ServiceMap, String as Str } from "effect" -import { Brand, Option, Order, Predicate, Redacted, Result, Struct, Tuple } from "effect/data" +import { + Brand, + Cause, + DateTime, + Duration, + Effect, + Exit, + flow, + Option, + Order, + pipe, + Predicate, + Redacted, + Result, + ServiceMap, + String as Str, + Struct, + Tuple +} from "effect" import { Equal } from "effect/interfaces" import { Annotations, AST, Getter, Issue, Parser, Schema, Transformation } from "effect/schema" import { TestSchema } from "effect/testing" diff --git a/packages/effect/test/schema/Serializer.test.ts b/packages/effect/test/schema/Serializer.test.ts index d9bb5fd4b9..5aa753a9fa 100644 --- a/packages/effect/test/schema/Serializer.test.ts +++ b/packages/effect/test/schema/Serializer.test.ts @@ -1,5 +1,4 @@ -import { Cause, DateTime, Duration, Effect } from "effect" -import { Option, Redacted, Result } from "effect/data" +import { Cause, DateTime, Duration, Effect, Option, Redacted, Result } from "effect" import { Getter, Issue, Parser, Schema, Transformation } from "effect/schema" import { TestSchema } from "effect/testing" import { describe, it } from "vitest" diff --git a/packages/effect/test/schema/toStandardSchemaV1.test.ts b/packages/effect/test/schema/toStandardSchemaV1.test.ts index 10dfb7334c..c4c7facab3 100644 --- a/packages/effect/test/schema/toStandardSchemaV1.test.ts +++ b/packages/effect/test/schema/toStandardSchemaV1.test.ts @@ -1,7 +1,6 @@ import { assertTrue, deepStrictEqual, strictEqual } from "@effect/vitest/utils" import type { StandardSchemaV1 } from "@standard-schema/spec" -import { Effect, ServiceMap } from "effect" -import { Option, Predicate } from "effect/data" +import { Effect, Option, Predicate, ServiceMap } from "effect" import { Getter, Issue, Schema } from "effect/schema" import { describe, it } from "vitest" diff --git a/packages/effect/test/schema/v3-v4.test.ts b/packages/effect/test/schema/v3-v4.test.ts index 8a7161d993..bb588c00c9 100644 --- a/packages/effect/test/schema/v3-v4.test.ts +++ b/packages/effect/test/schema/v3-v4.test.ts @@ -1,4 +1,4 @@ -import { Option, Predicate } from "effect/data" +import { Option, Predicate } from "effect" import { Getter, Schema } from "effect/schema" import { TestSchema } from "effect/testing" import { describe, it } from "vitest" diff --git a/packages/effect/test/testing/TestSchema.test.ts b/packages/effect/test/testing/TestSchema.test.ts index fc5d1069cf..7ddda63132 100644 --- a/packages/effect/test/testing/TestSchema.test.ts +++ b/packages/effect/test/testing/TestSchema.test.ts @@ -1,5 +1,4 @@ -import { Effect, ServiceMap } from "effect" -import { Option } from "effect/data" +import { Effect, Option, ServiceMap } from "effect" import { Getter, Issue, Schema } from "effect/schema" import { TestSchema } from "effect/testing" import { describe, it } from "vitest" diff --git a/packages/effect/test/time/Cron.test.ts b/packages/effect/test/time/Cron.test.ts index 7545e9d965..042e815086 100644 --- a/packages/effect/test/time/Cron.test.ts +++ b/packages/effect/test/time/Cron.test.ts @@ -1,7 +1,6 @@ import { describe, it } from "@effect/vitest" import { assertFalse, assertTrue, deepStrictEqual, throws } from "@effect/vitest/utils" -import { Cron, DateTime } from "effect" -import { Result } from "effect/data" +import { Cron, DateTime, Result } from "effect" import { Equal } from "effect/interfaces" const match = (input: Cron.Cron | string, date: DateTime.DateTime.Input) => diff --git a/packages/effect/test/time/DateTime.test.ts b/packages/effect/test/time/DateTime.test.ts index 986dcff1a9..b4ef2d3a89 100644 --- a/packages/effect/test/time/DateTime.test.ts +++ b/packages/effect/test/time/DateTime.test.ts @@ -1,7 +1,6 @@ import { describe, it } from "@effect/vitest" import { assertDefined, assertSuccess, deepStrictEqual, strictEqual } from "@effect/vitest/utils" -import { DateTime, Duration, Effect } from "effect" -import { UndefinedOr } from "effect/data" +import { DateTime, Duration, Effect, UndefinedOr } from "effect" import { TestClock } from "effect/testing" const setTo2024NZ = TestClock.setTime(new Date("2023-12-31T11:00:00.000Z").getTime()) diff --git a/packages/effect/test/unstable/ai/Chat.test.ts b/packages/effect/test/unstable/ai/Chat.test.ts index ae2c78e7fb..ebf024ae7a 100644 --- a/packages/effect/test/unstable/ai/Chat.test.ts +++ b/packages/effect/test/unstable/ai/Chat.test.ts @@ -1,6 +1,5 @@ import { assert, describe, it } from "@effect/vitest" -import { Effect, Layer, Ref } from "effect" -import { Option, Predicate } from "effect/data" +import { Effect, Layer, Option, Predicate, Ref } from "effect" import { Schema } from "effect/schema" import { TestClock } from "effect/testing" import { Chat, IdGenerator, Prompt } from "effect/unstable/ai" diff --git a/packages/effect/test/unstable/ai/utils.ts b/packages/effect/test/unstable/ai/utils.ts index 80b9dd8613..efca89cd43 100644 --- a/packages/effect/test/unstable/ai/utils.ts +++ b/packages/effect/test/unstable/ai/utils.ts @@ -1,5 +1,4 @@ -import { Effect, Stream } from "effect" -import { Predicate } from "effect/data" +import { Effect, Predicate, Stream } from "effect" import { dual } from "effect/Function" import type { Response } from "effect/unstable/ai" import { LanguageModel } from "effect/unstable/ai" diff --git a/packages/effect/test/unstable/cli/Arguments.test.ts b/packages/effect/test/unstable/cli/Arguments.test.ts index 47f8087be5..59da5a89ef 100644 --- a/packages/effect/test/unstable/cli/Arguments.test.ts +++ b/packages/effect/test/unstable/cli/Arguments.test.ts @@ -1,6 +1,5 @@ import { assert, describe, expect, it } from "@effect/vitest" -import { Effect, Layer, Ref } from "effect" -import { Option, Result } from "effect/data" +import { Effect, Layer, Option, Ref, Result } from "effect" import { FileSystem, Path, PlatformError } from "effect/platform" import { TestConsole } from "effect/testing" import { Argument, CliOutput, Command, Flag } from "effect/unstable/cli" diff --git a/packages/effect/test/unstable/cli/Command.test.ts b/packages/effect/test/unstable/cli/Command.test.ts index b2838d3685..d172962ac0 100644 --- a/packages/effect/test/unstable/cli/Command.test.ts +++ b/packages/effect/test/unstable/cli/Command.test.ts @@ -1,6 +1,5 @@ import { assert, describe, expect, it } from "@effect/vitest" -import { Effect, Layer } from "effect" -import { Option } from "effect/data" +import { Effect, Layer, Option } from "effect" import { FileSystem, Path } from "effect/platform" import { TestConsole } from "effect/testing" import { Argument, CliOutput, Command, Flag } from "effect/unstable/cli" diff --git a/packages/effect/test/unstable/cli/Primitive.test.ts b/packages/effect/test/unstable/cli/Primitive.test.ts index 9add6ee623..30f7e6d39a 100644 --- a/packages/effect/test/unstable/cli/Primitive.test.ts +++ b/packages/effect/test/unstable/cli/Primitive.test.ts @@ -1,6 +1,5 @@ import { assert, describe, it } from "@effect/vitest" -import { Effect, Layer } from "effect" -import { Redacted } from "effect/data" +import { Effect, Layer, Redacted } from "effect" import { FileSystem, Path, PlatformError } from "effect/platform" import { Primitive } from "effect/unstable/cli" diff --git a/packages/effect/test/unstable/cli/fixtures/ComprehensiveCli.ts b/packages/effect/test/unstable/cli/fixtures/ComprehensiveCli.ts index 1dc32f222c..b4a7089cf8 100644 --- a/packages/effect/test/unstable/cli/fixtures/ComprehensiveCli.ts +++ b/packages/effect/test/unstable/cli/fixtures/ComprehensiveCli.ts @@ -1,5 +1,4 @@ -import { Effect } from "effect" -import { Option } from "effect/data" +import { Effect, Option } from "effect" import { Argument, Command, Flag } from "effect/unstable/cli" import type { TestActions } from "../services/TestActions.ts" import { logAction } from "../services/TestActions.ts" diff --git a/packages/effect/test/unstable/observability/OtlpMetrics.test.ts b/packages/effect/test/unstable/observability/OtlpMetrics.test.ts index bde1d6ff96..b3a97b3938 100644 --- a/packages/effect/test/unstable/observability/OtlpMetrics.test.ts +++ b/packages/effect/test/unstable/observability/OtlpMetrics.test.ts @@ -1,7 +1,6 @@ import { assert, describe, it } from "@effect/vitest" -import { Effect, Layer, Metric, Ref, ServiceMap } from "effect" +import { Effect, Layer, Metric, Predicate, Ref, ServiceMap } from "effect" import { Array } from "effect/collections" -import { Predicate } from "effect/data" import { TestClock } from "effect/testing" import { HttpClient, type HttpClientError, HttpClientResponse } from "effect/unstable/http" import { OtlpMetrics } from "effect/unstable/observability" diff --git a/packages/effect/test/unstable/persistence/KeyValueStore.test.ts b/packages/effect/test/unstable/persistence/KeyValueStore.test.ts index db3cb72ad0..e479d0ac8b 100644 --- a/packages/effect/test/unstable/persistence/KeyValueStore.test.ts +++ b/packages/effect/test/unstable/persistence/KeyValueStore.test.ts @@ -1,8 +1,7 @@ import { afterEach, describe, it } from "@effect/vitest" import { assertTrue, deepStrictEqual, strictEqual } from "@effect/vitest/utils" import type { Layer } from "effect" -import { Effect } from "effect" -import { Option } from "effect/data" +import { Effect, Option } from "effect" import { Schema } from "effect/schema" import * as KeyValueStore from "effect/unstable/persistence/KeyValueStore" diff --git a/packages/effect/test/utils/assert.ts b/packages/effect/test/utils/assert.ts index e5a92ebe39..3b802f5ae4 100644 --- a/packages/effect/test/utils/assert.ts +++ b/packages/effect/test/utils/assert.ts @@ -1,5 +1,5 @@ import type { Cause } from "effect" -import { Option, Predicate, Result } from "effect/data" +import { Option, Predicate, Result } from "effect" import * as Exit from "effect/Exit" import { Equal } from "effect/interfaces" import * as assert from "node:assert" diff --git a/packages/platform-browser/src/Clipboard.ts b/packages/platform-browser/src/Clipboard.ts index 1fdbff7c29..3a9f5370df 100644 --- a/packages/platform-browser/src/Clipboard.ts +++ b/packages/platform-browser/src/Clipboard.ts @@ -1,7 +1,7 @@ /** * @since 1.0.0 */ -import * as Data from "effect/data/Data" +import * as Data from "effect/Data" import * as Effect from "effect/Effect" import * as Layer from "effect/Layer" import * as ServiceMap from "effect/ServiceMap" diff --git a/packages/platform-browser/src/Geolocation.ts b/packages/platform-browser/src/Geolocation.ts index bd88b403cc..e6bba4c7da 100644 --- a/packages/platform-browser/src/Geolocation.ts +++ b/packages/platform-browser/src/Geolocation.ts @@ -1,7 +1,7 @@ /** * @since 1.0.0 */ -import * as Data from "effect/data/Data" +import * as Data from "effect/Data" import * as Effect from "effect/Effect" import * as Exit from "effect/Exit" import * as Layer from "effect/Layer" diff --git a/packages/platform-browser/src/Permissions.ts b/packages/platform-browser/src/Permissions.ts index 8ae83a0d9f..5cb97a406c 100644 --- a/packages/platform-browser/src/Permissions.ts +++ b/packages/platform-browser/src/Permissions.ts @@ -1,7 +1,7 @@ /** * @since 1.0.0 */ -import * as Data from "effect/data/Data" +import * as Data from "effect/Data" import * as Effect from "effect/Effect" import * as Layer from "effect/Layer" import * as ServiceMap from "effect/ServiceMap" diff --git a/packages/platform-browser/test/fixtures/rpc-e2e.ts b/packages/platform-browser/test/fixtures/rpc-e2e.ts index fe506e26f7..75df6637a4 100644 --- a/packages/platform-browser/test/fixtures/rpc-e2e.ts +++ b/packages/platform-browser/test/fixtures/rpc-e2e.ts @@ -1,6 +1,5 @@ import { assert, describe, it } from "@effect/vitest" -import { Cause, Effect, Fiber, ServiceMap, Stream } from "effect" -import { Option } from "effect/data" +import { Cause, Effect, Fiber, Option, ServiceMap, Stream } from "effect" // @ts-ignore // eslint-disable-next-line @typescript-eslint/no-unused-vars import { NodeInspectSymbol } from "effect/interfaces/Inspectable" diff --git a/packages/platform-browser/test/fixtures/rpc-schemas.ts b/packages/platform-browser/test/fixtures/rpc-schemas.ts index b4cd3beede..86aa65748d 100644 --- a/packages/platform-browser/test/fixtures/rpc-schemas.ts +++ b/packages/platform-browser/test/fixtures/rpc-schemas.ts @@ -1,5 +1,4 @@ -import { Effect, Layer, Metric, Queue, ServiceMap } from "effect" -import { Option } from "effect/data" +import { Effect, Layer, Metric, Option, Queue, ServiceMap } from "effect" import { Schema } from "effect/schema" import { Headers } from "effect/unstable/http" import * as Rpc from "effect/unstable/rpc/Rpc" diff --git a/packages/platform-bun/src/BunHttpServer.ts b/packages/platform-bun/src/BunHttpServer.ts index 67b9b08036..e2fc7c6ba5 100644 --- a/packages/platform-bun/src/BunHttpServer.ts +++ b/packages/platform-bun/src/BunHttpServer.ts @@ -4,7 +4,6 @@ import type { Server as BunServer, ServerWebSocket } from "bun" import * as Config from "effect/Config" import type { ConfigError } from "effect/Config" -import type * as Record from "effect/data/Record" import * as Deferred from "effect/Deferred" import * as Effect from "effect/Effect" import * as Exit from "effect/Exit" @@ -14,6 +13,7 @@ import * as Inspectable from "effect/interfaces/Inspectable" import * as Layer from "effect/Layer" import type * as FileSystem from "effect/platform/FileSystem" import type * as Path from "effect/platform/Path" +import type * as Record from "effect/Record" import type * as Scope from "effect/Scope" import * as ServiceMap from "effect/ServiceMap" import * as Stream from "effect/Stream" diff --git a/packages/platform-node-shared/src/NodeChildProcessSpawner.ts b/packages/platform-node-shared/src/NodeChildProcessSpawner.ts index 2bd987f451..a6758aec94 100644 --- a/packages/platform-node-shared/src/NodeChildProcessSpawner.ts +++ b/packages/platform-node-shared/src/NodeChildProcessSpawner.ts @@ -4,7 +4,6 @@ * @since 4.0.0 */ import type * as Arr from "effect/collections/Array" -import * as Predicate from "effect/data/Predicate" import * as Deferred from "effect/Deferred" import * as Effect from "effect/Effect" import * as Exit from "effect/Exit" @@ -13,6 +12,7 @@ import * as Layer from "effect/Layer" import * as FileSystem from "effect/platform/FileSystem" import * as Path from "effect/platform/Path" import type * as PlatformError from "effect/platform/PlatformError" +import * as Predicate from "effect/Predicate" import type * as Scope from "effect/Scope" import * as Sink from "effect/Sink" import * as Stream from "effect/Stream" diff --git a/packages/platform-node-shared/src/NodeFileSystem.ts b/packages/platform-node-shared/src/NodeFileSystem.ts index 9084b0a616..e7c8f251aa 100644 --- a/packages/platform-node-shared/src/NodeFileSystem.ts +++ b/packages/platform-node-shared/src/NodeFileSystem.ts @@ -1,12 +1,12 @@ /** * @since 1.0.0 */ -import * as Option from "effect/data/Option" import * as Effect from "effect/Effect" import { effectify } from "effect/Effect" import * as Exit from "effect/Exit" import { pipe } from "effect/Function" import * as Layer from "effect/Layer" +import * as Option from "effect/Option" import * as FileSystem from "effect/platform/FileSystem" import * as Error from "effect/platform/PlatformError" import * as Queue from "effect/Queue" diff --git a/packages/platform-node-shared/src/NodeTerminal.ts b/packages/platform-node-shared/src/NodeTerminal.ts index 40a5be4a4c..57e6945246 100644 --- a/packages/platform-node-shared/src/NodeTerminal.ts +++ b/packages/platform-node-shared/src/NodeTerminal.ts @@ -1,12 +1,12 @@ /** * @since 1.0.0 */ -import * as Predicate from "effect/data/Predicate" import * as Effect from "effect/Effect" import * as Exit from "effect/Exit" import * as Layer from "effect/Layer" import * as PlatformError from "effect/platform/PlatformError" import * as Terminal from "effect/platform/Terminal" +import * as Predicate from "effect/Predicate" import * as Queue from "effect/Queue" import * as RcRef from "effect/RcRef" import type * as Scope from "effect/Scope" diff --git a/packages/platform-node-shared/test/NodeFileSystem.test.ts b/packages/platform-node-shared/test/NodeFileSystem.test.ts index 4eb762db14..88277e4c7a 100644 --- a/packages/platform-node-shared/test/NodeFileSystem.test.ts +++ b/packages/platform-node-shared/test/NodeFileSystem.test.ts @@ -1,7 +1,7 @@ import * as NodeFileSystem from "@effect/platform-node-shared/NodeFileSystem" import { assert, describe, expect, it } from "@effect/vitest" +import { Option } from "effect" import { Array } from "effect/collections" -import { Option } from "effect/data" import * as Effect from "effect/Effect" import * as Fs from "effect/platform/FileSystem" import * as Stream from "effect/Stream" diff --git a/packages/platform-node-shared/test/NodeSink.test.ts b/packages/platform-node-shared/test/NodeSink.test.ts index ef3158eca4..7e2f957191 100644 --- a/packages/platform-node-shared/test/NodeSink.test.ts +++ b/packages/platform-node-shared/test/NodeSink.test.ts @@ -2,7 +2,7 @@ import * as NodeSink from "@effect/platform-node-shared/NodeSink" import * as NodeStream from "@effect/platform-node-shared/NodeStream" import { assert, describe, it } from "@effect/vitest" import { Effect } from "effect" -import * as Data from "effect/data/Data" +import * as Data from "effect/Data" import * as Queue from "effect/Queue" import * as Stream from "effect/Stream" import { createReadStream } from "fs" diff --git a/packages/platform-node/src/NodeHttpServer.ts b/packages/platform-node/src/NodeHttpServer.ts index 0028343a24..589ac1ccda 100644 --- a/packages/platform-node/src/NodeHttpServer.ts +++ b/packages/platform-node/src/NodeHttpServer.ts @@ -3,13 +3,13 @@ */ import * as Cause from "effect/Cause" import * as Config from "effect/Config" -import type * as Record from "effect/data/Record" import * as Effect from "effect/Effect" import * as Fiber from "effect/Fiber" import type { LazyArg } from "effect/Function" import * as Layer from "effect/Layer" import type * as FileSystem from "effect/platform/FileSystem" import type * as Path from "effect/platform/Path" +import type * as Record from "effect/Record" import * as Scope from "effect/Scope" import * as ServiceMap from "effect/ServiceMap" import * as Stream from "effect/Stream" diff --git a/packages/platform-node/test/HttpApi.test.ts b/packages/platform-node/test/HttpApi.test.ts index ee8a2d5d99..f5a32be752 100644 --- a/packages/platform-node/test/HttpApi.test.ts +++ b/packages/platform-node/test/HttpApi.test.ts @@ -1,8 +1,7 @@ import { NodeHttpServer } from "@effect/platform-node" import { assert, describe, it } from "@effect/vitest" -import { DateTime, Effect, Layer, Ref, ServiceMap, Stream } from "effect" +import { DateTime, Effect, Filter, Layer, Redacted, Ref, ServiceMap, Stream, Struct } from "effect" import { Array } from "effect/collections" -import { Filter, Redacted, Struct } from "effect/data" import { FileSystem } from "effect/platform" import { Getter, Schema, Transformation } from "effect/schema" import { diff --git a/packages/platform-node/test/NodeHttpClient.test.ts b/packages/platform-node/test/NodeHttpClient.test.ts index 7d05989392..f2e626068c 100644 --- a/packages/platform-node/test/NodeHttpClient.test.ts +++ b/packages/platform-node/test/NodeHttpClient.test.ts @@ -1,6 +1,6 @@ import * as NodeClient from "@effect/platform-node/NodeHttpClient" import { describe, expect, it } from "@effect/vitest" -import { Struct } from "effect/data" +import { Struct } from "effect" import * as Effect from "effect/Effect" import * as Layer from "effect/Layer" import * as Schema from "effect/schema/Schema" diff --git a/packages/platform-node/test/fixtures/mysql2-utils.ts b/packages/platform-node/test/fixtures/mysql2-utils.ts index 0a782f9346..b6552d3503 100644 --- a/packages/platform-node/test/fixtures/mysql2-utils.ts +++ b/packages/platform-node/test/fixtures/mysql2-utils.ts @@ -1,8 +1,7 @@ import { MysqlClient } from "@effect/sql-mysql2" import type { StartedMySqlContainer } from "@testcontainers/mysql" import { MySqlContainer } from "@testcontainers/mysql" -import { Effect, Layer, ServiceMap, String } from "effect" -import { Data, Redacted } from "effect/data" +import { Data, Effect, Layer, Redacted, ServiceMap, String } from "effect" export class ContainerError extends Data.TaggedError("ContainerError")<{ cause: unknown diff --git a/packages/platform-node/test/fixtures/pg-utils.ts b/packages/platform-node/test/fixtures/pg-utils.ts index 901239baf7..11e22dc98f 100644 --- a/packages/platform-node/test/fixtures/pg-utils.ts +++ b/packages/platform-node/test/fixtures/pg-utils.ts @@ -1,7 +1,6 @@ import { PgClient } from "@effect/sql-pg" import { PostgreSqlContainer } from "@testcontainers/postgresql" -import { Effect, Layer, ServiceMap, String } from "effect" -import { Data, Redacted } from "effect/data" +import { Data, Effect, Layer, Redacted, ServiceMap, String } from "effect" export class ContainerError extends Data.TaggedError("ContainerError")<{ cause: unknown diff --git a/packages/platform-node/test/fixtures/rpc-e2e.ts b/packages/platform-node/test/fixtures/rpc-e2e.ts index fe506e26f7..75df6637a4 100644 --- a/packages/platform-node/test/fixtures/rpc-e2e.ts +++ b/packages/platform-node/test/fixtures/rpc-e2e.ts @@ -1,6 +1,5 @@ import { assert, describe, it } from "@effect/vitest" -import { Cause, Effect, Fiber, ServiceMap, Stream } from "effect" -import { Option } from "effect/data" +import { Cause, Effect, Fiber, Option, ServiceMap, Stream } from "effect" // @ts-ignore // eslint-disable-next-line @typescript-eslint/no-unused-vars import { NodeInspectSymbol } from "effect/interfaces/Inspectable" diff --git a/packages/platform-node/test/fixtures/rpc-schemas.ts b/packages/platform-node/test/fixtures/rpc-schemas.ts index b4cd3beede..86aa65748d 100644 --- a/packages/platform-node/test/fixtures/rpc-schemas.ts +++ b/packages/platform-node/test/fixtures/rpc-schemas.ts @@ -1,5 +1,4 @@ -import { Effect, Layer, Metric, Queue, ServiceMap } from "effect" -import { Option } from "effect/data" +import { Effect, Layer, Metric, Option, Queue, ServiceMap } from "effect" import { Schema } from "effect/schema" import { Headers } from "effect/unstable/http" import * as Rpc from "effect/unstable/rpc/Rpc" diff --git a/packages/sql/d1/test/utils.ts b/packages/sql/d1/test/utils.ts index 852b9068bf..f46627de4b 100644 --- a/packages/sql/d1/test/utils.ts +++ b/packages/sql/d1/test/utils.ts @@ -1,7 +1,6 @@ import type { D1Database } from "@cloudflare/workers-types" import { D1Client } from "@effect/sql-d1" -import { Effect, Layer, ServiceMap } from "effect" -import { Data } from "effect/data" +import { Data, Effect, Layer, ServiceMap } from "effect" import { Miniflare } from "miniflare" export class MiniflareError extends Data.TaggedError("MiniflareError")<{ diff --git a/packages/sql/libsql/src/LibsqlClient.ts b/packages/sql/libsql/src/LibsqlClient.ts index ee54021deb..fee1dee40e 100644 --- a/packages/sql/libsql/src/LibsqlClient.ts +++ b/packages/sql/libsql/src/LibsqlClient.ts @@ -3,10 +3,10 @@ */ import * as Libsql from "@libsql/client" import * as Config from "effect/Config" -import * as Option from "effect/data/Option" -import * as Redacted from "effect/data/Redacted" import * as Effect from "effect/Effect" import * as Layer from "effect/Layer" +import * as Option from "effect/Option" +import * as Redacted from "effect/Redacted" import * as Scope from "effect/Scope" import * as ServiceMap from "effect/ServiceMap" import * as Stream from "effect/Stream" diff --git a/packages/sql/mssql/src/MssqlClient.ts b/packages/sql/mssql/src/MssqlClient.ts index 7b362e75b9..c407aa1839 100644 --- a/packages/sql/mssql/src/MssqlClient.ts +++ b/packages/sql/mssql/src/MssqlClient.ts @@ -2,12 +2,12 @@ * @since 1.0.0 */ import * as Config from "effect/Config" -import * as Redacted from "effect/data/Redacted" import * as Duration from "effect/Duration" import * as Effect from "effect/Effect" import { identity } from "effect/Function" import * as Layer from "effect/Layer" import * as Pool from "effect/Pool" +import * as Redacted from "effect/Redacted" import * as Scope from "effect/Scope" import * as ServiceMap from "effect/ServiceMap" import * as Stream from "effect/Stream" diff --git a/packages/sql/mysql2/src/MysqlClient.ts b/packages/sql/mysql2/src/MysqlClient.ts index 3033e2f2d3..5cecfebdf9 100644 --- a/packages/sql/mysql2/src/MysqlClient.ts +++ b/packages/sql/mysql2/src/MysqlClient.ts @@ -2,10 +2,10 @@ * @since 1.0.0 */ import * as Config from "effect/Config" -import * as Redacted from "effect/data/Redacted" import * as Duration from "effect/Duration" import * as Effect from "effect/Effect" import * as Layer from "effect/Layer" +import * as Redacted from "effect/Redacted" import type { Scope } from "effect/Scope" import * as ServiceMap from "effect/ServiceMap" import * as Stream from "effect/Stream" diff --git a/packages/sql/mysql2/test/utils.ts b/packages/sql/mysql2/test/utils.ts index 0a782f9346..b6552d3503 100644 --- a/packages/sql/mysql2/test/utils.ts +++ b/packages/sql/mysql2/test/utils.ts @@ -1,8 +1,7 @@ import { MysqlClient } from "@effect/sql-mysql2" import type { StartedMySqlContainer } from "@testcontainers/mysql" import { MySqlContainer } from "@testcontainers/mysql" -import { Effect, Layer, ServiceMap, String } from "effect" -import { Data, Redacted } from "effect/data" +import { Data, Effect, Layer, Redacted, ServiceMap, String } from "effect" export class ContainerError extends Data.TaggedError("ContainerError")<{ cause: unknown diff --git a/packages/sql/pg/src/PgClient.ts b/packages/sql/pg/src/PgClient.ts index bb67403cfc..b6f8342a5d 100644 --- a/packages/sql/pg/src/PgClient.ts +++ b/packages/sql/pg/src/PgClient.ts @@ -4,7 +4,6 @@ import * as Channel from "effect/Channel" import * as Arr from "effect/collections/Array" import * as Config from "effect/Config" -import * as Redacted from "effect/data/Redacted" import * as Duration from "effect/Duration" import * as Effect from "effect/Effect" import * as Fiber from "effect/Fiber" @@ -13,6 +12,7 @@ import * as Number from "effect/Number" import * as Pull from "effect/Pull" import * as Queue from "effect/Queue" import * as RcRef from "effect/RcRef" +import * as Redacted from "effect/Redacted" import * as Scope from "effect/Scope" import * as ServiceMap from "effect/ServiceMap" import * as Stream from "effect/Stream" diff --git a/packages/sql/pg/test/Client.test.ts b/packages/sql/pg/test/Client.test.ts index 4d0337bd10..580ae39788 100644 --- a/packages/sql/pg/test/Client.test.ts +++ b/packages/sql/pg/test/Client.test.ts @@ -1,7 +1,6 @@ import { PgClient } from "@effect/sql-pg" import { assert, expect, it } from "@effect/vitest" -import { Effect, Stream, String } from "effect" -import { Redacted } from "effect/data" +import { Effect, Redacted, Stream, String } from "effect" import { TestClock } from "effect/testing" import { SqlClient } from "effect/unstable/sql" import * as Statement from "effect/unstable/sql/Statement" diff --git a/packages/sql/pg/test/utils.ts b/packages/sql/pg/test/utils.ts index 901239baf7..11e22dc98f 100644 --- a/packages/sql/pg/test/utils.ts +++ b/packages/sql/pg/test/utils.ts @@ -1,7 +1,6 @@ import { PgClient } from "@effect/sql-pg" import { PostgreSqlContainer } from "@testcontainers/postgresql" -import { Effect, Layer, ServiceMap, String } from "effect" -import { Data, Redacted } from "effect/data" +import { Data, Effect, Layer, Redacted, ServiceMap, String } from "effect" export class ContainerError extends Data.TaggedError("ContainerError")<{ cause: unknown diff --git a/packages/tools/openapi-generator/src/OpenApiGenerator.ts b/packages/tools/openapi-generator/src/OpenApiGenerator.ts index 92e5af8d6e..3cd99511de 100644 --- a/packages/tools/openapi-generator/src/OpenApiGenerator.ts +++ b/packages/tools/openapi-generator/src/OpenApiGenerator.ts @@ -1,6 +1,6 @@ -import * as Predicate from "effect/data/Predicate" import * as Effect from "effect/Effect" import * as Layer from "effect/Layer" +import * as Predicate from "effect/Predicate" import type * as Schema from "effect/schema/Schema" import * as ServiceMap from "effect/ServiceMap" import * as String from "effect/String" diff --git a/packages/tools/openapi-generator/src/OpenApiTransformer.ts b/packages/tools/openapi-generator/src/OpenApiTransformer.ts index d3d9933aaf..f01dc30fa0 100644 --- a/packages/tools/openapi-generator/src/OpenApiTransformer.ts +++ b/packages/tools/openapi-generator/src/OpenApiTransformer.ts @@ -1,5 +1,5 @@ -import * as Predicate from "effect/data/Predicate" import * as Layer from "effect/Layer" +import * as Predicate from "effect/Predicate" import * as ServiceMap from "effect/ServiceMap" import type { OpenAPISpecMethodName } from "effect/unstable/httpapi/OpenApi" import type { ParsedOperation } from "./ParsedOperation.ts" @@ -199,7 +199,7 @@ export const make = ( return OpenApiTransformer.of({ imports: (importName) => [ - `import * as Data from "effect/data/Data"`, + `import * as Data from "effect/Data"`, `import * as Effect from "effect/Effect"`, `import type { SchemaError } from "effect/schema/Schema"`, `import * as ${importName} from "effect/schema/Schema"`, @@ -404,7 +404,7 @@ export const make = ( return OpenApiTransformer.of({ imports: (_importName) => [ - `import * as Data from "effect/data/Data"`, + `import * as Data from "effect/Data"`, `import * as Effect from "effect/Effect"`, `import type * as HttpClient from "effect/unstable/http/HttpClient"`, `import * as HttpClientError from "effect/unstable/http/HttpClientError"`, diff --git a/packages/tools/openapi-generator/src/Utils.ts b/packages/tools/openapi-generator/src/Utils.ts index 0ddcb2dc01..32f548d1a2 100644 --- a/packages/tools/openapi-generator/src/Utils.ts +++ b/packages/tools/openapi-generator/src/Utils.ts @@ -1,5 +1,5 @@ -import * as UndefinedOr from "effect/data/UndefinedOr" import * as String from "effect/String" +import * as UndefinedOr from "effect/UndefinedOr" export const camelize = (self: string): string => { let str = "" diff --git a/packages/vitest/src/internal/internal.ts b/packages/vitest/src/internal/internal.ts index 6675ad3a97..d5af051986 100644 --- a/packages/vitest/src/internal/internal.ts +++ b/packages/vitest/src/internal/internal.ts @@ -3,12 +3,12 @@ */ import * as Cause from "effect/Cause" -import { isObject } from "effect/data/Predicate" import * as Duration from "effect/Duration" import * as Effect from "effect/Effect" import * as Exit from "effect/Exit" import { flow, pipe } from "effect/Function" import * as Layer from "effect/Layer" +import { isObject } from "effect/Predicate" import * as Schedule from "effect/Schedule" import * as Schema from "effect/schema/Schema" import * as Scope from "effect/Scope" diff --git a/packages/vitest/src/utils.ts b/packages/vitest/src/utils.ts index ef2b7a695f..5be8140fcc 100644 --- a/packages/vitest/src/utils.ts +++ b/packages/vitest/src/utils.ts @@ -2,11 +2,11 @@ * @since 4.0.0 */ import type * as Cause from "effect/Cause" -import * as Option from "effect/data/Option" -import * as Predicate from "effect/data/Predicate" -import * as Result from "effect/data/Result" import * as Exit from "effect/Exit" import * as Equal from "effect/interfaces/Equal" +import * as Option from "effect/Option" +import * as Predicate from "effect/Predicate" +import * as Result from "effect/Result" import * as assert from "node:assert" import { assert as vassert } from "vitest"