Skip to content

Commit 3dd4a30

Browse files
authored
Merge pull request #2 from maowug/jc
fix: low priority implicits etc
2 parents f8852c4 + 33f6a86 commit 3dd4a30

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

shared/src/main/scala/com/thoughtworks/Extractor.scala

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
package com.thoughtworks
22

3-
private[thoughtworks] sealed trait LowPrirorityExtractor {
4-
3+
private[thoughtworks] sealed trait LowPriorityExtractor {
4+
55
sealed trait SeqExtractor[-A, +B] {
66
def unapplySeq(a: A): Option[Seq[B]]
77
}
8-
9-
implicit final class OptionFunctionToSeqExtractor[-A, +B] private[LowPrirorityExtractor](underlying: A => Option[Seq[B]]) {
8+
9+
implicit final class OptionFunctionToSeqExtractor[-A, +B] private[LowPriorityExtractor](underlying: A => Option[Seq[B]]) {
1010
def extractSeq = new SeqExtractor[A, B] {
1111
def unapplySeq(a: A) = underlying(a)
1212
}
1313
}
1414

15-
implicit final class OptionFunctionToExtractor[-A, +B] private[LowPrirorityExtractor](underlying: A => Option[B]) {
15+
implicit final class OptionFunctionToExtractor[-A, +B] private[LowPriorityExtractor](underlying: A => Option[B]) {
1616
def extract = new Extractor[A, B] {
1717
def unapply(a: A) = underlying(a)
1818
}
@@ -27,6 +27,7 @@ sealed trait Extractor[-A, +B] {
2727
def unapply(a: A): Option[B]
2828
}
2929

30+
3031
/**
3132
* Utilities to convert between `A => Option[B]`, `PartialFunction[A, B]` and [[Extractor]].
3233
*
@@ -64,7 +65,7 @@ sealed trait Extractor[-A, +B] {
6465
}}}
6566
*
6667
*/
67-
object Extractor extends LowPrirorityExtractor {
68+
object Extractor extends LowPriorityExtractor {
6869

6970
implicit final class PartialFunctionToSeqExtractor[-A, +B] private[Extractor](underlying: PartialFunction[A, Seq[B]]) {
7071
def extractSeq = new SeqExtractor[A, B] {
@@ -84,4 +85,4 @@ object Extractor extends LowPrirorityExtractor {
8485
}
8586
}
8687

87-
}
88+
}

0 commit comments

Comments
 (0)