
5 Aug
2012
5 Aug
'12
8:37 a.m.
On Sat, Aug 04, 2012 at 05:59:59PM +0000, Costello, Roger L. wrote:
How to automatically get the inverse of a Haskell function?
That's a great question. I don't know the answer to that. Anyone else have an idea?
It is not possible in general... but on the other hand you can use parametricity to pull some cool tricks. See Janis Voigtländer's paper from 2009, "Bidirectionalization for free!" (http://www.iai.uni-bonn.de/~jv/popl09-2.pdf) which is a fun read. You can even play with an implementation of it here: http://www-ps.iai.uni-bonn.de/cgi-bin/bff.cgi -Brent