List.unreachable

This commit is contained in:
Folkert 2022-07-02 19:31:35 +02:00
parent 543615292a
commit 506e374642
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
7 changed files with 36 additions and 0 deletions

View file

@ -100,6 +100,7 @@ pub fn builtin_defs_map(symbol: Symbol, var_store: &mut VarStore) -> Option<Def>
STR_TO_I16 => str_to_num,
STR_TO_U8 => str_to_num,
STR_TO_I8 => str_to_num,
LIST_UNREACHABLE => roc_unreachable,
LIST_LEN => list_len,
LIST_WITH_CAPACITY => list_with_capacity,
LIST_GET_UNSAFE => list_get_unsafe,
@ -2475,6 +2476,11 @@ fn list_walk_until(symbol: Symbol, var_store: &mut VarStore) -> Def {
lowlevel_3(symbol, LowLevel::ListWalkUntil, var_store)
}
/// List.unreachable : [] -> a
fn roc_unreachable(symbol: Symbol, var_store: &mut VarStore) -> Def {
lowlevel_1(symbol, LowLevel::Unreachable, var_store)
}
/// List.map : List before, (before -> after) -> List after
fn list_map(symbol: Symbol, var_store: &mut VarStore) -> Def {
lowlevel_2(symbol, LowLevel::ListMap, var_store)