jon.recoil.org

Module Flambda2_algorithms.Lmap

Warning: this module is unstable and part of compiler-libs.

This module supports lists of key-value pairs that aren't intended for fast lookup. These are suitable for use in ASTs, where it's uncommon to look up a value directly but very common to fold over the list to produce an environment that is a true Map. They also preserve the order of the elements, which is necessary for performing comparisons up to renaming of function slots and code ids.

Several operations on Map are provided here for consistency, but they do not necessarily provide the same checks that a Map would and in most cases the performance is different. Behavior will be the same provided that there are never duplicate keys. You can manually invoke invariant to check for duplicates.

module type Thing = sig ... end
module type S = sig ... end