add ListIsUnique lowlevel operation

This commit is contained in:
Folkert 2022-05-06 13:56:35 +02:00
parent fcfe66f84d
commit 5755475b3a
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
9 changed files with 29 additions and 0 deletions

View file

@ -150,6 +150,7 @@ pub fn builtin_defs_map(symbol: Symbol, var_store: &mut VarStore) -> Option<Def>
LIST_ANY => list_any,
LIST_ALL => list_all,
LIST_FIND => list_find,
LIST_IS_UNIQUE => list_is_unique,
DICT_LEN => dict_len,
DICT_EMPTY => dict_empty,
DICT_SINGLE => dict_single,
@ -3773,6 +3774,11 @@ fn list_find(symbol: Symbol, var_store: &mut VarStore) -> Def {
)
}
/// List.isUnique : List * -> Bool
fn list_is_unique(symbol: Symbol, var_store: &mut VarStore) -> Def {
lowlevel_1(symbol, LowLevel::ListIsUnique, var_store)
}
/// Dict.len : Dict * * -> Nat
fn dict_len(symbol: Symbol, var_store: &mut VarStore) -> Def {
let arg1_var = var_store.fresh();