mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 16:21:11 +00:00
make higher-order distinction in lowlevels
This commit is contained in:
parent
917acac843
commit
e675bac893
1 changed files with 97 additions and 0 deletions
|
@ -100,3 +100,100 @@ pub enum LowLevel {
|
||||||
Hash,
|
Hash,
|
||||||
ExpectTrue,
|
ExpectTrue,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl LowLevel {
|
||||||
|
pub fn is_higher_order_function(&self) -> bool {
|
||||||
|
use LowLevel::*;
|
||||||
|
|
||||||
|
match self {
|
||||||
|
StrConcat
|
||||||
|
| StrJoinWith
|
||||||
|
| StrIsEmpty
|
||||||
|
| StrStartsWith
|
||||||
|
| StrStartsWithCodePoint
|
||||||
|
| StrEndsWith
|
||||||
|
| StrSplit
|
||||||
|
| StrCountGraphemes
|
||||||
|
| StrFromInt
|
||||||
|
| StrFromUtf8
|
||||||
|
| StrToBytes
|
||||||
|
| StrFromFloat
|
||||||
|
| ListLen
|
||||||
|
| ListGetUnsafe
|
||||||
|
| ListSet
|
||||||
|
| ListSetInPlace
|
||||||
|
| ListSingle
|
||||||
|
| ListRepeat
|
||||||
|
| ListReverse
|
||||||
|
| ListConcat
|
||||||
|
| ListContains
|
||||||
|
| ListAppend
|
||||||
|
| ListPrepend
|
||||||
|
| ListJoin
|
||||||
|
| ListRange
|
||||||
|
| DictSize
|
||||||
|
| DictEmpty
|
||||||
|
| DictInsert
|
||||||
|
| DictRemove
|
||||||
|
| DictContains
|
||||||
|
| DictGetUnsafe
|
||||||
|
| DictKeys
|
||||||
|
| DictValues
|
||||||
|
| DictUnion
|
||||||
|
| DictIntersection
|
||||||
|
| DictDifference
|
||||||
|
| SetFromList
|
||||||
|
| NumAdd
|
||||||
|
| NumAddWrap
|
||||||
|
| NumAddChecked
|
||||||
|
| NumSub
|
||||||
|
| NumSubWrap
|
||||||
|
| NumSubChecked
|
||||||
|
| NumMul
|
||||||
|
| NumMulWrap
|
||||||
|
| NumMulChecked
|
||||||
|
| NumGt
|
||||||
|
| NumGte
|
||||||
|
| NumLt
|
||||||
|
| NumLte
|
||||||
|
| NumCompare
|
||||||
|
| NumDivUnchecked
|
||||||
|
| NumRemUnchecked
|
||||||
|
| NumIsMultipleOf
|
||||||
|
| NumAbs
|
||||||
|
| NumNeg
|
||||||
|
| NumSin
|
||||||
|
| NumCos
|
||||||
|
| NumSqrtUnchecked
|
||||||
|
| NumLogUnchecked
|
||||||
|
| NumRound
|
||||||
|
| NumToFloat
|
||||||
|
| NumPow
|
||||||
|
| NumCeiling
|
||||||
|
| NumPowInt
|
||||||
|
| NumFloor
|
||||||
|
| NumIsFinite
|
||||||
|
| NumAtan
|
||||||
|
| NumAcos
|
||||||
|
| NumAsin
|
||||||
|
| NumBitwiseAnd
|
||||||
|
| NumBitwiseXor
|
||||||
|
| NumBitwiseOr
|
||||||
|
| NumShiftLeftBy
|
||||||
|
| NumShiftRightBy
|
||||||
|
| NumShiftRightZfBy
|
||||||
|
| NumIntCast
|
||||||
|
| Eq
|
||||||
|
| NotEq
|
||||||
|
| And
|
||||||
|
| Or
|
||||||
|
| Not
|
||||||
|
| Hash
|
||||||
|
| ExpectTrue => false,
|
||||||
|
|
||||||
|
ListMap | ListMap2 | ListMap3 | ListMapWithIndex | ListKeepIf | ListWalk
|
||||||
|
| ListWalkUntil | ListWalkBackwards | ListKeepOks | ListKeepErrs | ListSortWith
|
||||||
|
| DictWalk => true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue