3 ms·
Moses, utility library for functional programming in Lua
- meowface 11y agoHow does this compare to https://github.com/rtsisyk/luafun https://github.com/rtsisyk/luafun ?
- williamaadams 11y agoFrom a casual glance, luafun tries to compose with iterators as much as possible. It looks like Moses is largely table based, which might be more memory intensive. Also, luafun was designed around optimizations offered in LuaJIT. I doubt the same is true of Moses.
- xixixao 11y agoI find aliases to be pretty clearly bad API. By all means, include those aliases in documentation so people can search using them, but having a code base littered with two different names for the same thing makes it harder to search, learn from and code-mod it.
- scionaura 11y agoWhy would I use this if I already use Penlight for functional programming utils and classic [1] for OOP in lua? [1] - https://github.com/deepmind/classic https://github.com/deepmind/classic
- fit2rule 11y agoBecause you didn't know that Penlight had FP built in? I certainly didn't, and I've been a user of Penlight for a few years now .. ;)
- goldenshale 11y agoI wrote this library while working in Torch because I missed clojure.core: https://github.com/rosejn/lua-fn/blob/master/fn/seq.lua https://github.com/rosejn/lua-fn/blob/master/fn/seq.lua It provides a lazy sequence abstraction based on iterators as well as a nice set of functional building blocks. I think this type of library design is better than the for loop based style of moses because you can handle infinite sequences, partially sampled execution, early stopping, etc.
- fit2rule 11y agoNice library - I've put it on my workbench for some experiments. I've been using lua-enumerable for pretty much the same purpose - its a little lighter (single file to drop into your project) and it grafts on top of table, so its also less likely to impact your other usage of "_", if you use it, in a project .. https://github.com/mikelovesrobots/lua-enumerable https://github.com/mikelovesrobots/lua-enumerable
- ryonaba 11y agoHave fun with Moses. And well, using the dummy "_" is not mandatory, but just convenient. Feel free to using any other namespace though ;)