gleam-lang / suggestions

📙 A place for ideas and feedback
26 stars 2 forks source link

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

Open CrowdHailer opened 3 years ago

CrowdHailer commented 3 years ago

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 3 years ago

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.

CrowdHailer commented 3 years ago

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.