aiken

Types

Minimum Plutus Version1

A type for booleans values. See Primitive Types :: Bool for details.

Constructors

  • False
  • True
Minimum Plutus Version1

A type for representing bytes. See Primitive Types :: ByteArray for details.

Minimum Plutus Version1

A type for opaque Plutus data. See Primitive Types :: Data for details.

Minimum Plutus Version1

A type to capture random computation that may depend on one another. Useful for constructing (pseudo-)random values for property-based test.

Alias

Fuzzer<a> = fn(PRNG) -> Option<(PRNG, a)>
Minimum Plutus Version3

A type for representing G1 element of BLS12_381 curves.

Minimum Plutus Version3

A type for representing G2 element of BLS12_381 curves.

Minimum Plutus Version1

A type for signed integers. See Primitive Types :: Int for details.

Note: there’s no floating numbers in Aiken.

Minimum Plutus Version1

A type for generic lists. See Primitive Types :: List for details.

Minimum Plutus Version3

A type for representing Miller-loop results.

Minimum Plutus Version1

A type for returning optional results. See also stdlib/option.

Constructors

  • Some(a)
  • None
Minimum Plutus Version1

A type to compare values.

pub fn compare(left: Int, right: Int) -> Ordering {
  if left < right {
    Less
  } else if less > right {
    Greater
  } else {
    Equal
  }
}

Constructors

  • Less
  • Equal
  • Greater
Minimum Plutus Version1

A type that represent Pseudo-random generated values.

Constructors

  • Seeded { seed: Int, choices: List<Int> }
  • Replayed { choices: List<Int> }
Minimum Plutus Version1

A type for text strings. See Primitive Types :: String for details.

Minimum Plutus Version1

A type for nullary constructors. See Primitive Types :: Void for details.

Functions

always(a: a, b) -> a

Minimum Plutus Version1

A function that always return its first argument. Handy in folds and maps.

let always_14 = always(14, _)
always_14(42) == 14
always_14(1337) == 14
always_14(0) == 14

flip(f: fn(a, b) -> c) -> fn(b, a) -> c

Minimum Plutus Version1

A function that flips the arguments of a function.

pub fn titleize(left: String, right: String) {}

titleize("Hello", "World") // "Hello, World!"

flip(titleize)("Hello", "World") // "World, Hello!"

identity(a: a) -> a

Minimum Plutus Version1

A function that returns its argument. Handy as a default behavior sometimes.

not(self: Bool) -> Bool

Minimum Plutus Version1

Like !, but as a function. Handy for chaining using the pipe operator |> or to pass as a function.

Search Document