Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
a0fe697
initial work
arainko Jan 26, 2025
0387185
actually exciting for once
arainko Jan 27, 2025
b9a6143
a nicer dsl is needed, or just pass stuff as explicit params? boooring
arainko Jan 29, 2025
e98bee7
use steps as opposed to segments
arainko Feb 4, 2025
02fbb06
propagate flags everywhere in Planner, slightly refactor .get(_).map.…
arainko Feb 9, 2025
0f205f4
POC impl of Defaults with flags
arainko Feb 11, 2025
77b8e91
propagate priorities
arainko Feb 18, 2025
d8eeda5
fix compilation errors
arainko Feb 18, 2025
5e8a8d7
add parser for defaults and nones, thread flags through to Planner
arainko Feb 19, 2025
1f9b55b
rough poc of defaults for product to product only for now
arainko Feb 19, 2025
5b973b1
take priority into consideration
arainko Feb 20, 2025
8a77bc6
Revert "take priority into consideration"
arainko Feb 20, 2025
d1d3f8d
Revert "rough poc of defaults for product to product only for now"
arainko Feb 20, 2025
6d3e266
remove Priority from Plan.Configured
arainko Feb 20, 2025
e6c9bb5
Revert "add parser for defaults and nones, thread flags through to Pl…
arainko Feb 20, 2025
79bb4b7
actually, rebuilding defaults and nones as a flag is a godawful idea,…
arainko Feb 20, 2025
d3835e4
at long last - an actually working field renames POC
arainko Feb 20, 2025
bf56d41
crudely implemented coproduct renaming
arainko Feb 20, 2025
e7e4317
add local and typeSpecific modifiers
arainko Feb 21, 2025
4604d07
e2e poc - implement Renamer parsing into a compiletime String => Stri…
arainko Feb 21, 2025
b0eb2d9
fix a small oopsie
arainko Feb 21, 2025
1c2de3c
transfer Local flags to all the enum children (and children's childre…
arainko Feb 22, 2025
9d12987
propagate flag span in ambiguity error messages
arainko Feb 23, 2025
ac51d52
add some very basic tests
arainko Feb 23, 2025
d796713
another set of tests
arainko Feb 28, 2025
4ce083b
more test for local flags
arainko Mar 1, 2025
19d3a59
fix handling of flags in BetweenFallibles and BetweenFallibleNonFalli…
arainko Mar 7, 2025
421ca42
add tests for regional flags, finish up general flag tests
arainko Mar 8, 2025
d0b2890
finish up all tests
arainko Mar 8, 2025
44127ae
apply feedback
arainko Mar 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ducktape/src/main/scala/io/github/arainko/ducktape/Case.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ object Case {
@compileTimeOnly("Case.computed is only useable as a case configuration for transformations")
def computed[A, B, SourceTpe, DestTpe](selector: Selector ?=> A => SourceTpe, function: SourceTpe => DestTpe): Case[A, B] = ???

@compileTimeOnly("Case.modifySourceNames is only useable as a case configuration for transformations")
def modifySourceNames[A, B](renamer: Renamer => Renamer): Case[A, B] & Regional[A] & Local[A] & TypeSpecific = ???

@compileTimeOnly("Case.modifyDestNames is only useable as a case configuration for transformations")
def modifyDestNames[A, B](renamer: Renamer => Renamer): Case[A, B] & Regional[B] & Local[B] & TypeSpecific = ???

@deprecated(
message = "Use the variant that accepts a path selector instead (Case.const(_.at[SourceSubtype], ...))",
since = "ducktape 0.2.0-M1"
Expand Down
10 changes: 8 additions & 2 deletions ducktape/src/main/scala/io/github/arainko/ducktape/Field.scala
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ object Field {
def default[A, B, FieldType](selector: Selector ?=> B => FieldType): Field[A, B] = ???

@compileTimeOnly("Field.fallbackToNone is only useable as a field configuration for transformations")
def fallbackToNone[A, B]: Field[A, B] & Regional = ???
def fallbackToNone[A, B]: Field[A, B] & Regional[B] = ???

@compileTimeOnly("Field.fallbackToDefault is only useable as a field configuration for transformations")
def fallbackToDefault[A, B]: Field[A, B] & Regional = ???
def fallbackToDefault[A, B]: Field[A, B] & Regional[B] = ???

@compileTimeOnly("Field.allMatching is only useable as a field configuration for transformations")
def allMatching[A, B, DestFieldTpe, ProductTpe](selector: Selector ?=> B => DestFieldTpe, product: ProductTpe): Field[A, B] =
Expand All @@ -65,4 +65,10 @@ object Field {
@compileTimeOnly("Field.allMatching is only useable as a field configuration for transformations")
def allMatching[A, B, ProductTpe](product: ProductTpe): Field[A, B] =
???

@compileTimeOnly("Field.modifyDestNames is only useable as a field configuration for transformations")
def modifyDestNames[A, B](renamer: Renamer => Renamer): Field[A, B] & Regional[B] & Local[B] & TypeSpecific = ???

@compileTimeOnly("Field.modifySourceNames is only useable as a field configuration for transformations")
def modifySourceNames[A, B](renamer: Renamer => Renamer): Field[A, B] & Regional[A] & Local[A] & TypeSpecific = ???
}
24 changes: 21 additions & 3 deletions ducktape/src/main/scala/io/github/arainko/ducktape/Regional.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,29 @@ package io.github.arainko.ducktape

import scala.annotation.compileTimeOnly

type Regional
type Regional[A]

object Regional {
extension [F[a, b] <: (Case[b, a] | Field[a, b]), A, B](self: F[A, B] & Regional) {
extension [F[a, b] <: (Case[a, b] | Field[a, b]), A, B, C](self: F[A, B] & Regional[C]) {
@compileTimeOnly(".regional is only usable as field configuration for transformations")
def regional[DestFieldTpe](selector: Selector ?=> B => DestFieldTpe): F[A, B] = ???
def regional[DestFieldTpe](selector: Selector ?=> C => DestFieldTpe): F[A, B] = ???
}
}

type Local[A]

object Local {
extension [F[a, b] <: (Case[a, b] | Field[a, b]), A, B, C](self: F[A, B] & Local[C]) {
@compileTimeOnly(".local is only usable as field configuration for transformations")
def local[DestFieldTpe](selector: Selector ?=> C => DestFieldTpe): F[A, B] = ???
}
}

type TypeSpecific

object TypeSpecific {
extension [F[a, b] <: (Case[a, b] | Field[a, b]), A, B](self: F[A, B] & TypeSpecific) {
@compileTimeOnly(".typeSpecific is only usable as field configuration for transformations")
def typeSpecific[Tpe]: F[A, B] = ???
}
}
13 changes: 13 additions & 0 deletions ducktape/src/main/scala/io/github/arainko/ducktape/Renamer.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package io.github.arainko.ducktape

sealed trait Renamer {
def toUpperCase: Renamer

def toLowerCase: Renamer

def rename(from: String, to: String): Renamer

def replace(target: String, replacement: String): Renamer

def regexReplace(pattern: String, replacement: String): Renamer
}
Loading