gcanti / monocle-ts

Functional optics: a (partial) porting of Scala monocle
https://gcanti.github.io/monocle-ts/
MIT License
1.05k stars 52 forks source link

Add Tuple support: _1, _2 #172

Open toastal opened 2 years ago

toastal commented 2 years ago

Coming from PureScript, I was surprised to not see _1 and _2.

@gcanti I'm very confused about why I need to call _1() ... the code is very similar to Either and _left where you have to call it? Why? Why can't it just be _1 and _left? I tried to make that the case using object syntax, but I'm too unfamiliar with TypeScript to figure out how to make the types work; I was able to use concrete types in my own code elsewhere, but the universally quantified ones, not so much.