FsCodec by @jet @moneylion @amjjd @bartelink @eiriktsarpalis and contributors

<PackageReference Include="FsCodec" Version="3.0.0-rc.11" />

 StreamIdModule

public static class StreamIdModule
Helpers for composing and rendering StreamId values
public static class Element

public static class Elements

public static class Gen

Helpers to generate StreamIds given a number of individual id to string mapper functions

public static FSharpFunc<string, string[]> |Parse|(int count)

Splits a StreamId into an expected number of fragments. Throws if the value does not adhere to the expected fragment count.

public static string |Parse1|(string x)

Validates and extracts the StreamId into a single fragment value Throws if the item embeds a `_`, is `null`, or is empty

public static string create(string arg00)

Any string can be a StreamId; parse/dec/Elements.split will judge whether it adheres to a valid form

public static a dec<a>(FSharpFunc<string, a> f, string x)

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.

public static FSharpFunc<a, string> gen<a>(FSharpFunc<a, string> f)

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

public static string[] parse(int count, string x)

Splits a StreamId into the specified number of fragments. Throws if the value does not adhere to the expected fragment count.

public static string parseExactlyOne(string x)

Validates and extracts the StreamId into a single fragment value Throws if the item embeds a `_`, is `null`, or is empty

public static string toString(string arg00)

Render as a string for external use