Immutable and persistent data structures for Lua
immut.lua is a single-file pure Lua library and does not require any external dependencies. It is designed to work with Lua 5.1 and later, LuaJIT, and Luau (Roblox).
All you need to start using the library is the immut.lua source file. You can download it from the releases page or clone the repository and copy the file to your project.
If you are using LuaRocks, you can install the library using the following command:
luarocks install immut.luaComing soon...
dict.new :: dict
dict.size :: dict -> integer
dict.empty :: dict -> boolean
dict.assoc :: dict, any, any -> dict
dict.dissoc :: dict, any -> dict
dict.lookup :: dict, any -> any
dict.contains :: dict, any -> boolean
list.new :: list
list.size :: list -> integer
list.empty :: list -> boolean
stack.new :: stack
stack.size :: stack -> integer
stack.empty :: stack -> boolean
Coming soon...
immut.lua is licensed under the MIT License. For more details, see the LICENSE.md file in the repository.