gleam-lang/suggestions

Add content to the "let" section of the language guide that talks about destructuring

Opened this issue · 2 comments

https://gleam.run/book/tour/let-bindings.html

I'm not sure if this should just be a link to the case section or if it's different enough to have it's own content. Given the hypothetical future of exhaustiveness checking it will be a bit different because only single record varients can be destructured in a let.

lpil commented

I think this should go in the sections for each data type as if in let it would mean using data structures before they are introduced.

Fair enough. I reckon a link is still worth having because I don't think it's mentioned that you can destructure in let's anywhere.
Unless it's a deliberate choice to lead people to destructuring with assert.