mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 07:41:12 +00:00
Fix some missing unary Num operation types
This commit is contained in:
parent
35446348a3
commit
b3dfbeeec8
2 changed files with 60 additions and 0 deletions
|
@ -347,6 +347,36 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
|
|||
unique_function(vec![num_type(UVAR1, TVAR1)], float_type(UVAR2)),
|
||||
);
|
||||
|
||||
// isNegative : Num a -> Bool
|
||||
add_type(
|
||||
Symbol::NUM_IS_NEGATIVE,
|
||||
unique_function(vec![num_type(UVAR2, TVAR1)], bool_type(UVAR3)),
|
||||
);
|
||||
|
||||
// isPositive : Num a -> Bool
|
||||
add_type(
|
||||
Symbol::NUM_IS_POSITIVE,
|
||||
unique_function(vec![num_type(UVAR2, TVAR1)], bool_type(UVAR3)),
|
||||
);
|
||||
|
||||
// isZero : Num a -> Bool
|
||||
add_type(
|
||||
Symbol::NUM_IS_ZERO,
|
||||
unique_function(vec![num_type(UVAR2, TVAR1)], bool_type(UVAR3)),
|
||||
);
|
||||
|
||||
// isEven : Num a -> Bool
|
||||
add_type(
|
||||
Symbol::NUM_IS_EVEN,
|
||||
unique_function(vec![num_type(UVAR2, TVAR1)], bool_type(UVAR3)),
|
||||
);
|
||||
|
||||
// isOdd : Num a -> Bool
|
||||
add_type(
|
||||
Symbol::NUM_IS_ODD,
|
||||
unique_function(vec![num_type(UVAR2, TVAR1)], bool_type(UVAR3)),
|
||||
);
|
||||
|
||||
// rem : Int, Int -> Result Int [ DivByZero ]*
|
||||
add_type(
|
||||
Symbol::NUM_REM,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue