Hi! I’m Dave - a software developer and wannabe cartoonist who likes adventure games, superhero movies, and Kotlin. By day, I’m a mild-mannered Android developer who codes in Kotlin. But come nightfall, I’m… also coding… in Kotlin… because one day I just sat down and was like, “dude, Kotlin’s legit… I should make a website about it”.
And that’s what’s up.
exploreThe Ins and Outs of Generic Variance in Kotlin
The ultimate guide to understanding generics, covariance, contravariance, and type projections in Kotlin. Learn two simple subtyping rules that explain why generic variance works the way that it does.
exploreAn Illustrated Guide to Covariance and Contravariance in Kotlin
Confused about generic subtyping? With just a few simple, foundational concepts, almost everything about variance becomes clear. If you're confused about how subtyping works with generics in Kotlin, start here.
An out-projection in Kotlin is a kind of type projection that makes a generic covariant, but also causes any functions that accept the type parameter to be unusable in that context. Let's look at some examples and evaluate the trade-offs.
An in-projection in Kotlin is a kind of type projection that makes a generic contravariant, but also causes any functions that return the type parameter to return it as a more abstract type. Let's look at some examples and evaluate the trade-offs.
local_libraryJanuary 17, 2018
KotlinConf 2018 announced, Kotlin 1.2.20 Released, and a unified FP library emerges.