list.index_of
: For getting a values index in a list.transaction.placeholder
: For constructing test transactions.transaction.value.is_zero
: For checking whether a value is null.
value.to_minted_value
now correctly preserves the invariant ofMintedValue
: it always contain a null quantity of Ada.
N/A
math.pow2
: For faster exponentions for powers of two.bytearray.test_bit
: For testing if a bit is set in a bytearray (MSB).
- retired
list.and
andlist.or
because of the new keywords for logical op chaining.
- Fixed missing null-check on
value.add
. Adding a null quantity of token is now correctly a no-op.
math.sqrt
: For calculating integer square roots using a quadratically convergent method.math/rational.numerator
&math/rational.denominator
: For accessing parts of a rational value.math/rational.arithmetic_mean
: For computing arithmetic mean of rational values.math/rational.geometric_mean
: For computing geometric mean of two rational values.
- Clear empty asset lists in
Value
on various operations. Before that fix, it could happen that removing all assets from a given policy would lead to an empty dictionnary of assets still be present in theValue
.
transaction/value.MintedValue
transaction/value.from_minted_value
: Convert fromMintedValue
toValue
transaction/value.to_minted_value
: Convert fromValue
toMintedValue
transaction/bytearray.to_hex
: Convert aByteArray
to a hex encodedString
math/rational
: Working with rational numbers.-
abs
-
add
-
ceil
-
compare
-
compare_with
-
div
-
floor
-
from_int
-
mul
-
negate
-
new
-
proper_fraction
-
reciprocal
-
reduce
-
round
-
round_even
-
sub
-
truncate
-
zero
-
- module
MintedValue
was merged withValue
-
list.count
: Count how many items in the list satisfy the given predicate. -
int.from_utf8
: Parse an integer from a utf-8 encodedByteArray
, when possible. -
dict.foldl
&dict.foldr
: for left and right folds over dictionnary elements in ascending key order. -
dict.insert_with
: Insert a value in the dictionary at a given key. When the key already exist, the provided merge function is called. -
transaction/value.add
: Add a (positive or negative) quantity of a single token to a value. This is more efficient thanmerge
for a single asset. -
transaction/value.to_dict
: Convert aValue
into a dictionnary of dictionnaries. -
A new module
transaction/minted_value
: This is used exclusively for representing values present in themint
field of transactions. This allows to simplify some of the implementation forValue
which no longer needs to handle the special case where null-quantity tokens would be present. It isn't possible to constructMintedValue
by hand, they come from the script context entirely and are 'read-only'. -
More documentation for
dict
andinterval
modules.
Warning
Most of those changes are breaking-changes. Though, given we're still in an alpha state, only the
minor
component is bumped from the version number. Please forgive us.
-
Rework
list.{foldl, foldr, reduce, indexed_foldr}
,dict.{fold}
,bytearray.{foldl, foldr, reduce}
to take the iterator as last argument. For example:fn foldl(self: List<a>, with: fn(a, b) -> b, zero: b) -> b ↓ becomes fn foldl(self: List<a>, zero: b, with: fn(a, b) -> b) -> b
-
Fixed implementation of
bytearray.slice
;slice
would otherwise behave as if the second argument were an offset. -
Rename
transaction/value.add
intotransaction/value.merge
. -
Swap arguments of the merge function in
dict.union_with
; the first value received now corresponds to the value already present in the dictionnary. -
Fixed various examples from the documentation
- Removed
dict.fold
; replaced withdict.foldl
anddict.foldr
to remove ambiguity.
N/A
N/A
N/A