You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
scala>typeFile=CharRefinedInterval.Closed[W.`'a'`.T, W.`'h'`.T]
defined typealiasFile
scala>typeRank=IntRefinedInterval.Closed[W.`1`.T, W.`8`.T]
defined typealiasRank
scala>caseclassSquare(file: File, rank: Rank)
defined classSquare
scala>Square('i', 2)
<console>:22:error: Right predicate of (!(i < a) &&!(i > h)) failed: Predicate (i > h) did not fail.
Square('i', 2)
^
scala>Square('a', 9)
<console>:22:error: Right predicate of (!(9<1) &&!(9>8)) failed: Predicate (9>8) did not fail.
Square('a', 9)
^
scala>Square('k', -1)
<console>:22:error: Right predicate of (!(k < a) &&!(k > h)) failed: Predicate (k > h) did not fail.
Square('k', -1)
^
<console>:22:error: Left predicate of (!(-1<1) &&!(-1>8)) failed: Predicate (-1<1) did not fail.
Square('k', -1)
^
scala>vala1=Square('a', 1)
a1:Square=Square(a,1)
scala>valb2=for {
| f <- applyRef[File]((a1.file +1).toChar).right
| r <- applyRef[Rank](a1.rank +1).right
| } yieldSquare(f, r)
b2: scala.util.Either[String,Square] =Right(Square(b,2))
scala>vali9=for {
| f <- applyRef[File]((a1.file +8).toChar).right
| r <- applyRef[Rank](a1.rank +8).right
| } yieldSquare(f, r)
i9: scala.util.Either[String,Square] =Left(Right predicate of (!(i < a) &&!(i > h)) failed: Predicate (i > h) did not fail.)