StreamIdModule
Helpers for composing and rendering StreamId values
Helpers to generate StreamIds given a number of individual id to string mapper functions
Splits a StreamId into an expected number of fragments.
Throws if the value does not adhere to the expected fragment count.
Validates and extracts the StreamId into a single fragment value
Throws if the item embeds a `_`, is `null`, or is empty
Any string can be a StreamId; parse/dec/Elements.split will judge whether it adheres to a valid form
Extracts a single fragment from the StreamId. Throws if the value is composed of more than one item.
public static ValueTuple<a, b> dec2<a, b>(FSharpFunc<string, a> f1, FSharpFunc<string, b> f2, string x)
Extracts 2 fragments from the StreamId. Throws if the value does not adhere to that expected form.
public static ValueTuple<a, b, c> dec3<a, b, c>(FSharpFunc<string, a> f1, FSharpFunc<string, b> f2, FSharpFunc<string, c> f3, string x)
Extracts 3 fragments from the StreamId. Throws if the value does not adhere to that expected form.
public static ValueTuple<a, b, c, d> dec4<a, b, c, d>(FSharpFunc<string, a> f1, FSharpFunc<string, b> f2, FSharpFunc<string, c> f3, FSharpFunc<string, d> f4, string x)
Extracts 4 fragments from the StreamId. Throws if the value does not adhere to that expected form.
Generate a StreamId from a single application-level id, given a rendering function that maps to a non empty fragment without embedded `_` chars
public static FSharpFunc<Tuple<a, b>, string> gen2<a, b>(FSharpFunc<a, string> f1, FSharpFunc<b, string> f2)
Generate a StreamId from a tuple of application-level ids, given two rendering functions that map to a non empty fragment without embedded `_` chars
public static FSharpFunc<Tuple<a, b, c>, string> gen3<a, b, c>(FSharpFunc<a, string> f1, FSharpFunc<b, string> f2, FSharpFunc<c, string> f3)
Generate a StreamId from a triple of application-level ids, given three rendering functions that map to a non empty fragment without embedded `_` chars
public static FSharpFunc<Tuple<a, b, c, d>, string> gen4<a, b, c, d>(FSharpFunc<a, string> f1, FSharpFunc<b, string> f2, FSharpFunc<c, string> f3, FSharpFunc<d, string> f4)
Generate a StreamId from a 4-tuple of application-level ids, given four rendering functions that map to a non empty fragment without embedded `_` chars
Splits a StreamId into the specified number of fragments.
Throws if the value does not adhere to the expected fragment count.
Validates and extracts the StreamId into a single fragment value
Throws if the item embeds a `_`, is `null`, or is empty
Render as a string for external use