Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
julianpeeters committed Jan 28, 2024
1 parent 0375b13 commit b988162
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,26 @@ be printed, with titles and labels in the following formats:


```scala
import polynomial.`object`.Monomial.{Store, Interface}
import polynomial.`object`.Monomial.Store
import polynomial.`object`.Binomial.Interface
import polynomial.mermaid.{Format, Mermaid, given}
import polynomial.morphism.~>

type F[Y] = (Store[Boolean, _] ~> Interface[Byte, Char, _])[Y]
type F[Y] = (Store[Boolean, _] ~> Interface[Some[Byte], None.type, None.type, Some[Char], _])[Y]

val M: Mermaid[F] = summon[Mermaid[F]]
// M: Mermaid[F] = polynomial.mermaid.Mermaid$$anon$1@5e90ebb6
// M: Mermaid[F] = polynomial.mermaid.Mermaid$$anon$4@3a6123bb

println(M.showGraph(graphFmt = Format.Generic))
// ```mermaid
// graph LR;
// A:::hidden---|<span style="font-family:Courier">A</span>|S[<span style="font-family:Courier">S</span>]---|<span style="font-family:Courier">B</span>|B:::hidden;
// A1[A1]:::hidden---|<span style="font-family:Courier">A<sub>1</sub></span>
// |SS[<span style="font-family:Courier">S</span>]
// ---|<span style="font-family:Courier">B<sub>1</sub></span>|A2:::hidden
// ~~~
// C[A2]:::hidden---|<span style="font-family:Courier">A<sub>2</sub></span>
// |TS[<span style="font-family:Courier">S</span>]
// ---|<span style="font-family:Courier">B<sub>2</sub></span>|D:::hidden;
//
// classDef empty fill:background;
// classDef point width:0px, height:0px;
Expand Down
5 changes: 3 additions & 2 deletions docs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,12 @@ be printed, with titles and labels in the following formats:


```scala mdoc:reset
import polynomial.`object`.Monomial.{Store, Interface}
import polynomial.`object`.Monomial.Store
import polynomial.`object`.Binomial.Interface
import polynomial.mermaid.{Format, Mermaid, given}
import polynomial.morphism.~>

type F[Y] = (Store[Boolean, _] ~> Interface[Byte, Char, _])[Y]
type F[Y] = (Store[Boolean, _] ~> Interface[Some[Byte], None.type, None.type, Some[Char], _])[Y]

val M: Mermaid[F] = summon[Mermaid[F]]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ object andThen:
def φ: PolyMap.Phi[PolyMap[Monomial.Store[S, _], Binomial.Interface[A1, B1, A2, B2, _], _], Binomial.Interface[A1, A1 => B1, A2, A2 => B2, _], Y] =
(p.φ._1.andThen(w.φ._1), p.φ._2.andThen(w.φ._2))
def `φ#`: PolyMap.PhiSharp[PolyMap[Monomial.Store[S, _], Binomial.Interface[A1, B1, A2, B2, _], _], Binomial.Interface[A1, A1 => B1, A2, A2 => B2, _], Y] =
((s, a) => p.`φ#`._1(s, a), (s, a) => p.`φ#`._2(s, a))
((s, a) => p.`φ#`._1(s, a), (s, a) => p.`φ#`._2(s, a))

extension [S1, S2, A1, B1, A2, B2, Y] (p: PolyMap[Monomial.Store[S1, _] ⊗ Monomial.Store[S2, _], Monomial.Interface[A1, B1, _] ⊗ Monomial.Interface[A2, B2, _], Y])
@scala.annotation.targetName("andThenTensoredStoreTensoredMonoToMonof")
Expand Down

0 comments on commit b988162

Please sign in to comment.