Skip to content

BlackMATov/immut.lua

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

immut.lua (Work In Progress)

Immutable and persistent data structures for Lua

lua5.1 lua5.4 luajit license

Introduction

Installation

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.lua

Quick Start

Coming soon...

Cheat Sheet

list_mode :: 'copy' | 'isll'
AVAILABLE_LIST_MODES :: list_mode[]

dict_mode :: 'copy' | 'hamt' | 'tree'
AVAILABLE_DICT_MODES :: dict_mode[]

List

list :: list_mode -> list_mt

list_mt:size -> integer
list_mt:empty -> boolean

list_mt:head -> any
list_mt:last -> any

list_mt:tail -> list_mt
list_mt:init -> list_mt

list_mt:cons :: any -> list_mt
list_mt:snoc :: any -> list_mt

Dict

dict :: dict_mode -> dict_mt

dict_mt:size -> integer
dict_mt:empty -> boolean

dict_mt:assoc :: any, any -> dict_mt
dict_mt:dissoc :: any -> dict_mt

dict_mt:lookup :: any -> any
dict_mt:contains :: any -> boolean

Changelog

Coming soon...

License

immut.lua is licensed under the MIT License. For more details, see the LICENSE.md file in the repository.

About

Immutable and persistent data structures for Lua

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors

Languages