mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
Add Num.log and wire it up
This commit is contained in:
parent
47ddfd2639
commit
928249df2a
6 changed files with 130 additions and 59 deletions
|
@ -430,6 +430,20 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
|
|||
),
|
||||
);
|
||||
|
||||
// log : Float a -> Float a
|
||||
let log_of_negative = SolvedType::TagUnion(
|
||||
vec![(TagName::Global("LogOfNegative".into()), vec![])],
|
||||
Box::new(SolvedType::Wildcard),
|
||||
);
|
||||
|
||||
add_type(
|
||||
Symbol::NUM_LOG,
|
||||
top_level_function(
|
||||
vec![float_type(flex(TVAR1))],
|
||||
Box::new(result_type(float_type(flex(TVAR1)), log_of_negative)),
|
||||
),
|
||||
);
|
||||
|
||||
// round : Float a -> Int b
|
||||
add_type(
|
||||
Symbol::NUM_ROUND,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue