3 ms·
Not just is that function pure, but free theorems indicate that the only way you can get an a is by using the Vector that goes in. Sure, it could ignore the Int
by ocharles 13y ago
Not just is that function pure, but free theorems indicate that the only way you can get an a is by using the Vector that goes in. Sure, it could ignore the Int - we don't have linear types, afterall - but it really does narrow down the "what could this do?" options.
- gnuvince 13y agoFor those interested, ocharles is talking about Theorems for Free![1] by Phil Wadler. Also be sure to check out his 24 Days of Hackage 2013. [1] http://ttic.uchicago.edu/~dreyer/course/papers/wadler.pdf http://ttic.uchicago.edu/~dreyer/course/papers/wadler.pdf [2] http://ocharles.org.uk/blog/pages/2013-12-01-24-days-of-hackage.html http://ocharles.org.uk/blog/pages/2013-12-01-24-days-of-hack...