An Aiken auxiliary library. Currently it contains removed functions from stdlib
, and some minor additional stuffs.
ℹ️ | Package info | aiken-extra/auxlib v2.190.202405 | 🪲 |
---|---|---|---|
🟢 | Depends on | aiken-lang/stdlib v1.9.0 | ✔️ |
🟢 | Tested with | aiken v1.0.28-alpha | ✔️ |
-
v2.190.202405: Compiled using
aiken v1.0.28-alpha
-
v2.180.202403: Compiled using 21b1e29f09
-
v2.170.202312: Compiled using 07122aaa88
-
v2.170.202311: Use
stdlib v1.7.0
-
v2.160.202310: Add
collections.{zip3, unzip3}
-
v2.160.202309: Use
stdlib v1.6.0
-
v2.150.202308f: Compiled using 1715496d5b
-
v2.150.202308: In stdlib v1.5.0 the
list.{and,or}
were removed in favor of the new {and
,or
} blocks (see aiken v1.0.14-alpha release notes). Unfortunately currently there is no replacement to conveniently do the logicaland
|or
forList<Bool>
data-type variables, for example:
Previously we could just,
let list_variable = [True, True, True]
list.and(list_variable)
now if we try,
let list_variable = [True, True, True]
and { list_variable }
it will throw aiken::check::type_mismatch
:
× While trying to make sense of your code...
╰─▶ I struggled to unify the types of two expressions.
help: I am inferring the following type:
Bool
but I found an expression with a different type:
List<Bool>
Either, add type-annotation to improve my inference, or adjust the expression to have the expected type.
Summary
1 error, 0 warnings
It is possible to use list_variable |> all(identity)
from Prelude
, but it's not as clear as list.and
. Hence for the time being, this library offers the following solution:
use auxlib/collections.{list_and}
let list_variable = [True, True, True]
list_and(list_variable)
or alternatively,
use auxlib/logics.{all_true}
let list_variable = [True, True, True]
list_variable |> all_true
at least until they provide the replacements for list.{and,or}
.