Watch your types
Channel: Genovich
Date: 2022-08-06

I watched a video from @Kotlin and couple of things from it forced me to rumination so hard that I came with this.
I'll dive a little bit into a theory and will show how to make code more reliable just by adding more types to it.

Code
https://gist.github.com/lynnfield/2e7f44c01a924f632a585bfa84840a4a

Materials
https://www.youtube.com/c/Kotlin
https://www.youtube.com/watch?v=1VWYP3S12Do
https://en.wikipedia.org/wiki/Function_%28mathematics%29
https://en.wikipedia.org/wiki/Domain_of_a_function
https://en.wikipedia.org/wiki/Cardinality
https://en.wikipedia.org/wiki/Bijection%2C_injection_and_surjection

Russian version
https://youtu.be/sSzuQ9nFjhY