You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the second example, since Xs can no longer match with anything, the compiler is free to reorder the branches and make it as efficient as possible. I wonder if the Gleam compiler could emit code that plays nicely with this when it can tell you're matching on a non-empty list.
The text was updated successfully, but these errors were encountered:
Sounds good! As a small perf optimisation let's not do this right now unless it can be implemented very easily and quickly. Or if anyone suuuper wants to do it 😁
From Erlang's efficiency guide:
Don't:
Do:
In the second example, since Xs can no longer match with anything, the compiler is free to reorder the branches and make it as efficient as possible. I wonder if the Gleam compiler could emit code that plays nicely with this when it can tell you're matching on a non-empty list.
The text was updated successfully, but these errors were encountered: