News for hackers. Stuff that matters.
Re:Please do not attempt to simplify this code by eecc on Friday December 28, 2018 @03:38AM (#18775570)
Monadic Try, biased Either, Some, pattern matching and destructuting... you don’t even need to know category theory to use and understand them in code, and you let the compiler do all the tough work.

This example - despise the perplexing celebrations - is a product of the limits of Go

Re:Please do not attempt to simplify this code by danieldisu on Friday December 28, 2018 @04:37AM (#18775801)
Yet you can argue that despite it's limitations they could make working (complex) software with it.
Re:Please do not attempt to simplify this code by masklinn on Friday December 28, 2018 @05:55AM (#18776090)
That's not an argument, that's a truism. You can make working (complex) software using nothing but machine code keyed into volatile memory via front-panel switches.
Re:Please do not attempt to simplify this code by martinlaz on Friday December 28, 2018 @11:18AM (#18777607)
can you really?
Re:Please do not attempt to simplify this code by lmm on Friday December 28, 2018 @08:39AM (#18776608)
Isn't that a case of "shit crayons"? People can and do make great things with terrible tools, but that doesn't make those tools any less terrible.
Re:Please do not attempt to simplify this code by dragonwriter on Friday December 28, 2018 @12:59PM (#18778288)
> This example - despise the perplexing celebrations - is a product of the limits of Go

All coding style is a product of the limitations of the language (well, except when it is coding style dictated by the limitations of a different language applied in a cargo cult fashion out of it's appropriate context); and celebrating the choice of how to approach this problem given that it was being done in this language isn't the same as celebrating the language choice. Go would be pretty close to my last choice for anything, but that doesn't stop me from recognizing this as a thoughtful way to apply Go to this problem.