Skip to content

chanterelle 0.1.5

Latest

Choose a tag to compare

@arainko arainko released this 12 Apr 19:45
· 11 commits to main since this release
95086fa

chanterelle 0.1.5

This release adds a new FieldName modifier: .transformViaType which allows users to feed in any match type to map over field names of a named tuple, example from the scaladoc:

type RenameSpecific[Source <: String] <: String = Source match {
     case "i_want_this_one_renamed" => "aight"
     case "andThisOneToo" => "thereYouGo"
     case _ => Source
}
val tup = (field = 1, i_want_this_one_renamed = 2, andThisOneToo = 3)
tup.transform(_.rename(_.transformViaType[RenameSpecific])) // yields (field: Int, aight: Int, thereYouGo: Int)

Remember that match types are turing-complete so you can do ANYTHING you wish with those (at a certain cost to your compiletimes, you've been warned)

What's Changed

  • Update README.md by @arainko in #83
  • .transformViaType - calculating field renames with match types by @arainko in #84

Full Changelog: v0.1.4...v0.1.5