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

string reversal, integer negation or toUpperCase are classical examples of functions which will not compile as `a -> a`

The function which will compile as `a -> a` is the identity function.





That's correct, but I'm not sure how it relates to my comment as I said that `a -> a` is just an endomorphism.

identity, uppercase or negate are all endomorphisms, with identity being the only generic one.




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

Search: