Skip to content

Commit 13d6448

Browse files
committed
Changes for Scala 3.6
1 parent 16b777f commit 13d6448

File tree

4 files changed

+17
-19
lines changed

4 files changed

+17
-19
lines changed

src/core/anticipation+serpentine-core.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import prepositional.*
2020
import serpentine.*
2121

2222
package filesystemApi:
23-
given [PlatformType: {Navigable, Radical}]
24-
=> (Path on PlatformType) is GenericPath & SpecificPath as serpentinePath =
23+
given serpentinePath: [PlatformType: {Navigable, Radical}]
24+
=> (Path on PlatformType) is GenericPath & SpecificPath =
2525
new GenericPath with SpecificPath:
2626
type Self = Path on PlatformType
2727
def pathText(path: Path on PlatformType): Text = path.text

src/core/serpentine.Path.scala

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,25 @@ import vacuous.*
2929
import scala.compiletime.*
3030

3131
object Path:
32-
given [PathType <: Path] => PathType is Encodable in Text as encodable = _.text
32+
given encodable: [PathType <: Path] => PathType is Encodable in Text = _.text
3333

34-
given [PlatformType: {Navigable, Radical}] => Decoder[Path on PlatformType] as decoder =
34+
given decoder: [PlatformType: {Navigable, Radical}] => Decoder[Path on PlatformType] =
3535
Path.parse(_)
3636

37-
given [PlatformType] => (Path on PlatformType) is Showable as showable = _.text
38-
given [PlatformType] => (Path on PlatformType) is GenericPath as generic = _.text
39-
given [PlatformType] => (Path on PlatformType) is Nominable as nominable = path =>
37+
given showable: [PlatformType] => (Path on PlatformType) is Showable = _.text
38+
given generic: [PlatformType] => (Path on PlatformType) is GenericPath = _.text
39+
given nominable: [PlatformType] => (Path on PlatformType) is Nominable = path =>
4040
path.textDescent.prim.or(path.textRoot)
4141

42-
given [PlatformType: {Navigable, Radical}] => Path on PlatformType is SpecificPath as specific =
42+
given specific: [PlatformType: {Navigable, Radical}] => Path on PlatformType is SpecificPath =
4343
_.decode[Path on PlatformType]
4444

45-
given Path is Communicable as communicable = path =>
45+
given communicable: Path is Communicable = path =>
4646
Message(path.textDescent.reverse.join(path.textRoot, path.separator, t""))
4747

48-
given [PlatformType: Navigable](using Tactic[PathError])
48+
given addable: [PlatformType: Navigable] => Tactic[PathError]
4949
=> (Path on PlatformType) is Addable by (Relative by PlatformType.Operand) into
50-
(Path on PlatformType) as addable =
50+
(Path on PlatformType) =
5151
(left, right) =>
5252
def recur(descent: List[Text], ascent: Int): Path on PlatformType =
5353
if ascent > 0 then

src/core/serpentine.PathAscent.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import rudiments.*
2323
import symbolism.*
2424

2525
object PathAscent:
26-
given [ElementType](using Navigable by ElementType)
26+
given [ElementType] => (Navigable by ElementType)
2727
=> PathAscent is Divisible by ElementType into (Relative by ElementType) =
2828
new Divisible:
2929
type Self = PathAscent
@@ -49,6 +49,6 @@ case class PathAscent(ascent0: Int) extends Relative(ascent0, Nil, t"/"):
4949
type Operand = Nothing
5050

5151
@targetName("parent")
52-
infix def / (parent: ^.type): PathAscent = PathAscent(ascent + 1)
52+
infix def / (parent: Serpentine.^.type): PathAscent = PathAscent(ascent + 1)
5353

5454
override def parent: PathAscent = PathAscent(ascent + 1)

src/core/serpentine.Relative.scala

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,9 @@ import vacuous.*
2727
import scala.compiletime.*
2828

2929
object Relative:
30-
given [RelativeType <: Relative](using navigable: Navigable)
31-
=> RelativeType is Encodable in Text as encodable = relative =>
32-
if relative.textDescent.isEmpty
33-
then
30+
given encodable: [RelativeType <: Relative] => (navigable: Navigable)
31+
=> RelativeType is Encodable in Text = relative =>
32+
if relative.textDescent.isEmpty then
3433
if relative.ascent == 0 then navigable.selfText
3534
else List.fill(relative.ascent)(navigable.parentElement).join(navigable.separator)
3635
else
@@ -42,8 +41,7 @@ object Relative:
4241
given [ElementType, RootType: Navigable by ElementType] => (Relative by ElementType) is Showable =
4342
encodable.encode(_)
4443

45-
given [ElementType](using Navigable by ElementType)
46-
=> Decoder[Relative by ElementType] as decoder =
44+
given decoder: [ElementType] => (Navigable by ElementType) => Decoder[Relative by ElementType] =
4745
parse(_)
4846

4947
def parse[ElementType](using navigable: Navigable by ElementType)(text: Text)

0 commit comments

Comments
 (0)