Skip to content

Commit

Permalink
Update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
julianpeeters committed Mar 3, 2024
1 parent ff4dca7 commit bf8d91f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 19 deletions.
7 changes: 2 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
val CatsV = "2.10.0"
val DestructuredV = "0.2.0"
val Fs2V = "3.9.3"
val MUnitV = "0.7.29"
val PolynomialV = "0.4.0+13-83c271ca+20240209-1837-SNAPSHOT"
val PolynomialV = "0.5.0"

inThisBuild(List(
crossScalaVersions := Seq(scalaVersion.value),
Expand All @@ -26,7 +25,7 @@ inThisBuild(List(
"-Wvalue-discard",
"-Ykind-projector:underscores"
),
scalaVersion := "3.3.1",
scalaVersion := "3.4.0",
versionScheme := Some("semver-spec"),
))

Expand Down Expand Up @@ -56,7 +55,6 @@ lazy val fsm = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.settings(
name := "dynamical-fsm",
libraryDependencies ++= Seq(
"com.julianpeeters" %%% "destructured" % DestructuredV,
"com.julianpeeters" %%% "polynomial" % PolynomialV,
"org.typelevel" %%% "cats-core" % CatsV,
"org.scalameta" %% "munit" % MUnitV % Test
Expand All @@ -71,7 +69,6 @@ lazy val docs = project.in(file("docs/gitignored"))
mdocVariables := Map(
"SCALA" -> crossScalaVersions.value.map(e => e.takeWhile(_ != '.')).mkString(", "),
"VERSION" -> version.value.takeWhile(_ != '+'),
"DESTRUCTURED" -> DestructuredV.reverse.dropWhile(_ != '.').drop(1).reverse,
"FS2" -> Fs2V.reverse.dropWhile(_ != '.').drop(1).reverse,
"POLYNOMIAL" -> PolynomialV.reverse.dropWhile(_ != '.').drop(1).reverse,
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
package dynamical.fsm.methods.mealy.product

import dynamical.fsm.methods.types.{Init, Readout, Run, Update}
import dynamical.fsm.Mealy
import dynamical.fsm.methods.types.{Init, Readout, Run, Update}
import polynomial.morphism.~>
import polynomial.`object`.Monomial.{Interface, Store}
import polynomial.product.

object tensor:

extension [S1, S2, A1, B1, A2, B2, Y] (m1: Mealy[Store[S1, _] ~> Interface[A1, A1 => B1, _]])
extension [S1, S2, A1, B1, A2, B2] (m1: Mealy[Store[S1, _] ~> Interface[A1, A1 => B1, _]])
@scala.annotation.targetName("tensor1")
def (m2: Mealy[Store[S2, _] ~> Interface[A2, A2 => B2, _]]): Mealy[(Store[S1, _])(Store[S2, _]) ~> (Interface[A1, A1 => B1, _] ⊗ Interface[A2, A2 => B2, _])] =
new Mealy[(Store[S1, _])(Store[S2, _]) ~> (Interface[A1, A1 => B1, _] ⊗ Interface[A2, A2 => B2, _])]:
def init[Y]: Init[(Store[S1, _])(Store[S2, _]) ~> (Interface[A1, A1 => B1, _] ⊗ Interface[A2, A2 => B2, _]), Y] =
def (m2: Mealy[Store[S2, _] ~> Interface[A2, A2 => B2, _]]): Mealy[(Store[S1, _] ⊗ Store[S2, _]) ~> (Interface[A1, A1 => B1, _] ⊗ Interface[A2, A2 => B2, _])] =
new Mealy[(Store[S1, _] ⊗ Store[S2, _]) ~> (Interface[A1, A1 => B1, _] ⊗ Interface[A2, A2 => B2, _])]:
def init[Y]: Init[(Store[S1, _] ⊗ Store[S2, _]) ~> (Interface[A1, A1 => B1, _] ⊗ Interface[A2, A2 => B2, _]), Y] =
(m1.init, m2.init)
def readout[Y]: Readout[(Store[S1, _])(Store[S2, _]) ~> (Interface[A1, A1 => B1, _] ⊗ Interface[A2, A2 => B2, _]), Y] =
def readout[Y]: Readout[(Store[S1, _] ⊗ Store[S2, _]) ~> (Interface[A1, A1 => B1, _] ⊗ Interface[A2, A2 => B2, _]), Y] =
(s1, s2) => (m1.readout(s1), m2.readout(s2))
def update[Y]: Update[(Store[S1, _])(Store[S2, _]) ~> (Interface[A1, A1 => B1, _] ⊗ Interface[A2, A2 => B2, _]), Y] =
def update[Y]: Update[(Store[S1, _] ⊗ Store[S2, _]) ~> (Interface[A1, A1 => B1, _] ⊗ Interface[A2, A2 => B2, _]), Y] =
(s, a) => (m1.update(s._1, a._1), m2.update(s._2, a._2))
def run[Y]: Run[(Store[S1, _])(Store[S2, _]) ~> ((Interface[A1, A1 => B1, _])(Interface[A2, A2 => B2, _])), Y] =
def run[Y]: Run[(Store[S1, _] ⊗ Store[S2, _]) ~> (Interface[A1, A1 => B1, _] ⊗ Interface[A2, A2 => B2, _]), Y] =
(s, a) => (update(s, a), (readout(s)._1(a._1), readout(s)._2(a._2)))
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@ object types:

type Codomain1[X] = X match
case Function1[a, b] => b
case Function1[(a1, a2, a3), b] => b
case (Function1[a1, b1], Function1[a2, b2]) => (b1, b2)

type Codomain2[X] = X match
case (b1, Function[a2, b2]) => (b1, b2)

type Init[P[_], Y] = P[Y] match
case PolyMap[p, q, Y] => Init[p, Y]
case PolyMap[p, q, Y] => Init[p, Y]
case Store[s, Y] => s
case Interface[a, b, Y] => b
case Tensor[p, q, Y] => (Init[p, Y], Init[q, Y])
case Tensor[p, q, Y] => (Init[p, Y], Init[q, Y])

type Readout[P[_], Y] = P[Y] match
case PolyMap[p, q, Y] => PolyMap.Phi[p, q, Y]
Expand Down
6 changes: 3 additions & 3 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// cross
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.3.2")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.3.2")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.14.0")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.16")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.15.0")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.17")

// docs
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.5.2")

// publish
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12")
addSbtPlugin("org.typelevel" % "sbt-typelevel-no-publish" % "0.6.2")
addSbtPlugin("org.typelevel" % "sbt-typelevel-no-publish" % "0.6.6")

0 comments on commit bf8d91f

Please sign in to comment.