Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions examples/casestudies/ad.effekt.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ interface AD[Num] {
def exp(x: Num): Num
}
```
If Effekt would support polymorphic effects (or abstract type members on
effects) we could abstract over the domain `Num`, which is hard-coded above to
contain a double value and a mutable reference.
As Effekt supports polymorphic effects, we abstract over the domain `Num`.

We can use the number DSL to express two example programs.
```
Expand Down Expand Up @@ -149,7 +147,7 @@ println(backwards(1.0) { x => progExp(x) })
println(forwards(0.0) { x => progExp(x) })
println(backwards(0.0) { x => progExp(x) })

println(showString { x => forwardsHigher(x) { x => forwardsHigher(x) { y => forwardsHigher(y) { z => prog(z) } }} })
println(showString { x => forwardsHigher(x) { x => forwardsHigher(x) { y => forwardsHigher(y) { z => prog(z) } } } })

// we have the same pertubation confusion as in Lantern
val result = forwards(1.0) { x =>
Expand Down
Loading