Crates.io | protocoll |
lib.rs | protocoll |
version | 0.3.1 |
source | src |
created_at | 2016-11-10 00:29:28.614085 |
updated_at | 2016-12-08 21:57:55.323252 |
description | clojure inspired protocols for rust collections. |
homepage | https://crates.io/crates/protocoll |
repository | https://github.com/ysmiraak/protocoll |
max_upload_size | |
id | 7196 |
size | 36,248 |
some basic protocols and their implementations for rust
collections.
inspired by clojure
's design, albeit not persistent.
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.