/auxlib

An Aiken auxiliary library

Primary LanguageShellApache License 2.0Apache-2.0

auxlib

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 ✔️

History

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}.