8 comments

[ 3.1 ms ] story [ 25.2 ms ] thread
How does this compare to https://github.com/rtsisyk/luafun ?
From 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.

I 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.
Why 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

Because 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 .. ;)
I wrote this library while working in Torch because I missed clojure.core:

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.

Nice 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

Have fun with Moses. And well, using the dummy "_" is not mandatory, but just convenient. Feel free to using any other namespace though ;)