Kotlinのsealed型を使って高機能なenum型を実装する

Kotlinのsealed型を使って、標準ライブラリの enum class よりも高機能なenum型を実装する方法を紹介します。