Supply
A fast unique identifier supply with local pooling and replay support.
One often has a desire to generate a bunch of integer identifiers
within a single process that are unique within that process. You could
use UUIDs, but they can be expensive to generate; you don't want to
have your threads contending for a single external counter if the
identifier is not going to be used outside the process.
concurrent-supply builds a tree-like structure which can be
split; you can make smaller unique supplies and then you allocate from
your supplies locally. Internally it pulls from a unique supply one
block at a time as you walk into parts of the tree that haven't been
explored.
A user managed globally unique variable supply.
A fast unique identifier supply with local pooling and replay support.
One often has a desire to generate a bunch of integer identifiers
within a single process that are unique within that process. You could
use UUIDs, but they can be expensive to generate; you don't want to
have your threads contending for a single external counter if the
identifier is not going to be used outside the process.
concurrent-supply builds a tree-like structure which can be
split; you can make smaller unique supplies and then you allocate from
your supplies locally. Internally it pulls from a unique supply one
block at a time as you walk into parts of the tree that haven't been
explored.
This library can be used to generate values (for example, new names)
without the need to thread state. This means that functions that need
to generate new values only need a supply object as an argument, and
they do not need to return a new supply object as a result. This
decreases the number of data-dependencies in a program, which makes it
easier to exploit parallelism.
The technique for generating new values is based on the paper ''On
Generating Unique Names'' by Lennart Augustsson, Mikael Rittri, and
Dan Synek.
Feed a
Process some input.
Examples:
>>> run $ supply [1,2,3] echo <~ source [4..6]
[1,2,3,4,5,6]
SupplyContext theta is a standalone deriving
declaration, where
theta is the context supplied by the user.
supply with the arguments flipped.
Not on Stackage, so not searched.
Composable request-response pipelines
Not on Stackage, so not searched.
Composable request-response pipelines
Not on Stackage, so not searched.
Supply-chain interface for basic streaming
Unique Supply
A value of type
UniqSupply is unique, and it can supply
one distinct
Unique. Also, from the supply, one can also
manufacture an arbitrary number of further
UniqueSupply
values, which will be distinct from the first and from all others.
Get the tag uniques generated from this deterministic unique supply
would have
Initialize a deterministic unique supply with the given Tag and
initial unique.
Set the tag of uniques generated from this deterministic unique supply
Create an infinite list of
UniqSupply from a single one