Skip to content

Commit

Permalink
update README for heterogeneous dimensional expressions #4
Browse files Browse the repository at this point in the history
  • Loading branch information
breandan committed Jan 25, 2020
1 parent 838f832 commit 6391752
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,12 @@ val z = f(1.0, 2.0) // Returns a value
println(z) // Prints: 7
```

Currently, it is only possible to represent functions where all inputs and outputs share a single type. In future iterations, it is possible to extend support for building functions with varying input/output types and enforce constraints on both, using [covariant and contravariant](https://kotlinlang.org/docs/reference/generics.html) type bounds.
Additionally, it is possible to build functions consisting of varying dimensional inputs:

```kotlin
fun <T: Fun<T>> mlp(p1: VFun<T, D3>, p2: MFun<T, D3, D3>, p3: T) =
((p1 * p2 + p1 * p2 * p2 dot p1 + p1) - p3) pow p3
```

#### Coroutines

Expand Down

0 comments on commit 6391752

Please sign in to comment.