This fun fact has been on my mind for a while, and a recent reddit thread about "Smuggling Checked Exceptions with Sealed Interfaces" made me write this post here. Namely, Java had union types before it was cool! (If you squint hard). What are union types? Ceylon is an underrated JVM language that never really … Continue reading Java’s Checked Exceptions Are Just Weird Union Types
Tag: sum types
Ceylon Might Just be the Only (JVM) Language that Got Nulls Right
Here we go again. THAT TOPIC. But hang on. The approach discussed here (and in the Ceylon language) is not something you see every day. At the same time, it is very cunning. Nulls are baked into the language ... or so it may seem. Indeed, in Ceylon, like in Kotlin (and possibly many other … Continue reading Ceylon Might Just be the Only (JVM) Language that Got Nulls Right
An Ingenious Workaround to Emulate an Application of Union Types in Java
Before I move on with the actual article, I'd like to give credit to Daniel Dietrich, author of the awesome vavr library, who has had the idea before me: https://twitter.com/danieldietrich/status/699633269202149377 Contravariant Generic Bounds It all started with a tweet: https://twitter.com/lukaseder/status/699588908095508480 I wanted to do something like pattern-matching a common super type of a set of … Continue reading An Ingenious Workaround to Emulate an Application of Union Types in Java