Skip to content

clojure inspired protocols for rust collections.

License

Notifications You must be signed in to change notification settings

ysmiraak/protocoll

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

protocoll

some basic protocols and their implementations for rust collections.

inspired by clojure's design, albeit not persistent.

cargo crate

api doc

these protocols are intended for containing the unavoidable complexities in the rust language through the simplicity of functional programming as is strongly manifested in clojure, which does everything with only a handful of functions operating on several kinds of collections.

they try to fulfill that intention by supporting just a few functions which either take type T for creation and type &T for utilization, and to reject the abominations which take type &mut T for destructive alteration.

however, for efficiency reasons, i find that i have to support the abominations. for example, i cannot consume a value stored in a map to produce a new value of the same type to replace the old one without first removing the entry and then re-inserting the entry. on the other hand, the abominations can just mutate the value in place. so if you know how to temporarily move out a value without rust complaining, please let me know :)

About

clojure inspired protocols for rust collections.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages