3 ms·
I'm not clear on what exactly you're trying to represent here, but it looks like something that wouldn't work with Go's type system. ErrorCheckerFunc would need
by djur 7y ago
I'm not clear on what exactly you're trying to represent here, but it looks like something that wouldn't work with Go's type system. ErrorCheckerFunc would need to always have the same return type and accept a function with the same type signature.
- akavi 7y agoIf only there was a way to make a single function work with multiple different types. A way to "genericize" it, you might say. Alas, that's obviously completely impossible. Such a thing is beyond the capabilities of us mortal programmers. But maybe one day PL researchers will discover a way. One day...
- thatswrong0 7y agoRob Pike would rather use a for loop than map or filter.. so yeah don’t dream too big https://github.com/robpike/filter https://github.com/robpike/filter
- mevile 7y agoThat's kind of awesome code though. I learned things about go looking through how he implemented reduce. Thank you for sharing it.