Remove Num.(min/max)Int

Replace all uses with `Num.(min/max)I64`,
since all uses expect an `I64`.
This commit is contained in:
Jan Van Bruggen 2022-01-17 21:19:34 -07:00
parent 3eb266c860
commit 8e4b6f0cab
10 changed files with 30 additions and 92 deletions

View file

@ -197,8 +197,6 @@ pub fn builtin_defs_map(symbol: Symbol, var_store: &mut VarStore) -> Option<Def>
NUM_ASIN => num_asin,
NUM_BYTES_TO_U16 => num_bytes_to_u16,
NUM_BYTES_TO_U32 => num_bytes_to_u32,
NUM_MAX_INT => num_max_int,
NUM_MIN_INT => num_min_int,
NUM_BITWISE_AND => num_bitwise_and,
NUM_BITWISE_XOR => num_bitwise_xor,
NUM_BITWISE_OR => num_bitwise_or,
@ -364,36 +362,6 @@ fn lowlevel_5(symbol: Symbol, op: LowLevel, var_store: &mut VarStore) -> Def {
)
}
/// Num.maxInt : Int
fn num_max_int(symbol: Symbol, var_store: &mut VarStore) -> Def {
let int_var = var_store.fresh();
let int_precision_var = var_store.fresh();
let body = int::<i64>(int_var, int_precision_var, i64::MAX);
Def {
annotation: None,
expr_var: int_var,
loc_expr: Loc::at_zero(body),
loc_pattern: Loc::at_zero(Pattern::Identifier(symbol)),
pattern_vars: SendMap::default(),
}
}
/// Num.minInt : Int
fn num_min_int(symbol: Symbol, var_store: &mut VarStore) -> Def {
let int_var = var_store.fresh();
let int_precision_var = var_store.fresh();
let body = int::<i64>(int_var, int_precision_var, i64::MIN);
Def {
annotation: None,
expr_var: int_var,
loc_expr: Loc::at_zero(body),
loc_pattern: Loc::at_zero(Pattern::Identifier(symbol)),
pattern_vars: SendMap::default(),
}
}
// Num.toStr : Num a -> Str
fn num_to_str(symbol: Symbol, var_store: &mut VarStore) -> Def {
let num_var = var_store.fresh();