monet / monet.js

monet.js - Monadic types library for JavaScript
https://monet.github.io/monet.js/
MIT License
1.6k stars 114 forks source link

List.nth or similar #229

Closed pvarga-dni closed 3 years ago

pvarga-dni commented 4 years ago

Is there a method to get the nth element of a List, by index?

If not, would it be welcome or was this omitted on purpose?

ulfryk commented 4 years ago

@pvarga-dni - there isn't any as for lists we assumed that head() is enough :)

But if there are cases when it's required than it would be awesome if you like to prepare a PR :)

The only concern is that in version 1.0.0 of monet, there will be no lists as such immutable data structures (mostly collections) that really well work with monet are already provided by other libraries like immutable.js

ulfryk commented 3 years ago

@pvarga-dni nth and lookup added ( in #241 ) you can use it for now in monet@0.9.1-472 nigthly version, will be released in stable this week :)

ulfryk commented 3 years ago
A new version of the package monet (0.9.2) was published at 2021-03-05T17:36:17.909Z from
35.227.97.188. The shasum of this package was c59d4390937a1b021126844b50b993963c6b0ec7.