@TheAspiringHacker @jmc Think about permutations. There are m^n ways to choose from a list of m things n times. For instance, there are 26^5 different 5-letter strings. A function between finite sets A and B chooses an element of B for each A. That is, it chooses from a list of b things a times. There are b^a ways to do this, so that’s how many possible functions there are.

Here's a digestible example of the practical benefit of type safety.

In this case of vs. , Rust bites the head off JavaScript because it forces you to check your pointers before you use them.


cc @codesections

Functional Café

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!