unisonweb / unison

A friendly programming language from the future
https://unison-lang.org
Other
5.81k stars 271 forks source link

fix #5441 - malformed Unison examples in source code #5442

Closed kylegoetz closed 2 weeks ago

kylegoetz commented 2 weeks ago

Overview

This changes no behavior. It only removes/updates a couple Unison examples in Haskell comments so they're no longer malformed Unison code.

Interesting/controversial decisions

The docs claim all destructuring bind LHSs must be parenthesized. However, the Haskell code has two examples where this is not true. One of them even uses a special list pattern on the LHS of a restructuring bind. The docs explicitly say this is not supported.

Reading through TermParser, I couldn't find a single reason this would fail, and yet I couldn't get it to succeed in UCM.

Suggesting the docs are right and the comments are not.

Test coverage

No tests because it's just comment changes.

Loose ends

One of the comments I edited makes a claim about how destructuring binds are desugared to a match structure. I have not independently verified this is true; I only edited the malformed restructuring binds.

aryairani commented 2 weeks ago

Good catch, thanks!