What is a Type for a function? When can you say that a function is a sub-type of another function? Why should you even bother?
Function sub-typing is one of the most confusing areas of FP. In this talk, I'll take a deep dive and explain the core concepts of function types which applies to many different languages. More than just explaining the mere rules, I will be deriving those rules in a step-by-step fashion till the eureka moment so that you will never be confused again.
The topics covered:
- Sub-typing basics
- Covariance & Contravariance
- Function sub-typing
- Implementation gotchas in different languages (Java, Scala, Haskell, JavaScript)