{"id":406695,"date":"2024-06-29T19:05:33","date_gmt":"2024-06-29T19:05:33","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=406695"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=406695","title":{"rendered":"<span>Immutype \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u0442\u0430\u043a\u0438\u043c\u0438 \u043a\u0430\u043a <em>readonly struct<\/em>, \u043d\u0430\u043c \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b \u0442\u0438\u043f\u0430 \u0438\u043b\u0438 <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/csharp\/programming-guide\/classes-and-structs\/extension-methods\" rel=\"noopener noreferrer nofollow\"><u>\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f<\/u><\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0437\u0434\u0430\u044e\u0442 \u043a\u043e\u043f\u0438\u044e \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u0438\u0437\u043c\u0435\u043d\u044f\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0438\u043b\u0438 \u043f\u043e\u043b\u0435. \u0422\u0430\u043a\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u0434 \u0447\u0438\u0449\u0435 \u0438 \u043f\u0440\u043e\u0449\u0435, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044f \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0441\u0442\u044c. \u041d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0441\u0442\u044c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u043f\u043e\u0442\u043e\u043a\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0442\u0438\u043f\u0430 \u0441 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c. \u041e\u0431\u044b\u0447\u043d\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044f \u0438\u043b\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c, \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043d\u0435\u043f\u043e\u043b\u043d\u0443\u044e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u043d\u0443\u044e \u043a\u043e\u043f\u0438\u044e \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440, \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u044d\u0442\u0443 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u043d\u0443\u044e \u043a\u043e\u043f\u0438\u044e \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u044e.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b <em>Person<\/em>:<\/p>\n<pre><code class=\"cs\">public readonly struct Person {     public readonly string Name;     public readonly int Age;        public Person(string name = \"\", int age = 0)     {         Name = name;         Age = age;     }        public Person WithName(string name) => new Person(name, Age);         public Person WithAge(int age) => new Person(Name, age); }<\/code><\/pre>\n<p>\u2014 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432 <em>With\u2026<\/em> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u043f\u043e\u043b\u043d\u0430\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u043d\u0430\u044f \u043a\u043e\u043f\u0438\u044f \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 <em>Person<\/em>. \u041a\u043e\u043f\u0438\u044f \u043d\u0435\u043f\u043e\u043b\u043d\u0430\u044f, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0434\u043b\u044f \u0441\u0441\u044b\u043b\u043e\u0447\u043d\u044b\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0438 \u043f\u043e\u043b\u0435\u0439, \u043a\u0430\u043a \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442. \u041d\u043e \u044d\u0442\u043e \u043d\u0435 \u0441\u0442\u0440\u0430\u0448\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432\u0441\u0435 \u0442\u0438\u043f\u044b \u044d\u0442\u0438\u0445 \u043f\u043e\u043b\u0435\u0439 \u0438\u043b\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0442\u0430\u043a\u0436\u0435 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b.\u00a0<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0442\u0438\u043f\u0430:<\/p>\n<pre><code class=\"cs\">var john = new Person().WithName(\"John\").WithAge(15);<\/code><\/pre>\n<p>\u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c \u043c\u0435\u0442\u043e\u0434\u0430\u043c, \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043e\u043d\u0438 \u0438\u043c\u0435\u044e\u0442 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430:<\/p>\n<pre><code class=\"cs\">public readonly struct Person {     public readonly string Name;     public readonly int Age;      public Person(string name = \"\", int age = 0)     {         Name = name;         Age = age;     } }  public static class PersonExtensions {     public static Person WithName(this Person it, string name) =>         new Person(name, it.Age);      public static Person WithAge(this Person it, int age) =>         new Person(it.Name, age); }<\/code><\/pre>\n<p>\u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u0438 \u043a \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c \u0438 \u043a\u043b\u0430\u0441\u0441\u0430\u043c. <\/p>\n<p>\u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 C# \u0432\u0435\u0440\u0441\u0438\u0438 9, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e <em>record<\/em> \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441\u0441\u044b\u043b\u043e\u0447\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430. \u041e\u043d \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u044f\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. <em>Record<\/em> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0438 \u0441 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u043c\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438\u043b\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0441\u0432\u043e\u0439\u0441\u0442\u0432:<\/p>\n<pre><code class=\"cs\">public record Person(string Name = \"\", int Age = 0);<\/code><\/pre>\n<p>\u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u0437\u0430\u043f\u0438\u0441\u0438 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u044b \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0434\u043b\u044f \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0434\u0430\u043d\u043d\u044b\u0445. \u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 C# \u0432\u0435\u0440\u0441\u0438\u0438 10, \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0442\u0438\u043f\u044b <em>record struct<\/em> \u0442\u0430\u043a\u0436\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438\u043b\u0438 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u0441\u0432\u043e\u0439\u0441\u0442\u0432:<\/p>\n<pre><code class=\"cs\">public readonly record struct Person(string Name = \"\", int Age = 0);<\/code><\/pre>\n<p>\u041e\u0431\u044b\u0447\u043d\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c \u0438\u0437 C# \u0432\u0435\u0440\u0441\u0438\u0438 9 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043b\u043d\u044b\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c <em>record class<\/em>, \u0433\u0434\u0435 <em>class<\/em> &#8212; \u044d\u0442\u043e \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e. \u0412\u044b\u0431\u043e\u0440 \u043c\u0435\u0436\u0434\u0443 <em>record class<\/em> \u0438 <em>record struct<\/em>, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u044b\u0431\u043e\u0440\u0443 \u043c\u0435\u0436\u0434\u0443 \u043c\u0435\u0436\u0434\u0443 <em>class<\/em> \u0438 <em>struct<\/em>.<\/p>\n<p>\u0421 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u0438 \u043d\u043e\u0432\u043e\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 <em>with<\/em>. \u041e\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043d\u043e\u0432\u044b\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u0437\u0430\u043f\u0438\u0441\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u043f\u0438\u0435\u0439 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u0432 \u044d\u0442\u043e\u0439 \u043a\u043e\u043f\u0438\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0438 \u043f\u043e\u043b\u044f, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0447\u0435\u0433\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u043f\u043e\u043b\u043d\u0430\u044f \u043a\u043e\u043f\u0438\u044f. \u0414\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432:<\/p>\n<pre><code class=\"cs\">var john = new Person() with { Name = \"John\", Age = 15 };<\/code><\/pre>\n<p>\u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u044b\u043c \u0438 \u043b\u0435\u0433\u043a\u043e \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u043c. \u041d\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u0447\u0438\u043d, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0438\u0437 \u043f\u0435\u0440\u0432\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0434\u043b\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u0435\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u043c\u0443 \u0441\u043b\u043e\u0432\u0443 <em>with<\/em>. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043d\u0435 \u0432\u043e \u0432\u0441\u0435\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0438 \u0438\u0437-\u0437\u0430 \u0432\u0435\u0440\u0441\u0438\u0438 C# \u0438 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430. \u0410 \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u0432 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0445 \u0442\u0438\u043f\u0430\u0445 \u0447\u0430\u0441\u0442\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u043b\u044f \u0438\u043b\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0435 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"cs\">public record Person(   string Name = \"\",   int Age = 0,   ImmutableArray&lt;Person> Friends = default);<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f\u043c\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u043e <em>with<\/em> \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043c\u0435\u043d\u0435\u0435 \u0447\u0438\u0442\u0430\u0435\u043c\u043e:<\/p>\n<pre><code class=\"cs\">var john = new Person() with { Name = \"John\", Age = 15 }     with { Friends = ImmutableArray.Create(new Person() with {Name = \"David\"}) };  john = john with {     Friends = (john.Friends == default ? ImmutableArray&lt;Person>.Empty : john.Friends)      .Add(new Person() with { Name = \"Sophia\" })     .Add(new Person() with { Name = \"James\" }) };  john = john with {     Friends = (john.Friends == default ? ImmutableArray&lt;Person>.Empty : john.Friends)     .Remove(new Person() with { Name = \"David\" }) };<\/code><\/pre>\n<p>\u041f\u043e \u044d\u0442\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0438\u0434\u0435\u044f <a href=\"https:\/\/github.com\/DevTeam\/Immutype\" rel=\"noopener noreferrer nofollow\"><u>Immutype<\/u><\/a> \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0440\u0443\u0447\u0438\u0442\u044c \u0435\u043c\u0443 \u0432\u0441\u044e \u0440\u0443\u0442\u0438\u043d\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0441\u0442\u0438.<\/p>\n<p>\u042d\u0442\u043e <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/csharp\/roslyn-sdk\/source-generators-overview\" rel=\"noopener noreferrer nofollow\"><u>\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043a\u043e\u0434\u0430 .NET<\/u><\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u0441\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e, \u043f\u043e\u043a\u0430 \u0432\u044b \u043f\u0438\u0448\u0438\u0442\u0435 \u043a\u043e\u0434. \u041e\u043d \u0438\u0449\u0435\u0442 \u0432\u0441\u0435 \u0442\u0438\u043f\u044b, \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c <code>[Immutype.Target]<\/code>, \u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0430\u043a\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043b\u0430\u0441\u0441 \u0441 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f. \u042d\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u043d\u0435 \u0437\u0430\u043c\u0443\u0441\u043e\u0440\u0438\u0432\u0430\u044e\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u0434 \u0438 \u043d\u0435 \u043c\u0430\u044f\u0447\u0430\u0442 \u0441\u0432\u043e\u0438\u043c\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 \u043a\u043e\u043c\u043c\u0438\u0442\u0430\u0445. \u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043e\u043f\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f:<\/p>\n<ul>\n<li>\n<p>\u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0435\u0439, \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0432\u044b\u0435 \u0438\u043c\u0435\u044e\u0442\u0441\u044f<\/p>\n<\/li>\n<li>\n<p>\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c <code>[Immutype.Target]<\/code>, \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0439 \u0435\u0441\u0442\u044c<\/p>\n<\/li>\n<li>\n<p>\u043f\u0435\u0440\u0432\u044b\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0441 \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0447\u0438\u0441\u043b\u043e\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438:<\/p>\n<pre><code class=\"cs\">[Immutype.Target] public record Person(   int Age,   string Name = \"\",   ImmutableArray&lt;Person> Friends = default);<\/code><\/pre>\n<p>\u2014 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u044b\u0448\u0435, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cs\">var john = new Person(15).WithName(\"John\").WithAge(15) \u00a0\u00a0\u00a0\u00a0.WithFriends(new Person(16).WithName(\"David\"));  john = john.AddFriends( new Person(17).WithName(\"Sophia\"), new Person(14).WithName(\"James\"));  john = john.RemoveFriends(new Person(16).WithName(\"David\"));<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0438\u043b\u0438 \u043f\u043e\u043b\u0435\u0439, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a <em>Age<\/em> \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u043c\u0435\u0442\u043e\u0434\u0443 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"cs\">Person WithAge(this Person it, int age)<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0438\u043b\u0438 \u043f\u043e\u043b\u0435\u0439 \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0435 \u0438\u043b\u0438 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a <em>Name<\/em>, \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434, \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e:<\/p>\n<pre><code class=\"cs\">Person WithDefaultName(this Person it)<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0439 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u043b\u044f <em>Friends<\/em> \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u043e \u0447\u0435\u0442\u044b\u0440\u0435 \u043c\u0435\u0442\u043e\u0434\u0430.<\/p>\n<ul>\n<li>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e, \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u0442\u043e\u0434 \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u0447\u0438\u0441\u043b\u043e\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432:<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"cs\">Person WithFriends(this Person it, params Person[] friends)<\/code><\/pre>\n<ul>\n<li>\n<p>\u0422\u0430\u043a\u043e\u0439 \u0436\u0435 \u043a\u0430\u043a \u0438 \u0432\u044b\u0448\u0435, \u043d\u043e \u0441 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u043c \u0442\u0438\u043f\u043e\u043c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430:<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"cs\">Person WithFriends(this Person it, ImmutableArray&lt;Person> firends)<\/code><\/pre>\n<ul>\n<li>\n<p>\u0427\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043e\u043f\u0438\u044e \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432:<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"cs\">Person AddFriends(this Person it, params Person[] friends)<\/code><\/pre>\n<ul>\n<li>\n<p>\u0427\u0442\u043e\u0431\u044b\u00a0\u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043e\u043f\u0438\u044e \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438, \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b:<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"cs\">Person RemoveFriends(this Person it, params Person[] friends)<\/code><\/pre>\n<p>\u041a\u043e\u043d\u0442\u0440\u0430\u0441\u0442 \u0432 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0435 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0442\u0438\u043f\u043e\u0432 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0439 \u0435\u0449\u0435 \u0431\u043e\u043b\u0435\u0435 \u043e\u0447\u0435\u0432\u0438\u0434\u0435\u043d. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438:<\/p>\n<pre><code class=\"cs\">public record Person(   string Name = \"\",   int Age = 0,   IReadOnlyCollection&lt;Person>? Friends = default);<\/code><\/pre>\n<p>\u2014 \u043d\u0430\u0448 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u0441 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c \u0441\u043b\u043e\u0432\u043e\u043c <em>with <\/em>\u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cs\">var john = new Person()     with { Name = \"John\", Age = 15 }     with { Friends = new List&lt;Person>{ new Person() with { Name = \"David\" } }};  john = john with {     Friends = (john.Friends ?? Enumerable.Empty&lt;Person>())     .Concat(         new List&lt;Person>[]{              new Person() with { Name = \"Sophia\" },             new Person() with { Name = \"James\" }})     .ToList() };  john = john with {     Friends = (john.Friends ?? Enumerable.Empty&lt;Person>())     .Except(new List&lt;Person> { new Person() with { Name = \"David\" } })     .ToList() };<\/code><\/pre>\n<p>\u0410 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 <em>Immutype<\/em> \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0436\u043d\u0438\u043c \u0434\u043b\u044f \u043b\u044e\u0431\u044b\u0445 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0439 \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430 \u043d\u0438\u0436\u0435:<\/p>\n<pre><code>T[] interface IEnumerable&lt;T> class List&lt;T> interface IReadOnlyCollection&lt;T> interface IReadOnlyList&lt;T> interface ICollection&lt;T> interface IList&lt;T> class HashSet&lt;T> interface ISet&lt;T> class Queue&lt;T> class Stack&lt;T> interface IReadOnlyCollection&lt;T> interface IReadOnlyList&lt;T> interface IReadOnlySet&lt;T> class ImmutableList&lt;T> interface IImmutableList&lt;T> struct ImmutableArray&lt;T> class ImmutableQueue&lt;T> interface IImmutableQueue&lt;T> class ImmutableStack&lt;T> interface IImmutableStack&lt;T><\/code><\/pre>\n<p><em>Immutype<\/em> \u0442\u0430\u043a\u0436\u0435 \u0431\u0435\u0440\u0435\u0442 \u043d\u0430 \u0441\u0435\u0431\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0441 \u0442\u0438\u043f\u0430\u043c\u0438, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u043c\u0438 <em>null<\/em> \u0438\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0438 \u0432\u0441\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0442\u0438\u043f\u0430.<\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a <em>Immutype<\/em> &#8212; \u044d\u0442\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043a\u043e\u0434\u0430, \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0438 \u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0431\u043e\u0440\u043a\u0438, \u043d\u0435 \u0437\u0430\u0445\u043b\u0430\u043c\u043b\u044f\u0435\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434. \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b <em>Immutype<\/em> \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c: .NET SDK 5.0.102 \u0438\u043b\u0438 \u043d\u043e\u0432\u0435\u0435. \u041d\u043e \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f .NET Framework 4.5.\u00a0<\/p>\n<p><em>Immutype<\/em> \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/microsoft.codeanalysis.iincrementalgenerator?view=roslyn-dotnet-4.0.1\" rel=\"noopener noreferrer nofollow\"><u>\u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u0443\u044e \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u043a\u043e\u0434\u0430<\/u><\/a>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043d\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c\u0438 \u0431\u0443\u0434\u0435\u0442 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439.\u00a0<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0447\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0432 \u0432\u0430\u0448\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 <a href=\"https:\/\/www.nuget.org\/packages\/Immutype\" rel=\"noopener noreferrer nofollow\"><u>\u043f\u0430\u043a\u0435\u0442 Immutype<\/u><\/a> \u0438 \u043e\u0442\u043c\u0435\u0442\u044c\u0442\u0435 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0435 \u0442\u0438\u043f\u044b \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c <code>[Immutype.Target]<\/code> \u043f\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<p>\u0421 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f <a href=\"https:\/\/github.com\/DevTeam\/Immutype\" rel=\"noopener noreferrer nofollow\"><u>\u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/u><\/a>. \u0411\u0443\u0434\u0443 \u043f\u0440\u0438\u0437\u043d\u0430\u0442\u0435\u043b\u0435\u043d \u0437\u0430 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438, \u043d\u043e\u0432\u044b\u0435 \u0438\u0434\u0435\u0438 \u0438 \u0432\u043a\u043b\u0430\u0434 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442.<\/p>\n<h2>\u0422\u0435\u0441\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438<\/h2>\n<p>\u041f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <em>record<\/em> \u0438 <em>record struct<\/em> \u0441 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c \u0441\u043b\u043e\u0432\u043e\u043c <strong><em>With<\/em><\/strong> \u0438 \u0441\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u043c\u0438 <strong><em>Immutype,<\/em><\/strong> \u0434\u043b\u044f \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0441 \u043e\u0434\u043d\u0438\u043c, \u0434\u0432\u0443\u043c\u044f \u0438 \u0447\u0435\u0442\u044b\u0440\u044c\u043c\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438. \u0422\u0438\u043f\u044b \u0441\u0432\u043e\u0439\u0441\u0442\u0432: <em>string<\/em>, <em>int<\/em> \u0438 <em>bool<\/em>.<\/p>\n<pre><code>BenchmarkDotNet=v0.13.1, OS=Windows 10.0.22000 Intel Core i7-10875H CPU 2.30GHz, 1 CPU, 16 logical and 8 physical cores .NET SDK=6.0.100   [Host]     : .NET 6.0.0 (6.0.21.52210), X64 RyuJIT   DefaultJob : .NET 6.0.0 (6.0.21.52210), X64 RyuJIT<\/code><\/pre>\n<p>\u0421 \u043e\u0434\u043d\u0438\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e\u043c <em>string<\/em>:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th data-colwidth=\"188\" width=\"188\">\n<p>Method<\/p>\n<\/th>\n<th data-colwidth=\"91\" width=\"91\">\n<p align=\"center\">Mean<\/p>\n<\/th>\n<th data-colwidth=\"89\" width=\"89\">\n<p>Error<\/p>\n<\/th>\n<th data-colwidth=\"95\" width=\"95\">\n<p>StdDev<\/p>\n<\/th>\n<th data-colwidth=\"86\" width=\"86\">\n<p>Median<\/p>\n<\/th>\n<th>\n<p>Gen 0<\/p>\n<\/th>\n<th>\n<p>Allocated<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td data-colwidth=\"188\" width=\"188\">\n<p><strong><em>Immutype<\/em><\/strong> record struct<\/p>\n<\/td>\n<td data-colwidth=\"91\" width=\"91\">\n<p>0.0000 ns<\/p>\n<\/td>\n<td data-colwidth=\"89\" width=\"89\">\n<p>0.0000 ns<\/p>\n<\/td>\n<td data-colwidth=\"95\" width=\"95\">\n<p>0.0000 ns<\/p>\n<\/td>\n<td data-colwidth=\"86\" width=\"86\">\n<p>0.0000 ns<\/p>\n<\/td>\n<td>\n<p>&#8212;<\/p>\n<\/td>\n<td>\n<p>&#8212;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"188\" width=\"188\">\n<p><strong><em>With<\/em><\/strong> record struct<\/p>\n<\/td>\n<td data-colwidth=\"91\" width=\"91\">\n<p>0.0317 ns<\/p>\n<\/td>\n<td data-colwidth=\"89\" width=\"89\">\n<p>0.0287 ns<\/p>\n<\/td>\n<td data-colwidth=\"95\" width=\"95\">\n<p>0.0307 ns<\/p>\n<\/td>\n<td data-colwidth=\"86\" width=\"86\">\n<p>0.0240 ns<\/p>\n<\/td>\n<td>\n<p>&#8212;<\/p>\n<\/td>\n<td>\n<p>&#8212;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"188\" width=\"188\">\n<p><strong><em>With<\/em><\/strong> record<\/p>\n<\/td>\n<td data-colwidth=\"91\" width=\"91\">\n<p>6.1894 ns<\/p>\n<\/td>\n<td data-colwidth=\"89\" width=\"89\">\n<p>0.1489 ns<\/p>\n<\/td>\n<td data-colwidth=\"95\" width=\"95\">\n<p>0.2797 ns<\/p>\n<\/td>\n<td data-colwidth=\"86\" width=\"86\">\n<p>6.3389 ns<\/p>\n<\/td>\n<td>\n<p>0.0029<\/p>\n<\/td>\n<td>\n<p>24 B<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"188\" width=\"188\">\n<p><strong><em>Immutype<\/em><\/strong> record<\/p>\n<\/td>\n<td data-colwidth=\"91\" width=\"91\">\n<p>7.2829 ns<\/p>\n<\/td>\n<td data-colwidth=\"89\" width=\"89\">\n<p>0.1577 ns<\/p>\n<\/td>\n<td data-colwidth=\"95\" width=\"95\">\n<p>0.1619 ns<\/p>\n<\/td>\n<td data-colwidth=\"86\" width=\"86\">\n<p>7.2482 ns<\/p>\n<\/td>\n<td>\n<p>0.0029<\/p>\n<\/td>\n<td>\n<p>24 B<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0421 \u0434\u0432\u0443\u043c\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 <em>string<\/em> \u0438 <em>int<\/em>:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th data-colwidth=\"195\" width=\"195\">\n<p>Method<\/p>\n<\/th>\n<th data-colwidth=\"97\" width=\"97\">\n<p>Mean<\/p>\n<\/th>\n<th data-colwidth=\"83\" width=\"83\">\n<p>Error<\/p>\n<\/th>\n<th data-colwidth=\"82\" width=\"82\">\n<p>StdDev<\/p>\n<\/th>\n<th data-colwidth=\"92\" width=\"92\">\n<p>Median<\/p>\n<\/th>\n<th>\n<p>Gen 0<\/p>\n<\/th>\n<th>\n<p>Allocated<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td data-colwidth=\"195\" width=\"195\">\n<p><strong><em>With<\/em><\/strong> record struct<\/p>\n<\/td>\n<td data-colwidth=\"97\" width=\"97\">\n<p>0.0195 ns<\/p>\n<\/td>\n<td data-colwidth=\"83\" width=\"83\">\n<p>0.0296 ns<\/p>\n<\/td>\n<td data-colwidth=\"82\" width=\"82\">\n<p>0.0291 ns<\/p>\n<\/td>\n<td data-colwidth=\"92\" width=\"92\">\n<p>0.0036 ns<\/p>\n<\/td>\n<td>\n<p>&#8212;<\/p>\n<\/td>\n<td>\n<p>&#8212;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"195\" width=\"195\">\n<p><strong><em>Immutype<\/em><\/strong> record struct<\/p>\n<\/td>\n<td data-colwidth=\"97\" width=\"97\">\n<p>0.0442 ns<\/p>\n<\/td>\n<td data-colwidth=\"83\" width=\"83\">\n<p>0.0257 ns<\/p>\n<\/td>\n<td data-colwidth=\"82\" width=\"82\">\n<p>0.0352 ns<\/p>\n<\/td>\n<td data-colwidth=\"92\" width=\"92\">\n<p>0.0285 ns<\/p>\n<\/td>\n<td>\n<p>&#8212;<\/p>\n<\/td>\n<td>\n<p>&#8212;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"195\" width=\"195\">\n<p><strong><em>With<\/em><\/strong> record<\/p>\n<\/td>\n<td data-colwidth=\"97\" width=\"97\">\n<p>8.2670 ns<\/p>\n<\/td>\n<td data-colwidth=\"83\" width=\"83\">\n<p>0.1532 ns<\/p>\n<\/td>\n<td data-colwidth=\"82\" width=\"82\">\n<p>0.1280 ns<\/p>\n<\/td>\n<td data-colwidth=\"92\" width=\"92\">\n<p>8.2548 ns<\/p>\n<\/td>\n<td>\n<p>0.0038<\/p>\n<\/td>\n<td>\n<p>32 B<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"195\" width=\"195\">\n<p><strong><em>Immutype<\/em><\/strong> record<\/p>\n<\/td>\n<td data-colwidth=\"97\" width=\"97\">\n<p>10.6809 ns<\/p>\n<\/td>\n<td data-colwidth=\"83\" width=\"83\">\n<p>0.2420 ns<\/p>\n<\/td>\n<td data-colwidth=\"82\" width=\"82\">\n<p>0.4424 ns<\/p>\n<\/td>\n<td data-colwidth=\"92\" width=\"92\">\n<p>10.8150 ns<\/p>\n<\/td>\n<td>\n<p>0.0076<\/p>\n<\/td>\n<td>\n<p>64 B<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0421 \u0447\u0435\u0442\u044b\u0440\u044c\u043c\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 <em>string<\/em>, <em>int, string<\/em> \u0438 <em>bool<\/em>:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th data-colwidth=\"194\" width=\"194\">\n<p>Method<\/p>\n<\/th>\n<th data-colwidth=\"91\" width=\"91\">\n<p>Mean<\/p>\n<\/th>\n<th data-colwidth=\"87\" width=\"87\">\n<p>Error<\/p>\n<\/th>\n<th data-colwidth=\"85\" width=\"85\">\n<p>StdDev<\/p>\n<\/th>\n<th data-colwidth=\"92\" width=\"92\">\n<p>Median<\/p>\n<\/th>\n<th>\n<p>Gen 0<\/p>\n<\/th>\n<th>\n<p>Allocated<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td data-colwidth=\"194\" width=\"194\">\n<p><strong><em>Immutype<\/em><\/strong> record struct<\/p>\n<\/td>\n<td data-colwidth=\"91\" width=\"91\">\n<p>0.0409 ns<\/p>\n<\/td>\n<td data-colwidth=\"87\" width=\"87\">\n<p>0.0074 ns<\/p>\n<\/td>\n<td data-colwidth=\"85\" width=\"85\">\n<p>0.0058 ns<\/p>\n<\/td>\n<td data-colwidth=\"92\" width=\"92\">\n<p>0.0407 ns<\/p>\n<\/td>\n<td>\n<p>&#8212;<\/p>\n<\/td>\n<td>\n<p>&#8212;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"194\" width=\"194\">\n<p><strong><em>With<\/em><\/strong> record struct<\/p>\n<\/td>\n<td data-colwidth=\"91\" width=\"91\">\n<p>0.0695 ns<\/p>\n<\/td>\n<td data-colwidth=\"87\" width=\"87\">\n<p>0.0275 ns<\/p>\n<\/td>\n<td data-colwidth=\"85\" width=\"85\">\n<p>0.0633 ns<\/p>\n<\/td>\n<td data-colwidth=\"92\" width=\"92\">\n<p>0.0491 ns<\/p>\n<\/td>\n<td>\n<p>&#8212;<\/p>\n<\/td>\n<td>\n<p>&#8212;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"194\" width=\"194\">\n<p><strong><em>With<\/em><\/strong> record<\/p>\n<\/td>\n<td data-colwidth=\"91\" width=\"91\">\n<p>10.0555 ns<\/p>\n<\/td>\n<td data-colwidth=\"87\" width=\"87\">\n<p>0.2268 ns<\/p>\n<\/td>\n<td data-colwidth=\"85\" width=\"85\">\n<p>0.3790 ns<\/p>\n<\/td>\n<td data-colwidth=\"92\" width=\"92\">\n<p>9.8518 ns<\/p>\n<\/td>\n<td>\n<p>0.0048<\/p>\n<\/td>\n<td>\n<p>40 B<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"194\" width=\"194\">\n<p><strong><em>Immutype<\/em><\/strong> record<\/p>\n<\/td>\n<td data-colwidth=\"91\" width=\"91\">\n<p>25.2299 ns<\/p>\n<\/td>\n<td data-colwidth=\"87\" width=\"87\">\n<p>0.5267 ns<\/p>\n<\/td>\n<td data-colwidth=\"85\" width=\"85\">\n<p>0.8200 ns<\/p>\n<\/td>\n<td data-colwidth=\"92\" width=\"92\">\n<p>24.9839 ns<\/p>\n<\/td>\n<td>\n<p>0.0191<\/p>\n<\/td>\n<td>\n<p>160 B<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>Legends:<\/p>\n<ul>\n<li>\n<p><em>Mean<\/em> &#8212; Arithmetic mean of all measurements<\/p>\n<\/li>\n<li>\n<p><em>Error<\/em> &#8212; Half of 99.9% confidence interval<\/p>\n<\/li>\n<li>\n<p><em>StdDev<\/em> &#8212; Standard deviation of all measurements<\/p>\n<\/li>\n<li>\n<p><em>Median<\/em> &#8212; Value separating the higher half of all measurements (50th percentile)<\/p>\n<\/li>\n<li>\n<p><em>Gen 0<\/em> &#8212; GC Generation 0 collects per 1000 operations<\/p>\n<\/li>\n<li>\n<p><em>Allocated<\/em> &#8212; Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)<\/p>\n<\/li>\n<li>\n<p><em>1 ns<\/em> &#8212; 1 Nanosecond (0.000000001 sec)<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c <em>Immutype<\/em> \u0434\u043b\u044f <em>class<\/em> \u0438 <em>struct<\/em> \u0431\u0443\u0434\u0435\u0442 \u0431\u043b\u0438\u0437\u043a\u043e\u0439 \u043a \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f <em>record<\/em> \u0438 <em>record struct<\/em>. \u0412\u0430\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u043c\u044b\u0435 \u0442\u0440\u0430\u0442\u044b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 <em>Immutype<\/em> \u0434\u043b\u044f \u0441\u0441\u044b\u043b\u043e\u0447\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 &#8212; \u044d\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043d\u0430 <em>null<\/em>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/595571\/\"> https:\/\/habr.com\/ru\/articles\/595571\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u0442\u0430\u043a\u0438\u043c\u0438 \u043a\u0430\u043a <em>readonly struct<\/em>, \u043d\u0430\u043c \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b \u0442\u0438\u043f\u0430 \u0438\u043b\u0438 <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/csharp\/programming-guide\/classes-and-structs\/extension-methods\" rel=\"noopener noreferrer nofollow\"><u>\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f<\/u><\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0437\u0434\u0430\u044e\u0442 \u043a\u043e\u043f\u0438\u044e \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u0438\u0437\u043c\u0435\u043d\u044f\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0438\u043b\u0438 \u043f\u043e\u043b\u0435. \u0422\u0430\u043a\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u0434 \u0447\u0438\u0449\u0435 \u0438 \u043f\u0440\u043e\u0449\u0435, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044f \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0441\u0442\u044c. \u041d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0441\u0442\u044c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u043f\u043e\u0442\u043e\u043a\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0442\u0438\u043f\u0430 \u0441 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c. \u041e\u0431\u044b\u0447\u043d\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044f \u0438\u043b\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c, \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043d\u0435\u043f\u043e\u043b\u043d\u0443\u044e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u043d\u0443\u044e \u043a\u043e\u043f\u0438\u044e \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440, \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u044d\u0442\u0443 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u043d\u0443\u044e \u043a\u043e\u043f\u0438\u044e \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u044e.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b <em>Person<\/em>:<\/p>\n<pre><code class=\"cs\">public readonly struct Person {     public readonly string Name;     public readonly int Age;        public Person(string name = \"\", int age = 0)     {         Name = name;         Age = age;     }        public Person WithName(string name) => new Person(name, Age);         public Person WithAge(int age) => new Person(Name, age); }<\/code><\/pre>\n<p>\u2014 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432 <em>With\u2026<\/em> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u043f\u043e\u043b\u043d\u0430\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u043d\u0430\u044f \u043a\u043e\u043f\u0438\u044f \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 <em>Person<\/em>. \u041a\u043e\u043f\u0438\u044f \u043d\u0435\u043f\u043e\u043b\u043d\u0430\u044f, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0434\u043b\u044f \u0441\u0441\u044b\u043b\u043e\u0447\u043d\u044b\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0438 \u043f\u043e\u043b\u0435\u0439, \u043a\u0430\u043a \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442. \u041d\u043e \u044d\u0442\u043e \u043d\u0435 \u0441\u0442\u0440\u0430\u0448\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432\u0441\u0435 \u0442\u0438\u043f\u044b \u044d\u0442\u0438\u0445 \u043f\u043e\u043b\u0435\u0439 \u0438\u043b\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0442\u0430\u043a\u0436\u0435 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b.\u00a0<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0442\u0438\u043f\u0430:<\/p>\n<pre><code class=\"cs\">var john = new Person().WithName(\"John\").WithAge(15);<\/code><\/pre>\n<p>\u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c \u043c\u0435\u0442\u043e\u0434\u0430\u043c, \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043e\u043d\u0438 \u0438\u043c\u0435\u044e\u0442 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430:<\/p>\n<pre><code class=\"cs\">public readonly struct Person {     public readonly string Name;     public readonly int Age;      public Person(string name = \"\", int age = 0)     {         Name = name;         Age = age;     } }  public static class PersonExtensions {     public static Person WithName(this Person it, string name) =>         new Person(name, it.Age);      public static Person WithAge(this Person it, int age) =>         new Person(it.Name, age); }<\/code><\/pre>\n<p>\u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u0438 \u043a \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c \u0438 \u043a\u043b\u0430\u0441\u0441\u0430\u043c. <\/p>\n<p>\u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 C# \u0432\u0435\u0440\u0441\u0438\u0438 9, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e <em>record<\/em> \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441\u0441\u044b\u043b\u043e\u0447\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430. \u041e\u043d \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u044f\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. <em>Record<\/em> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0438 \u0441 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u043c\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438\u043b\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0441\u0432\u043e\u0439\u0441\u0442\u0432:<\/p>\n<pre><code class=\"cs\">public record Person(string Name = \"\", int Age = 0);<\/code><\/pre>\n<p>\u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u0437\u0430\u043f\u0438\u0441\u0438 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u044b \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0434\u043b\u044f \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0434\u0430\u043d\u043d\u044b\u0445. \u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 C# \u0432\u0435\u0440\u0441\u0438\u0438 10, \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0442\u0438\u043f\u044b <em>record struct<\/em> \u0442\u0430\u043a\u0436\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438\u043b\u0438 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u0441\u0432\u043e\u0439\u0441\u0442\u0432:<\/p>\n<pre><code class=\"cs\">public readonly record struct Person(string Name = \"\", int Age = 0);<\/code><\/pre>\n<p>\u041e\u0431\u044b\u0447\u043d\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c \u0438\u0437 C# \u0432\u0435\u0440\u0441\u0438\u0438 9 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043b\u043d\u044b\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c <em>record class<\/em>, \u0433\u0434\u0435 <em>class<\/em> &#8212; \u044d\u0442\u043e \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e. \u0412\u044b\u0431\u043e\u0440 \u043c\u0435\u0436\u0434\u0443 <em>record class<\/em> \u0438 <em>record struct<\/em>, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u044b\u0431\u043e\u0440\u0443 \u043c\u0435\u0436\u0434\u0443 \u043c\u0435\u0436\u0434\u0443 <em>class<\/em> \u0438 <em>struct<\/em>.<\/p>\n<p>\u0421 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u0438 \u043d\u043e\u0432\u043e\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 <em>with<\/em>. \u041e\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043d\u043e\u0432\u044b\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u0437\u0430\u043f\u0438\u0441\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u043f\u0438\u0435\u0439 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u0432 \u044d\u0442\u043e\u0439 \u043a\u043e\u043f\u0438\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0438 \u043f\u043e\u043b\u044f, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0447\u0435\u0433\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u043f\u043e\u043b\u043d\u0430\u044f \u043a\u043e\u043f\u0438\u044f. \u0414\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432:<\/p>\n<pre><code class=\"cs\">var john = new Person() with { Name = \"John\", Age = 15 };<\/code><\/pre>\n<p>\u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u044b\u043c \u0438 \u043b\u0435\u0433\u043a\u043e \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u043c. \u041d\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u0447\u0438\u043d, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0438\u0437 \u043f\u0435\u0440\u0432\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0434\u043b\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u0435\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u043c\u0443 \u0441\u043b\u043e\u0432\u0443 <em>with<\/em>. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043d\u0435 \u0432\u043e \u0432\u0441\u0435\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0438 \u0438\u0437-\u0437\u0430 \u0432\u0435\u0440\u0441\u0438\u0438 C# \u0438 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430. \u0410 \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u0432 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0445 \u0442\u0438\u043f\u0430\u0445 \u0447\u0430\u0441\u0442\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u043b\u044f \u0438\u043b\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0435 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"cs\">public record Person(   string Name = \"\",   int Age = 0,   ImmutableArray&lt;Person> Friends = default);<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f\u043c\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u043e <em>with<\/em> \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043c\u0435\u043d\u0435\u0435 \u0447\u0438\u0442\u0430\u0435\u043c\u043e:<\/p>\n<pre><code class=\"cs\">var john = new Person() with { Name = \"John\", Age = 15 }     with { Friends = ImmutableArray.Create(new Person() with {Name = \"David\"}) };  john = john with {     Friends = (john.Friends == default ? ImmutableArray&lt;Person>.Empty : john.Friends)      .Add(new Person() with { Name = \"Sophia\" })     .Add(new Person() with { Name = \"James\" }) };  john = john with {     Friends = (john.Friends == default ? ImmutableArray&lt;Person>.Empty : john.Friends)     .Remove(new Person() with { Name = \"David\" }) };<\/code><\/pre>\n<p>\u041f\u043e \u044d\u0442\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0438\u0434\u0435\u044f <a href=\"https:\/\/github.com\/DevTeam\/Immutype\" rel=\"noopener noreferrer nofollow\"><u>Immutype<\/u><\/a> \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0440\u0443\u0447\u0438\u0442\u044c \u0435\u043c\u0443 \u0432\u0441\u044e \u0440\u0443\u0442\u0438\u043d\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0441\u0442\u0438.<\/p>\n<p>\u042d\u0442\u043e <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/csharp\/roslyn-sdk\/source-generators-overview\" rel=\"noopener noreferrer nofollow\"><u>\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043a\u043e\u0434\u0430 .NET<\/u><\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u0441\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e, \u043f\u043e\u043a\u0430 \u0432\u044b \u043f\u0438\u0448\u0438\u0442\u0435 \u043a\u043e\u0434. \u041e\u043d \u0438\u0449\u0435\u0442 \u0432\u0441\u0435 \u0442\u0438\u043f\u044b, \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c <code>[Immutype.Target]<\/code>, \u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0430\u043a\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043b\u0430\u0441\u0441 \u0441 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f. \u042d\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u043d\u0435 \u0437\u0430\u043c\u0443\u0441\u043e\u0440\u0438\u0432\u0430\u044e\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u0434 \u0438 \u043d\u0435 \u043c\u0430\u044f\u0447\u0430\u0442 \u0441\u0432\u043e\u0438\u043c\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 \u043a\u043e\u043c\u043c\u0438\u0442\u0430\u0445. \u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043e\u043f\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f:<\/p>\n<ul>\n<li>\n<p>\u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0435\u0439, \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0432\u044b\u0435 \u0438\u043c\u0435\u044e\u0442\u0441\u044f<\/p>\n<\/li>\n<li>\n<p>\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c <code>[Immutype.Target]<\/code>, \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0439 \u0435\u0441\u0442\u044c<\/p>\n<\/li>\n<li>\n<p>\u043f\u0435\u0440\u0432\u044b\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0441 \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0447\u0438\u0441\u043b\u043e\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438:<\/p>\n<pre><code class=\"cs\">[Immutype.Target] public record Person(   int Age,   string Name = \"\",   ImmutableArray&lt;Person> Friends = default);<\/code><\/pre>\n<p>\u2014 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u044b\u0448\u0435, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cs\">var john = new Person(15).WithName(\"John\").WithAge(15) \u00a0\u00a0\u00a0\u00a0.WithFriends(new Person(16).WithName(\"David\"));  john = john.AddFriends( new Person(17).WithName(\"Sophia\"), new Person(14).WithName(\"James\"));  john = john.RemoveFriends(new Person(16).WithName(\"David\"));<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0438\u043b\u0438 \u043f\u043e\u043b\u0435\u0439, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a <em>Age<\/em> \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u043c\u0435\u0442\u043e\u0434\u0443 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"cs\">Person WithAge(this Person it, int age)<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0438\u043b\u0438 \u043f\u043e\u043b\u0435\u0439 \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0435 \u0438\u043b\u0438 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a <em>Name<\/em>, \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434, \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e:<\/p>\n<pre><code class=\"cs\">Person WithDefaultName(this Person it)<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0439 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u043b\u044f <em>Friends<\/em> \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u043e \u0447\u0435\u0442\u044b\u0440\u0435 \u043c\u0435\u0442\u043e\u0434\u0430.<\/p>\n<ul>\n<li>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e, \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u0442\u043e\u0434 \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u0447\u0438\u0441\u043b\u043e\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432:<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"cs\">Person WithFriends(this Person it, params Person[] friends)<\/code><\/pre>\n<ul>\n<li>\n<p>\u0422\u0430\u043a\u043e\u0439 \u0436\u0435 \u043a\u0430\u043a \u0438 \u0432\u044b\u0448\u0435, \u043d\u043e \u0441 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u043c \u0442\u0438\u043f\u043e\u043c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430:<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"cs\">Person WithFriends(this Person it, ImmutableArray&lt;Person> firends)<\/code><\/pre>\n<ul>\n<li>\n<p>\u0427\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043e\u043f\u0438\u044e \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432:<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"cs\">Person AddFriends(this Person it, params Person[] friends)<\/code><\/pre>\n<ul>\n<li>\n<p>\u0427\u0442\u043e\u0431\u044b\u00a0\u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043e\u043f\u0438\u044e \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438, \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b:<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"cs\">Person RemoveFriends(this Person it, params Person[] friends)<\/code><\/pre>\n<p>\u041a\u043e\u043d\u0442\u0440\u0430\u0441\u0442 \u0432 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0435 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0442\u0438\u043f\u043e\u0432 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0439 \u0435\u0449\u0435 \u0431\u043e\u043b\u0435\u0435 \u043e\u0447\u0435\u0432\u0438\u0434\u0435\u043d. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438:<\/p>\n<pre><code class=\"cs\">public record Person(   string Name = \"\",   int Age = 0,   IReadOnlyCollection&lt;Person>? Friends = default);<\/code><\/pre>\n<p>\u2014 \u043d\u0430\u0448 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u0441 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c \u0441\u043b\u043e\u0432\u043e\u043c <em>with <\/em>\u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cs\">var john = new Person()     with { Name = \"John\", Age = 15 }     with { Friends = new List&lt;Person>{ new Person() with { Name = \"David\" } }};  john = john with {     Friends = (john.Friends ?? Enumerable.Empty&lt;Person>())     .Concat(         new List&lt;Person>[]{              new Person() with { Name = \"Sophia\" },             new Person() with { Name = \"James\" }})     .ToList() };  john = john with {     Friends = (john.Friends ?? Enumerable.Empty&lt;Person>())     .Except(new List&lt;Person> { new Person() with { Name = \"David\" } })     .ToList() };<\/code><\/pre>\n<p>\u0410 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 <em>Immutype<\/em> \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0436\u043d\u0438\u043c \u0434\u043b\u044f \u043b\u044e\u0431\u044b\u0445 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0439 \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430 \u043d\u0438\u0436\u0435:<\/p>\n<pre><code>T[] interface IEnumerable&lt;T> class List&lt;T> interface IReadOnlyCollection&lt;T> interface IReadOnlyList&lt;T> interface ICollection&lt;T> interface IList&lt;T> class HashSet&lt;T> interface ISet&lt;T> class Queue&lt;T> class Stack&lt;T> interface IReadOnlyCollection&lt;T> interface IReadOnlyList&lt;T> interface IReadOnlySet&lt;T> class ImmutableList&lt;T> interface IImmutableList&lt;T> struct ImmutableArray&lt;T> class ImmutableQueue&lt;T> interface IImmutableQueue&lt;T> class ImmutableStack&lt;T> interface IImmutableStack&lt;T><\/code><\/pre>\n<p><em>Immutype<\/em> \u0442\u0430\u043a\u0436\u0435 \u0431\u0435\u0440\u0435\u0442 \u043d\u0430 \u0441\u0435\u0431\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0441 \u0442\u0438\u043f\u0430\u043c\u0438, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u043c\u0438 <em>null<\/em> \u0438\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0438 \u0432\u0441\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0442\u0438\u043f\u0430.<\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a <em>Immutype<\/em> &#8212; \u044d\u0442\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043a\u043e\u0434\u0430, \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0438 \u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0431\u043e\u0440\u043a\u0438, \u043d\u0435 \u0437\u0430\u0445\u043b\u0430\u043c\u043b\u044f\u0435\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434. \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b <em>Immutype<\/em> \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c: .NET SDK 5.0.102 \u0438\u043b\u0438 \u043d\u043e\u0432\u0435\u0435. \u041d\u043e \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f .NET Framework 4.5.\u00a0<\/p>\n<p><em>Immutype<\/em> \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/microsoft.codeanalysis.iincrementalgenerator?view=roslyn-dotnet-4.0.1\" rel=\"noopener noreferrer nofollow\"><u>\u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u0443\u044e \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u043a\u043e\u0434\u0430<\/u><\/a>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043d\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c\u0438 \u0431\u0443\u0434\u0435\u0442 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439.\u00a0<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0447\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0432 \u0432\u0430\u0448\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 <a href=\"https:\/\/www.nuget.org\/packages\/Immutype\" rel=\"noopener noreferrer nofollow\"><u>\u043f\u0430\u043a\u0435\u0442 Immutype<\/u><\/a> \u0438 \u043e\u0442\u043c\u0435\u0442\u044c\u0442\u0435 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0435 \u0442\u0438\u043f\u044b \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c <code>[Immutype.Target]<\/code> \u043f\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<p>\u0421 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f <a href=\"https:\/\/github.com\/DevTeam\/Immutype\" rel=\"noopener noreferrer nofollow\"><u>\u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/u><\/a>. \u0411\u0443\u0434\u0443 \u043f\u0440\u0438\u0437\u043d\u0430\u0442\u0435\u043b\u0435\u043d \u0437\u0430 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438, \u043d\u043e\u0432\u044b\u0435 \u0438\u0434\u0435\u0438 \u0438 \u0432\u043a\u043b\u0430\u0434 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442.<\/p>\n<h2>\u0422\u0435\u0441\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438<\/h2>\n<p>\u041f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <em>record<\/em> \u0438 <em>record struct<\/em> \u0441 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c \u0441\u043b\u043e\u0432\u043e\u043c <strong><em>With<\/em><\/strong> \u0438 \u0441\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u043c\u0438 <strong><em>Immutype,<\/em><\/strong> \u0434\u043b\u044f \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0441 \u043e\u0434\u043d\u0438\u043c, \u0434\u0432\u0443\u043c\u044f \u0438 \u0447\u0435\u0442\u044b\u0440\u044c\u043c\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438. \u0422\u0438\u043f\u044b \u0441\u0432\u043e\u0439\u0441\u0442\u0432: <em>string<\/em>, <em>int<\/em> \u0438 <em>bool<\/em>.<\/p>\n<pre><code>BenchmarkDotNet=v0.13.1, OS=Windows 10.0.22000 Intel Core i7-10875H CPU 2.30GHz, 1 CPU, 16 logical and 8 physical cores .NET SDK=6.0.100   [Host]     : .NET 6.0.0 (6.0.21.52210), X64 RyuJIT   DefaultJob : .NET 6.0.0 (6.0.21.52210), X64 RyuJIT<\/code><\/pre>\n<p>\u0421 \u043e\u0434\u043d\u0438\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e\u043c <em>string<\/em>:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th data-colwidth=\"188\" width=\"188\">\n<p>Method<\/p>\n<\/th>\n<th data-colwidth=\"91\" width=\"91\">\n<p align=\"center\">Mean<\/p>\n<\/th>\n<th data-colwidth=\"89\" width=\"89\">\n<p>Error<\/p>\n<\/th>\n<th data-colwidth=\"95\" width=\"95\">\n<p>StdDev<\/p>\n<\/th>\n<th data-colwidth=\"86\" width=\"86\">\n<p>Median<\/p>\n<\/th>\n<th>\n<p>Gen 0<\/p>\n<\/th>\n<th>\n<p>Allocated<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td data-colwidth=\"188\" width=\"188\">\n<p><strong><em>Immutype<\/em><\/strong> record struct<\/p>\n<\/td>\n<td data-colwidth=\"91\" width=\"91\">\n<p>0.0000 ns<\/p>\n<\/td>\n<td data-colwidth=\"89\" width=\"89\">\n<p>0.0000 ns<\/p>\n<\/td>\n<td data-colwidth=\"95\" width=\"95\">\n<p>0.0000 ns<\/p>\n<\/td>\n<td data-colwidth=\"86\" width=\"86\">\n<p>0.0000 ns<\/p>\n<\/td>\n<td>\n<p>&#8212;<\/p>\n<\/td>\n<td>\n<p>&#8212;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"188\" width=\"188\">\n<p><strong><em>With<\/em><\/strong> record struct<\/p>\n<\/td>\n<td data-colwidth=\"91\" width=\"91\">\n<p>0.0317 ns<\/p>\n<\/td>\n<td data-colwidth=\"89\" width=\"89\">\n<p>0.0287 ns<\/p>\n<\/td>\n<td data-colwidth=\"95\" width=\"95\">\n<p>0.0307 ns<\/p>\n<\/td>\n<td data-colwidth=\"86\" width=\"86\">\n<p>0.0240 ns<\/p>\n<\/td>\n<td>\n<p>&#8212;<\/p>\n<\/td>\n<td>\n<p>&#8212;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"188\" width=\"188\">\n<p><strong><em>With<\/em><\/strong> record<\/p>\n<\/td>\n<td data-colwidth=\"91\" width=\"91\">\n<p>6.1894 ns<\/p>\n<\/td>\n<td data-colwidth=\"89\" width=\"89\">\n<p>0.1489 ns<\/p>\n<\/td>\n<td data-colwidth=\"95\" width=\"95\">\n<p>0.2797 ns<\/p>\n<\/td>\n<td data-colwidth=\"86\" width=\"86\">\n<p>6.3389 ns<\/p>\n<\/td>\n<td>\n<p>0.0029<\/p>\n<\/td>\n<td>\n<p>24 B<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"188\" width=\"188\">\n<p><strong><em>Immutype<\/em><\/strong> record<\/p>\n<\/td>\n<td data-colwidth=\"91\" width=\"91\">\n<p>7.2829 ns<\/p>\n<\/td>\n<td data-colwidth=\"89\" width=\"89\">\n<p>0.1577 ns<\/p>\n<\/td>\n<td data-colwidth=\"95\" width=\"95\">\n<p>0.1619 ns<\/p>\n<\/td>\n<td data-colwidth=\"86\" width=\"86\">\n<p>7.2482 ns<\/p>\n<\/td>\n<td>\n<p>0.0029<\/p>\n<\/td>\n<td>\n<p>24 B<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0421 \u0434\u0432\u0443\u043c\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 <em>string<\/em> \u0438 <em>int<\/em>:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th data-colwidth=\"195\" width=\"195\">\n<p>Method<\/p>\n<\/th>\n<th data-colwidth=\"97\" width=\"97\">\n<p>Mean<\/p>\n<\/th>\n<th data-colwidth=\"83\" width=\"83\">\n<p>Error<\/p>\n<\/th>\n<th data-colwidth=\"82\" width=\"82\">\n<p>StdDev<\/p>\n<\/th>\n<th data-colwidth=\"92\" width=\"92\">\n<p>Median<\/p>\n<\/th>\n<th>\n<p>Gen 0<\/p>\n<\/th>\n<th>\n<p>Allocated<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td data-colwidth=\"195\" width=\"195\">\n<p><strong><em>With<\/em><\/strong> record struct<\/p>\n<\/td>\n<td data-colwidth=\"97\" width=\"97\">\n<p>0.0195 ns<\/p>\n<\/td>\n<td data-colwidth=\"83\" width=\"83\">\n<p>0.0296 ns<\/p>\n<\/td>\n<td data-colwidth=\"82\" width=\"82\">\n<p>0.0291 ns<\/p>\n<\/td>\n<td data-colwidth=\"92\" width=\"92\">\n<p>0.0036 ns<\/p>\n<\/td>\n<td>\n<p>&#8212;<\/p>\n<\/td>\n<td>\n<p>&#8212;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"195\" width=\"195\">\n<p><strong><em>Immutype<\/em><\/strong> record struct<\/p>\n<\/td>\n<td data-colwidth=\"97\" width=\"97\">\n<p>0.0442 ns<\/p>\n<\/td>\n<td data-colwidth=\"83\" width=\"83\">\n<p>0.0257 ns<\/p>\n<\/td>\n<td data-colwidth=\"82\" width=\"82\">\n<p>0.0352 ns<\/p>\n<\/td>\n<td data-colwidth=\"92\" width=\"92\">\n<p>0.0285 ns<\/p>\n<\/td>\n<td>\n<p>&#8212;<\/p>\n<\/td>\n<td>\n<p>&#8212;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"195\" width=\"195\">\n<p><strong><em>With<\/em><\/strong> record<\/p>\n<\/td>\n<td data-colwidth=\"97\" width=\"97\">\n<p>8.2670 ns<\/p>\n<\/td>\n<td data-colwidth=\"83\" width=\"83\">\n<p>0.1532 ns<\/p>\n<\/td>\n<td data-colwidth=\"82\" width=\"82\">\n<p>0.1280 ns<\/p>\n<\/td>\n<td data-colwidth=\"92\" width=\"92\">\n<p>8.2548 ns<\/p>\n<\/td>\n<td>\n<p>0.0038<\/p>\n<\/td>\n<td>\n<p>32 B<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"195\" width=\"195\">\n<p><strong><em>Immutype<\/em><\/strong> record<\/p>\n<\/td>\n<td data-colwidth=\"97\" width=\"97\">\n<p>10.6809 ns<\/p>\n<\/td>\n<td data-colwidth=\"83\" width=\"83\">\n<p>0.2420 ns<\/p>\n<\/td>\n<td data-colwidth=\"82\" width=\"82\">\n<p>0.4424 ns<\/p>\n<\/td>\n<td data-colwidth=\"92\" width=\"92\">\n<p>10.8150 ns<\/p>\n<\/td>\n<td>\n<p>0.0076<\/p>\n<\/td>\n<td>\n<p>64 B<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0421 \u0447\u0435\u0442\u044b\u0440\u044c\u043c\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 <em>string<\/em>, <em>int, string<\/em> \u0438 <em>bool<\/em>:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th data-colwidth=\"194\" width=\"194\">\n<p>Method<\/p>\n<\/th>\n<th data-colwidth=\"91\" width=\"91\">\n<p>Mean<\/p>\n<\/th>\n<th data-colwidth=\"87\" width=\"87\">\n<p>Error<\/p>\n<\/th>\n<th data-colwidth=\"85\" width=\"85\">\n<p>StdDev<\/p>\n<\/th>\n<th data-colwidth=\"92\" width=\"92\">\n<p>Median<\/p>\n<\/th>\n<th>\n<p>Gen 0<\/p>\n<\/th>\n<th>\n<p>Allocated<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td data-colwidth=\"194\" width=\"194\">\n<p><strong><em>Immutype<\/em><\/strong> record<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-406695","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/406695","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=406695"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/406695\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=406695"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=406695"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=406695"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}