-
Notifications
You must be signed in to change notification settings - Fork 0
/
Patterns.scala
52 lines (39 loc) · 1.27 KB
/
Patterns.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//> using scala "3.3.1"
//> using dep "org.typelevel::toolkit:latest.release"
//> using repository "https://raw.githubusercontent.com/lichess-org/lila-maven/master"
//> using dep "org.lichess::scalachess:15.6.8"
//> using dep "dev.optics::monocle-core:3.2.0"
//> using dep "dev.optics::monocle-macro:3.2.0"
import cats.syntax.all.*
import cats.effect.*
import monocle.syntax.all.*
import chess.*
object Hello extends IOApp.Simple:
def run =
IO.println("Hello World!")
object Patterns:
// object PatternAt:
// def findAll(sit: Situation): List[Pattern] =
// List.empty
// def findAll(sits: List[Situation]): List[Pattern] =
// sits.flatMap(findAll)
trait PatternSearcher[F[_], C, P]:
def search(c: C): F[List[P]]
object Puzzles:
enum Pattern:
case fork
case doubleCheck
case xRay
def apply[F[_]](): PatternSearcher[F, Situation, Pattern] =
new PatternSearcher[F, Situation, Pattern]:
def search(sit: Situation): F[List[Pattern]] =
???
object Rosen:
enum Pattern:
case fork
case doubleCheck
case xRay
def apply[F[_]](): PatternSearcher[F, Situation, Pattern] =
new PatternSearcher[F, Situation, Pattern]:
def search(sit: Situation): F[List[Pattern]] =
???