I'm working through the Gleam Language Tour. I decided to revisit some of the concepts, especially the results-module and especially the use keyword
https://tour.gleam.run/standard-library/result-module/
https://tour.gleam.run/advanced-features/use/
It keeps the callbacks and error checking under control, but it seems like you lose a lot of information along the way. For example, how would we know which function returned an error? I was also surprised that the int.parse example returned an Error(Nil) with no extra information.
There must be a trick I'm missing. What are you guys doing to ease the burden of maintenance?
Also, I found the page on Option module a little confusing. Is it discouraged to use Option in Gleam since Result is heavily favored in the language? Should we avoid it in normal Gleam code?
An interactive introduction and reference to the Gleam programming language. Learn Gleam in your browser!
An interactive introduction and reference to the Gleam programming language. Learn Gleam in your browser!