Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

aiken-extra/auxlib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

auxlib

Important

Deprecated in favor of aiken-extra/test_kit

An Aiken auxiliary library. Currently it contains some removed functions from stdlib, and additional stuffs.

ℹ️ Package info aiken-extra/auxlib v2.220.202501 🐞
🟢 Depends on aiken-lang/stdlib v2.2.0
🟢 Tested with aiken v1.1.9

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