protocoll

Crates.ioprotocoll
lib.rsprotocoll
version0.3.1
sourcesrc
created_at2016-11-10 00:29:28.614085
updated_at2016-12-08 21:57:55.323252
descriptionclojure inspired protocols for rust collections.
homepagehttps://crates.io/crates/protocoll
repositoryhttps://github.com/ysmiraak/protocoll
max_upload_size
id7196
size36,248
俞宽 (ysmiraak)

documentation

https://ysmiraak.github.io/protocoll

README

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 :)

the library is currently experimental and extremely unstable.

Commit count: 24

cargo fmt