Supply -package:streams
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.
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
Create a unique supply out of thin air. The "tag" (Char) supplied is
mostly cosmetic, making it easier to figure out where a Unique was
born. See Note [Uniques and tags].
The payload part of the Uniques allocated from this UniqSupply are
guaranteed distinct wrt all other supplies, regardless of their "tag".
This is achieved by allocating the payload part from a single source
of Uniques, namely
genSym, shared across all UniqSupply's.
Build two
UniqSupply from a single one, each of which can
supply its own
Unique.