Hacker News new | ask | show | jobs
by CraigJPerry 1550 days ago
>> By introducing a single generic, you could reduce it from 500 lines to 20

No one is writing 500 lines of code - just as when you use the generics syntax you don’t write the code that is generated by the compiler in response.

You could save about 10 lines, specifically these 10:

https://github.com/logic-building/functional-go/blob/master/...

You would still need the comparable ~40 lines of “generic” code:

https://github.com/logic-building/functional-go/blob/master/...