Add Num.atan builtin

This commit is contained in:
Jared Ramirez 2020-09-22 16:42:53 -07:00
parent 979c0282ef
commit 5cafbcd5ad
12 changed files with 260 additions and 4 deletions

View file

@ -456,6 +456,12 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
SolvedType::Func(vec![float_type()], Box::new(int_type())),
);
// atan : Float -> Float
add_type(
Symbol::NUM_ATAN,
SolvedType::Func(vec![float_type()], Box::new(float_type())),
);
// Bool module
// and : Bool, Bool -> Bool

View file

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