Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Actually, using a non-total function like last doesn't do your claims any favours. I'd have picked map as the canonical example for free theorems.


I chose that non-total function because it is easier to enumerate all the possible error cases than with the map function. And the error case is easily handled by the combination of incomplete pattern match and Safe Haskell. I was also trying to emphasize purity more than free theorems.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: