feat(builtins): Num.acos : Float -> Float

This commit is contained in:
lrosa007 2020-11-01 09:27:42 -05:00
parent 00445b3bc6
commit 4da2d7f101
9 changed files with 46 additions and 2 deletions

View file

@ -17,6 +17,7 @@ pub fn get_bytes() -> Vec<u8> {
buffer
}
pub const MATH_ACOS: &str = "roc_builtins.math.acos";
pub const MATH_ATAN: &str = "roc_builtins.math.atan";
pub const MATH_IS_FINITE: &str = "roc_builtins.math.is_finite";
pub const MATH_POW_INT: &str = "roc_builtins.math.pow_int";

View file

@ -350,6 +350,12 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
top_level_function(vec![float_type()], Box::new(float_type())),
);
// acos : Float -> Float
add_type(
Symbol::NUM_ACOS,
top_level_function(vec![float_type()], Box::new(float_type())),
);
// Bool module
// and : Bool, Bool -> Bool

View file

@ -375,6 +375,12 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
unique_function(vec![float_type(star1)], float_type(star2))
});
// acos : Float -> Float
add_type(Symbol::NUM_ACOS, {
let_tvars! { star1, star2 };
unique_function(vec![float_type(star1)], float_type(star2))
});
// Bool module
// isEq or (==) : Attr * a, Attr * a -> Attr * Bool