I asked the folks on /r/haskell, we hashed out a version in Agda and then I translated it into Haskell. It’s not completely in the spirit of the original question, but at least it’s a starting point. The code is here, you can try it out on CompileOnline.
I asked the folks on /r/haskell, we hashed out a version in Agda and then I translated it into Haskell. It’s not completely in the spirit of the original question, but at least it’s a starting point. The code is here, you can try it out on CompileOnline.
ETA: now I also wrote a post about it.