Skip to content

Commit c05f40c

Browse files
committed
remove deprecated usage of
compiler produced warning: "The unicode arrow `⇒` is deprecated, use `=>` instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code"
1 parent 0515194 commit c05f40c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/scala/GivenInstances.scala

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ object GivenInstances:
1212

1313
def apply[A](using parser: StringParser[A]): StringParser[A] = parser
1414

15-
private def baseParser[A](f: String Try[A]): StringParser[A] = new StringParser[A] {
15+
private def baseParser[A](f: String => Try[A]): StringParser[A] = new StringParser[A] {
1616
override def parse(s: String): Try[A] = f(s)
1717
}
1818

1919
given stringParser: StringParser[String] = baseParser(Success(_))
20-
given intParser: StringParser[Int] = baseParser(s Try(s.toInt))
20+
given intParser: StringParser[Int] = baseParser(s => Try(s.toInt))
2121

2222
given optionParser[A](using parser: => StringParser[A]): StringParser[Option[A]] = new StringParser[Option[A]] {
2323
override def parse(s: String): Try[Option[A]] = s match
24-
case "" Success(None) // implicit parser not used.
25-
case str parser.parse(str).map(x Some(x)) // implicit parser is evaluated at here
24+
case "" => Success(None) // implicit parser not used.
25+
case str => parser.parse(str).map(x => Some(x)) // implicit parser is evaluated at here
2626
}
2727

2828
def test(): Unit =

0 commit comments

Comments
 (0)