All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.8.0 - 2024-05-16
- This changelog.
fmap_flat
is now an associated function of the new traitFlattenableRandomStrategy
.fmap_flat
no longer takes animpl Rng
as a a parameter.
0.7.0 - 2024-04-24
- Made
Counter
generic over unsigned numeric types. This lets users createCounter
strategies with custom count types for optimization or compatibility purposes.
0.6.0 - 2024-04-17
- Made
rand-functors
compatible withno-std
crates by separating allocatingRandomStrategy
implementations into thealloc
andstd
features.Sampler
is available without any features.PopulationSampler
andEnumerator
are available with thealloc
orstd
features.UniqueEnumerator
andCounter
are available with thestd
feature.
0.5.0 - 2024-04-11
- A new associated function for
RandomStrategy
:fmap_flat
.fmap_flat
provides a mechanism for removing one layer ofFunctor
nesting and enables new branching behaviour in random processes. - An integration test for
fmap_flat
which tests a random process with multiple branches.
0.4.0 - 2024-04-08
- New
RandomStrategy
:UniqueEnumerator
. This strategy produces the set of all possible outputs of a random process, without counting duplicates.
0.3.0 - 2024-04-06
fmap
is now an associated function ofRandomStrategy
, rather than a method ofFunctor
. This removes theFunctor::Output
hack, which also prevented chainingfmap
withfmap_flat
.
- Type system error that prevented chaining
Functor::fmap
with other operations.
0.2.0 - 2024-03-23
- The
RandomStrategy::fmap_rand_range
associated function and theRandomRangeVariable
trait, which enable sampling from a range of typeRandomVariable
. - An integration test for
fmap_rand_range
, which tests a random process involving a multiplication by a number between 217 and 255, inclusive. - New
Functor
implementation forHashSet
, to allow downstream crates to define their own implementation ofRandomStrategy
with aHashSet
as itsFunctor
.
- All primitive numeric types now implement
RandomVariable
.
- Broken Markdown in
README.md
.
0.1.2 - 2024-03-21
- Further documentation on use cases for
Enumerator
andCounter
.
- All methods in implementations of
Functor
,RandomStrategy
, andRandomVariable
now have the[inline]
attribute, allowing inlining across crate boundaries.
0.1.1 - 2024-03-15
- Renamed
rand
parameter ofRandomStrategy::fmap_rand
torng
, to prevent naming collisions with therand
crate. Counter::fmap_rand
will now pre-allocate enough space on the heap for aHashMap
withf.len()
elements, eliminating unnecessary allocations.
0.1.0 - 2024-03-11
- The traits
RandomStrategy
, which governs how to handle the random parts of a stochastic process, andFunctor
, which governs how to store the inputs, outputs, and intermediate results of aRandomStrategy
. - The
Inner
trait, which is automatically implemented for types which may be contained within aFunctor
. - The
RandomVariable
trait, which describes types that are enumerable and can be sampled from uniformly. - The
Sampler
strategy, which produces a single possible output of a random process. - The
PopulationSampler
strategy, which creates aVec
of at mostN
possible outputs of a random process. - The
Enumerator
strategy, which creates aVec
of all possible outputs of a random process. - The
Counter
strategy, which creates aHashMap
of all possible outputs of a random process and counts of their of occurrences.