Skip to content

Commit

Permalink
Merge pull request #4 from aiken-lang/fuzz
Browse files Browse the repository at this point in the history
Add Fuzzer & PRNG to the prelude.
  • Loading branch information
KtorZ committed Mar 3, 2024
2 parents 721053a + 5b94e7c commit 26ca815
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lib/aiken.ak
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,23 @@ pub type Option<a> {
None
}

/// <small>Minimum Plutus Version</small> | <small>1</small>
/// --- | ---
///
/// A type that represent Pseudo-random generated values.
pub type PRNG {
Seeded { seed: Int, choices: List<Int> }
Replayed { choices: List<Int> }
}

/// <small>Minimum Plutus Version</small> | <small>1</small>
/// --- | ---
///
/// A type to capture random computation that may depend on one another. Useful
/// for constructing (pseudo-)random values for property-based test.
pub type Fuzzer<a> =
fn(PRNG) -> Option<(PRNG, a)>

/// <small>Minimum Plutus Version</small> | <small>1</small>
/// --- | ---
///
Expand Down

0 comments on commit 26ca815

Please sign in to comment.