Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
julianpeeters committed Jan 10, 2024
1 parent b2f326b commit ec95273
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,19 @@ type `4y⁴` = (`2y²` ⊗ `2y²`)[_]

#### FAQ

>Q: What are we losing out on by using simple types?
>Q: What are we losing by using simple types rather than dependent types?
>A: Simple types can easily model monomial lenses, yet they are too inflexible
>to model fully dependent lenses.
>A: Simple types can easily model monomial lenses, yet they are not flexible
>enough to model fully dependent lenses.
>
>However, a rich subset of dependent lenses can be implemented, under the
>following constraints:
> - while function types may not depend on just any value, they may, by exploiting Scala's subtyping of ADTs, depend on classes of values
> - function types may not depend on just any value, but may, by exploiting Scala's subtyping of ADTs, depend on classes of values
> - function types may not depend on just any type, but may, by exploiting Scala's match types, depend on types that abstract over arities
>
>These constraints liberate a (full?) subcategory of Poly wherein multi-term
>polynomials "fit" in a monomial lens, since the directions and positions of a
>given polynomial are themselves parameterized by a polynomial of an equal
>polynomial lenses "fit" in a monomial lens, since the directions and positions
>of a given polynomial are themselves parameterized by a polynomial of an equal
>number of terms.
>
>For example, `Binomial` lens pameterized by `Option` has terms exponentiated
Expand Down Expand Up @@ -93,7 +93,7 @@ import polynomial.morphism.~>
type F[Y] = (Store[Boolean, _] ~> Interface[Byte, Char, _])[Y]
val M: Mermaid[F] = summon[Mermaid[F]]
// M: Mermaid[F] = polynomial.mermaid.Mermaid$$anon$1@5360ce06
// M: Mermaid[F] = polynomial.mermaid.Mermaid$$anon$1@b268480
println(M.showTitledGraph(titleFmt = Format.Cardinal, graphFmt = Format.Specific))
// ```mermaid
Expand Down Expand Up @@ -160,7 +160,7 @@ classDef point width:0px, height:0px;
classDef title stroke-width:0px, fill:background;
```

##### Example: binomial state lens `Store[S, _] ~> Binomial[A1, B1, A2, B2, _]`
##### Example: binomial state lens `Store[S, _] ~> Interface[A1, B1, A2, B2, _]`
```mermaid
graph LR;
TitleStart[ ]:::hidden~~~TitleBody[<span style="font-family:Courier">S</span>𝑦<sup><span style="font-family:Courier">S</span></sup> → B<sub>1</sub>𝑦<sup>A<sub>1</sub></sup> + B<sub>2</sub>𝑦<sup>A<sub>2</sub></sup>]:::title~~~TitleEnd[ ]:::hidden
Expand Down
14 changes: 7 additions & 7 deletions docs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,19 @@ type `4y⁴` = (`2y²` ⊗ `2y²`)[_]

#### FAQ

>Q: What are we losing out on by using simple types?
>Q: What are we losing by using simple types rather than dependent types?
>A: Simple types can easily model monomial lenses, yet they are too inflexible
>to model fully dependent lenses.
>A: Simple types can easily model monomial lenses, yet they are not flexible
>enough to model fully dependent lenses.
>
>However, a rich subset of dependent lenses can be implemented, under the
>following constraints:
> - while function types may not depend on just any value, they may, by exploiting Scala's subtyping of ADTs, depend on classes of values
> - function types may not depend on just any value, but may, by exploiting Scala's subtyping of ADTs, depend on classes of values
> - function types may not depend on just any type, but may, by exploiting Scala's match types, depend on types that abstract over arities
>
>These constraints liberate a (full?) subcategory of Poly wherein multi-term
>polynomials "fit" in a monomial lens, since the directions and positions of a
>given polynomial are themselves parameterized by a polynomial of an equal
>polynomial lenses "fit" in a monomial lens, since the directions and positions
>of a given polynomial are themselves parameterized by a polynomial of an equal
>number of terms.
>
>For example, `Binomial` lens pameterized by `Option` has terms exponentiated
Expand Down Expand Up @@ -143,7 +143,7 @@ type P[Y] = (Interface[Byte, Byte, _] ~> Interface[Byte, Char, _])[Y]
println(summon[Mermaid[P]].showTitledGraph(titleFmt = Format.Generic, graphFmt = Format.Generic))
```

##### Example: binomial state lens `Store[S, _] ~> Binomial[A1, B1, A2, B2, _]`
##### Example: binomial state lens `Store[S, _] ~> Interface[A1, B1, A2, B2, _]`
```scala mdoc:reset:passthrough
import polynomial.`object`.{Monomial, Binomial}
import polynomial.mermaid.{Format, Mermaid, given}
Expand Down

0 comments on commit ec95273

Please sign in to comment.