Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
julianpeeters committed Mar 5, 2024
1 parent ee1afd5 commit b06ae2d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ class CartesianSuite extends FunSuite:
val expected: List[(Int, (String, Boolean))] = List((0, ("", false)), (3, ("foo", false)), (4, ("foo!", true)))
assertEquals(obtained, expected)


test("mealy linearly distributive"):
type P[Y] = Interface[Int, Int, Y]
type Q[Y] = Interface[String, String, Y]
Expand All @@ -101,7 +100,7 @@ class CartesianSuite extends FunSuite:
b => (b._1._1, (b._1._2, b._2)), // re-tuple
(b, a) => a match // exhibit strength
case Left(value) => (Left(value), b._2)
case Right(value) => (Right(value._1), value._2)
case Right(value) => (Right(b._1._2), value._2)
)
val z: Wiring[(P × (QR)) ~> T] = Wiring(b => a => b, (b, a) => a)
val m: Mealy[((S ~> ((P × Q) ⊗ R)) ~> (P × (QR))) ~> T] = n.andThen(w).andThen(z).asMealy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ object asPolyMap:
def asPolyMap: PolyMap[Store[S, _], (Interface[A1, B1, _] × (Interface[A2, B2, _] ⊗ Interface[A3, B3, _])), Y] =
PolyMap(m.readout, m.update)

// Moore[Store[cats.Id[S], _] ~> ((Interface[A1, B1, _²]) × (Interface[A2, B2, _³]) ⊗ (Interface[A3, B3, _⁴])) ~> ( (Interface[A1, B1, _⁵]) × ( (Interface[A2, B2, _⁶]) ⊗ (Interface[A3, B3, _⁷])))]

extension [S, A1, B1, A2, B2, A3, B3, Y] (m: Moore[(Store[Id[S], _] ~> ((Interface[A1, B1, _] × Interface[A2, B2, _]) ⊗ Interface[A3, B3, _])) ~> (Interface[A1, B1, _] × (Interface[A2, B2, _] ⊗ Interface[A3, B3, _]))])
@scala.annotation.targetName("asPolyMapStoreToMonoMonoTensoredCartesianMonoCartesianTensoredMono")
def asPolyMap: PolyMap[PolyMap[Store[Id[S], _], ((Interface[A1, B1, _] × Interface[A2, B2, _]) ⊗ Interface[A3, B3, _]), _], (Interface[A1, B1, _] × (Interface[A2, B2, _] ⊗ Interface[A3, B3, _])), Y] =
Expand Down

0 comments on commit b06ae2d

Please sign in to comment.