Skip to content

Commit

Permalink
Rewrite the Arbitrary compiler from scratch, closes #2312 (#4126)
Browse files Browse the repository at this point in the history
  • Loading branch information
gcanti authored Dec 12, 2024
1 parent 662d1ce commit 31c62d8
Show file tree
Hide file tree
Showing 7 changed files with 952 additions and 911 deletions.
5 changes: 5 additions & 0 deletions .changeset/thin-shoes-battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"effect": patch
---

Rewrite the Arbitrary compiler from scratch, closes #2312
31 changes: 29 additions & 2 deletions packages/effect/dtslint/Schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1370,14 +1370,17 @@ pipe(
) => true,
{
arbitrary: (
_from // $ExpectType LazyArbitrary<string>
_from, // $ExpectType LazyArbitrary<string>
_ctx // $ExpectType ArbitraryGenerationContext
) =>
(fc) => fc.string(),
pretty: (
_from // $ExpectType Pretty<string>
) =>
(s) => s,
equivalence: () =>
equivalence: (
_from // $ExpectType Equivalence<string>
) =>
(
_a, // $ExpectType string
_b // $ExpectType string
Expand All @@ -1386,6 +1389,30 @@ pipe(
)
)

pipe(
S.String,
S.filter((_s) => true)
).annotations({
arbitrary: (
// $ExpectType any[]
..._x
) =>
(fc) => fc.string(),
pretty: (
// $ExpectType any[]
..._x
) =>
(s) => s,
equivalence: (
// $ExpectType any[]
..._x
) =>
(
_a, // $ExpectType string
_b // $ExpectType string
) => true
})

// ---------------------------------------------
// filterEffect
// ---------------------------------------------
Expand Down
Loading

0 comments on commit 31c62d8

Please sign in to comment.