import {option, liftArbitraries, tinyPositive, tinyIntegerArray} from 'effect-ts-laws'
import {OptionTypeLambda} from 'effect/Option'
import fc from 'fast-check'
const [positive, integerArray] = liftArbitraries<OptionTypeLambda>(
option,
)(
tinyPositive,
tinyIntegerArray,
)
// typeof positive ≡ fc.Arbitrary<Option<number>>
// typeof integerArray ≡ fc.Arbitrary<Option<readonly number[]>>
console.log(fc.sample(positive, {numRuns: 1}))
console.table(fc.sample(integerArray, {numRuns: 1}))
Given a LiftArbitrary function, and 1..n
Arbitrary
s for different typesA₁, A₂, ...Aₙ
, returns the given list except every arbitrary for typeAᵢ
has been replaced by an arbitrary for typeKind<F, R, O, E, Aᵢ>
. For example: