Skip to content

Commit

Permalink
Fixed issue typelevel#4642
Browse files Browse the repository at this point in the history
  • Loading branch information
aluscent committed Oct 29, 2024
1 parent 024c184 commit e31723b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion alleycats-core/src/main/scala/alleycats/Extract.scala
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ object Extract {
}
trait AllOps[F[_], A] extends Ops[F, A]
trait ToExtractOps extends Serializable {
implicit def toExtractOps[F[_], A](target: F[A])(implicit tc: Extract[F]): Ops[F, A] {
implicit def toExtractOps[F[_] : Extract, A](target: F[A])(implicit tc: Extract[F]): Ops[F, A] {
type TypeClassType = Extract[F]
} =
new Ops[F, A] {
Expand Down
2 changes: 1 addition & 1 deletion alleycats-core/src/main/scala/alleycats/syntax/all.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@

package alleycats.syntax

object all extends EmptySyntax with FoldableSyntax
object all extends EmptySyntax with FoldableSyntax with ExtractSyntax
12 changes: 12 additions & 0 deletions alleycats-core/src/main/scala/alleycats/syntax/extract.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package alleycats
package syntax

import alleycats.Extract

object extract extends ExtractSyntax

trait ExtractSyntax {
implicit class ExtractOps[F[_], A](fa: F[A])(implicit ev: Extract[F]) {
def extract(): A = ev.extract(fa)
}
}

0 comments on commit e31723b

Please sign in to comment.