3 ms·
In Scala you can do this pretty neatly: url match { case GitHubUrl => config.github case TwitterUrl => config.twitter case _ => defaultUrl }
by pikzel 7y ago
In Scala you can do this pretty neatly:
url match {
case GitHubUrl => config.github
case TwitterUrl => config.twitter
case _ => defaultUrl
}
- dep_b 7y agoKotlin and F# have the same, such a clean pattern.