Many small optimization.
Closed this issue · 2 comments
Deleted user commented
Some code can be optimized. So, this is the list of optimization:
- even
flip :
areidentity ∘
. - odd
flip :
are singleflip :
. /+⇡
are the triangular number./×⇡
are the factorial number.deshape ♭
ashape [n]
array is theidentity ∘
with the array.each ∵
with a pervasive function is the pervasive function itself.
kaikalii commented
In general, I don't like to add optimizations for things that can be done another way.
::
has signature|2.2
while∘
has signature|1.1
- I think you can just not write more than 1
flip
. There's a case for multipleflip
s ending up next to each other because in a macro, but I don't think that would be common enough to warrant special casing. - While this could be optimized, I don't think it's necessary.
/×⇡
is0
.- This is implemented
- This is the most compelling one because of macros. I may implement it.