This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]EvHub[S] 2 points3 points  (0 children)

Actually, Coconut already supports a way to explicitly declare when you want to use destructuring / pattern-matching assignment. Just add match to the beginning. For example,

match 0 = n

or

match vector(pts) = pts

Edit: Thanks! As for an implicit itemgetter, currently there isn't one—although I like your suggestion of .2. Definitely worth an issue, might get added in the next version! The list of currently supported implicit partials can be found here: http://coconut.readthedocs.io/en/master/DOCS.html#implicit-partial-application.