A type-safe, reflection-free, powerful enumeration implementation for Scala with exhaustive pattern match warnings and helpful integrations.
And for exactly the same reasons one shouldn't override equals and hashCode in a case class, they shouldn't manually implement an enumeration and instead let a well-tested macro (2.x) or the compiler itself (3.x) handle reliably doing the automated code generation. The more code that is generated by the compiler, the smaller the defects, technical debt, and security vulnerability surface areas.
Refinement types for Scala
This is more or less how derivation works when you want to use something like Refined types (it exposes Validate[Type, Refinement] typeclass if I remember correctly). Enumeratum exposes Enum[A], and newtypes expose Coercible[From, To].
Learn any GitHub repo in 59 seconds. Onboard AI learns any GitHub repo in minutes and lets you chat with it to locate functionality, understand different parts, and generate new code. Use it for free at www.getonboard.dev.
Scala compiler plugin for static code analysis
I've since figured this out (Scapegoat/FinalModifierOnCaseClass and WartRemover/FinalCaseClass). I plan to add it to the next version of the article.
Does the fthomas/refined library work differently in Scala 3?
3 projects | /r/scala | 20 Jun 2023
Tmux, NeoVim, etc. to write pure Kotlin code?
2 projects | /r/Kotlin | 30 Apr 2023
Type erased on implicit evidence check
1 project | /r/scala | 28 Apr 2023
Design by contract - Preconditions and Postconditions - I'm really amazed with Scala.
4 projects | /r/scala | 2 Mar 2023
Restrict uses of annotation in Scala
2 projects | /r/scala | 20 Feb 2023