Move stdlib into its own crate

This commit is contained in:
Richard Feldman 2019-07-22 22:04:28 -04:00
parent 4502d2630f
commit c7a923d226
11 changed files with 334 additions and 81 deletions

15
stdlib/src/map.rs Normal file
View file

@ -0,0 +1,15 @@
use im_rc::hashmap::HashMap;
use im_rc::vector::Vector;
use fxhash::FxHasher;
/// A persistent HashMap which records insertion order and iterates in that order.
pub struct Map<K, V> {
store: HashMap<K, V, BuildHasherDefault<FxHasher>>;
order: Vector<K>
}
impl<K, V> Map<K, V> {
pub fn is_empty(self) -> bool {
self.store.is_empty()
}
}