Arnaud Spiwack (@aspiwack) profile picture

Multi-classed Software Engineer/Constructive Mathematician. Sometimes plays video games sort of fast. Puts topoi in your computer. https://nitter.cf/t.co/iFlKRVeGpN

Joined March 2019
Photo by Arnaud Spiwack (@aspiwack)Photo by Arnaud Spiwack (@aspiwack)Photo by Arnaud Spiwack (@aspiwack)Photo by Arnaud Spiwack (@aspiwack)Photo by Arnaud Spiwack (@aspiwack)Photo by Arnaud Spiwack (@aspiwack)Photo by Arnaud Spiwack (@aspiwack)Photo by Arnaud Spiwack (@aspiwack)Photo by Arnaud Spiwack (@aspiwack)Photo by Arnaud Spiwack (@aspiwack)
The foldl hackage.haskell.org/package/… package is one of the most remarkable bit of the Haskell ecosystem. Turns out, we can make it better. I mean worse. I mean… maybe? 1/11
1
8
1
26
2,520
Apparently, State is already slower than an hand-rolled scan, and Day doesn't really make things worse. On the other hand it seems to do (much!) better than a zipless Arrow-based implementation with foldl (which produces pairs original/computed on the first scan). 10/11
1
100
So maybe the Arrow implementation is significantly better than that of foldl. But I don't know that for even remotely sure. Anyway, this was a short experiment, we didn't carry it very far. You can find it here github.com/jameshaydon/janus… 11/11
5
102
So, I was thinking. When we write ⊢A→B ∧ ⊢A ⟹ ⊢B in inference rules. What is the pattern A→B as a mathematical object? 1/8
1
1
3
597
Now our conditions become g∘f≤id and id≤f∘g (hint: id is minimal). That is f and g form a Galois connection (equivalently ∀a x, x≤f(a) ⟺ g(x)≤a). I think it generalises: in a subtyping situation, you don't typically have x=f(a) only x≤f(a). Exactly what shows up! 7/8
1
48
So here's my suggested definition: a pattern in a function f with a left adjoint g, and matching a against pattern f binds g(a) (multiple variables are obtained by using product posets). 8/8
47
It's more important in Ocaml because Haskell's laziness precludes most types from crossing modes. The solution deployed in the paper is pretty involved, but maybe it's as canonical as it gets. I haven't fully digested it yet. But either way, it's important. 2/2
1
55