3 ms·
That insight is wrong. Not just superficially; it goes against the whole point of types. 1) Consider easing functions in animation (see easings.net for example
by cousin_it 6y ago
That insight is wrong. Not just superficially; it goes against the whole point of types.
1) Consider easing functions in animation (see easings.net for examples). They all have domain and range "real numbers between 0 and 1", yet they are all meaningfully different.
2) Consider filters in audio processing. They all have domain and range "streams of real numbers", yet they are all meaningfully different. The fact that they have the same type is important - it allows composition of filters, which I'd hope would sound exciting to a typed programmer!
3) Consider sorting algorithms. Even under a very advanced type system, the domain would be "arrays of numbers" and the range would be "sorted arrays of numbers". Yet there are tons of sorting algorithms that are meaningfully different. The fact that they have the same type is important - it allows a sorting library to evolve without breaking applications.
See the common thread? Types enable mixing and matching functionality. If a type allows only one functionality, it's useless for that purpose.
- ummonk 6y agoI think the "only types matter" applies when you're simply applying natural transformations between isomorphic types.
- MaxBarraclough 6y ago> They all have domain and range "real numbers between 0 and 1", yet they are all meaningfully different. I was thinking a similar thought: sine vs cosine. But I think that falls under 'superficially wrong'.