{"id":279561,"date":"2016-05-04T14:45:04","date_gmt":"2016-05-04T10:45:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=279561"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=279561","title":{"rendered":"\u041a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u043e\u043d\u0430\u0434\u0443 IO \u043d\u0430 C# (\u043d\u0435) \u0431\u0435\u0437 \u043f\u043e\u043c\u043e\u0449\u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0439 \u0432\u0441\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0438 \u043c\u0430\u0448\u0438\u043d\u044b \u0432\u0440\u0435\u043c\u0435\u043d\u0438"},"content":{"rendered":"<p>       \u0412 \u0436\u0438\u0437\u043d\u0438 \u043d\u0435\u0440\u0435\u0434\u043a\u043e \u0431\u044b\u0432\u0430\u044e\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0435\u0441\u0442\u044c \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0434\u0435\u043b\u043e, \u043d\u0435 \u0437\u0430\u0431\u0438\u0432\u0430\u044f \u0441\u0435\u0431\u0435 \u0433\u043e\u043b\u043e\u0432\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u043c\u0438 \u0432\u0440\u043e\u0434\u0435 &quot;\u0430 \u0447\u0442\u043e \u044d\u0442\u043e \u0434\u0430\u0441\u0442?&quot;, &quot;\u0430 \u043a\u043e\u043c\u0443 \u044d\u0442\u043e \u043d\u0443\u0436\u043d\u043e?&quot; \u0438 \u0442. \u043f. \u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u043e\u043d\u0430\u0434\u044b <code>IO \u2014<\/code> \u0431\u0435\u0437\u0443\u0441\u043b\u043e\u0432\u043d\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u0441\u043b\u0443\u0447\u0430\u0439. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0437 \u043e \u0442\u043e\u043c <em>\u043a\u0430\u043a<\/em> \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u043e\u043d\u0430\u0434\u0443 <code>IO<\/code> \u043d\u0430 <em>C#,<\/em> \u0431\u0435\u0437 \u043c\u0430\u043b\u0435\u0439\u0448\u0438\u0445 \u043f\u043e\u043f\u044b\u0442\u043e\u043a \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c <em>\u0437\u0430\u0447\u0435\u043c<\/em> \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0411\u0430\u044f\u043d\u0438\u0441\u0442\u0430\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430, \u043e\u0442\u0440\u0430\u0436\u0430\u044e\u0449\u0430\u044f \u0441\u0443\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u0438<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"http:\/\/cs.pikabu.ru\/images\/big_size_comm\/2013-09_5\/13798569678719.gif\"\/>  <\/div>\n<\/div>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2>\u0418\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u0438 \u043c\u043e\u043d\u0430\u0434\u044b <code>IO<\/code><\/h2>\n<p>  \u0415\u0441\u0442\u044c \u0434\u0432\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043e\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u0438\u044f (\u0438\u043d\u0442\u0435\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u0438) \u043c\u043e\u043d\u0430\u0434\u044b <code>IO.<\/code><\/p>\n<p>  \u0421 \u043f\u0435\u0440\u0432\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 <a href=\"https:\/\/wiki.haskell.org\/IO_inside\">IO inside<\/a>. \u0425\u043e\u0442\u044f \u044d\u0442\u043e \u0438 \u043d\u0435 \u0434\u0435\u043a\u043b\u0430\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u044f\u0432\u043d\u043e, \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 <code>IO<\/code> \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u0431\u043c\u0430\u043d\u0443\u0442\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 <em>Haskell,<\/em> \u0432\u043f\u0438\u0445\u043d\u0443\u0442\u044c \u0432\u044b\u0437\u043e\u0432\u044b \u00ab\u0433\u0440\u044f\u0437\u043d\u044b\u0445\u00bb \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 \u0447\u0438\u0441\u0442\u044b\u0439 \u043a\u043e\u0434 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u0441 \u043d\u0438\u043c\u0438 \u043a\u0430\u043a \u0441 \u0447\u0438\u0441\u0442\u044b\u043c\u0438 \u0438\u0437-\u0437\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0443 \u0444\u0438\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<p>  \u0412\u0442\u043e\u0440\u0443\u044e \u0436\u0435 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u0437\u0430\u043c\u0435\u0442\u0438\u0432, \u0447\u0442\u043e \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u043e\u043d\u0430\u0434 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>Get<\/code> \u0438\u0437 \u043c\u043e\u0434\u0443\u043b\u044f <code>Data.Binary<\/code>) \u0438\u043c\u0435\u044e\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0442\u0438\u043f\u0430 <code>m a -&gt; a<\/code> (\u0434\u043b\u044f <code>Get<\/code> \u044d\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>runGet<\/code>), \u0442\u043e \u0435\u0441\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c <em>\u0432\u044b\u0442\u0430\u0449\u0438\u0442\u044c<\/em> \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u043c\u043e\u043d\u0430\u0434\u044b. \u0414\u043b\u044f <code>IO<\/code> \u0436\u0435 \u0442\u0430\u043a\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0435\u0442, \u0438 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0435\u0451 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u2014 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>main<\/code> \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u043c\u0443 \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0443. \u0422\u043e \u0435\u0441\u0442\u044c <code>IO<\/code> \u2014 \u044d\u0442\u043e \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 (\u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439), \u0438 \u0437\u0430\u0434\u0430\u0447\u0430 \u0447\u0438\u0441\u0442\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u044d\u0442\u043e\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043d\u043e \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c.<\/p>\n<p>  \u041d\u0438 \u043e\u0434\u043d\u0430 \u0438\u0437 \u044d\u0442\u0438\u0445 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u0439 \u043d\u0435 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0442\u0440\u0430\u043d\u0441\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043d\u044f\u0442\u0438\u0435 <code>IO<\/code> \u043d\u0430 <em>C#<\/em>: \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0437\u0430\u043c\u0435\u0447\u0430\u0435\u043c, \u0447\u0442\u043e \u0432 C# \u0438 \u0442\u0430\u043a \u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u0442\u0440\u0443\u0434\u043d\u043e\u0441\u0442\u0438 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u00ab\u0433\u0440\u044f\u0437\u043d\u044b\u0439\u00bb \u043a\u043e\u0434 \u0438\u0437 \u043b\u044e\u0431\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u0430, \u0430 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0447\u0442\u043e \u0432 <em>C#<\/em> \u0432\u0441\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u2014 \u044d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439, \u0430 \u0442\u043e\u0447\u043a\u0430 \u0441 \u0437\u0430\u043f\u044f\u0442\u043e\u0439 \u0435\u0441\u0442\u044c \u043d\u0438 \u0447\u0442\u043e \u0438\u043d\u043e\u0435 \u043a\u0430\u043a \u043c\u043e\u043d\u0430\u0434\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <code>&gt;&gt;=<\/code>.<\/p>\n<p>  \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 <code>IO<\/code>: \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u043e\u043d\u0430\u0434\u044b \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0441\u0430\u0445\u0430\u0440\u043e\u043c, \u0432\u0432\u043e\u0434-\u0432\u044b\u0432\u043e\u0434 \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u044c, \u043e\u0441\u0442\u0430\u0432\u0430\u044f\u0441\u044c \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0447\u0438\u0441\u0442\u043e\u0433\u043e \u043a\u043e\u0434\u0430. \u0418 \u0435\u0441\u043b\u0438 \u043d\u0430\u0439\u0442\u0438 \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u0447\u0438\u0441\u0442\u044b\u0439 (\u0431\u0435\u0437 \u043c\u043e\u043d\u0430\u0434, \u0431\u0435\u0437 \u043f\u0440\u044f\u043c\u043e\u0433\u043e \u0438\u043b\u0438 \u043a\u043e\u0441\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439) \u043a\u043e\u0434, \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u0432\u0432\u043e\u0434-\u0432\u044b\u0432\u043e\u0434, \u0442\u043e <code>IO<\/code> \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u043d\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0441\u0430\u0445\u0430\u0440\u043e\u043c \u0434\u043b\u044f \u044d\u0442\u0438\u0445 \u0447\u0438\u0441\u0442\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u0442\u043e\u0433\u043e \u0436\u0435 \u0440\u043e\u0434\u0430, \u0447\u0442\u043e \u0438 \u043c\u043e\u043d\u0430\u0434\u0430 <code>Maybe<\/code>. \u041d\u0443 \u0430 \u0443\u0436 <code>Maybe<\/code> \u043d\u0430 <em>C#<\/em> \u043d\u0435 \u043f\u0438\u0441\u0430\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u043d\u0438\u0432\u044b\u0439.<\/p>\n<h2>\u0427\u0438\u0441\u0442\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u0432\u043e\u0434\u0430-\u0432\u044b\u0432\u043e\u0434\u0430 \u043d\u0430 <em>Haskell<\/em>. \u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f<\/h2>\n<p>  \u041f\u0443\u0441\u0442\u044c \u0443 \u043d\u0430\u0441 (\u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f) \u0435\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>beep,<\/code> \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u0442 \u0447\u0438\u0441\u043b\u043e 7 \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u00abBeep!\u00bb \u0438 \u0434\u0440\u0443\u0433\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>returnBeep<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0447\u0438\u0441\u043b\u043e 7. \u0427\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0447\u0438\u0441\u0442\u043e\u0442\u0435 \u044d\u0442\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439?<\/p>\n<p>  \u041d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0447\u0442\u043e <code>returnBeep<\/code> \u0447\u0438\u0441\u0442\u0430\u044f, \u0430 <code>beep<\/code> \u2014 \u043d\u0435\u0442: \u0447\u0438\u0441\u0442\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u2014 \u044d\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043d\u0435 \u0434\u0430\u044e\u0449\u0430\u044f \u043f\u043e\u0431\u043e\u0447\u043d\u044b\u0445 \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u0432, \u0430 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u0431\u043e\u0447\u043d\u044b\u0439 \u044d\u0444\u0444\u0435\u043a\u0442 \u044f\u0432\u043d\u043e \u0438\u043c\u0435\u0435\u0442\u0441\u044f.<\/p>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e, \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0447\u0438\u0441\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>returnBeep<\/code> \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u0435\u0451 \u043d\u0430\u0434\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c, \u0438 \u043f\u043e\u0431\u043e\u0447\u043d\u044b\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u044b \u043f\u0440\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0438 \u0442\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c, \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0432 \u0432\u0438\u0434\u0435 \u0440\u0430\u0441\u0441\u0435\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043e\u043c \u0442\u0435\u043f\u043b\u0430. \u041d\u043e \u0437\u043d\u0430\u0447\u0438\u0442 \u043b\u0438 \u044d\u0442\u043e, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>returnBeep<\/code> \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043b\u0430 \u0431\u044b\u0442\u044c \u0447\u0438\u0441\u0442\u043e\u0439 \u0438\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e? \u041e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0430 \u044d\u0442\u043e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u043c\u043e\u0436\u043d\u043e \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443 \u0438 \u2014 \u0442\u0430\u043a \u0436\u0435 \u043a\u0430\u043a \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u0430 \u00ab\u043f\u0435\u0440\u0435\u0441\u0435\u043a\u0430\u044e\u0442\u0441\u044f \u043b\u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u044f\u043c\u044b\u0435?\u00bb \u2014 \u043b\u044e\u0431\u043e\u0439 \u0438\u0437 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u0437\u0430 \u0430\u043a\u0441\u0438\u043e\u043c\u0443 \u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043d\u0430 \u044d\u0442\u043e\u043c \u043d\u0435\u043f\u0440\u043e\u0442\u0438\u0432\u043e\u0440\u0435\u0447\u0438\u0432\u0443\u044e \u0442\u0435\u043e\u0440\u0438\u044e, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0443\u044e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043e\u043a\u0440\u0443\u0436\u0430\u044e\u0449\u0435\u0433\u043e \u043c\u0438\u0440\u0430. \u0422\u0430\u043a \u0447\u0442\u043e \u043c\u044b \u043f\u0440\u0438\u043c\u0435\u043c \u043a\u0430\u043a \u0430\u043a\u0441\u0438\u043e\u043c\u0443, \u0447\u0442\u043e <em>\u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044f \u0438, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435 \u0438\u043c \u043f\u0440\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0431\u043e\u0447\u043d\u044b\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u044b \u043d\u0435 \u0432\u043b\u0438\u044f\u044e\u0442 \u043d\u0430 \u0447\u0438\u0441\u0442\u043e\u0442\u0443 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/em>.<\/p>\n<p>  \u041d\u043e \u043e\u0442\u0441\u044e\u0434\u0430 \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442, \u0447\u0442\u043e \u0447\u0438\u0441\u0442\u043e\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e <code>returnBeep,<\/code> \u043d\u043e \u0438 <code>beep,<\/code> \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u044b\u0434\u0430\u0447\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u0445\u043e\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438 \u043f\u043e\u0442\u043e\u043c\u0443 \u044d\u0442\u043e \u0442\u0430\u043a\u0430\u044f \u0436\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044f.<\/p>\n<p>  \u0412 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0432\u044b\u0448\u0435\u0441\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c, \u043d\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0433\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0435\u0439 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u0447\u0438\u0441\u0442\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0432\u044b\u0432\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0442\u043e, \u0447\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0432\u044b\u0432\u0435\u0434\u0435\u043d\u043e \u0438 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u043b\u043e\u0441\u044c \u0442\u043e, \u0447\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0441\u0447\u0438\u0442\u0430\u043d\u043e \u2014 \u0442\u043e \u0435\u0441\u0442\u044c \u0447\u0442\u043e\u0431\u044b \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 \u0432\u0451\u043b \u0441\u0435\u0431\u044f \u0442\u0430\u043a, \u043a\u0430\u043a \u0431\u0443\u0434\u0442\u043e \u0443 \u043d\u0430\u0448\u0435\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0435\u0441\u0442\u044c \u043f\u043e\u0431\u043e\u0447\u043d\u044b\u0439 \u044d\u0444\u0444\u0435\u043a\u0442, \u0445\u043e\u0442\u044f \u0435\u0433\u043e \u043d\u0435\u0442. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u0435 \u0442\u0430\u043a\u043e\u0439 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u043f\u0435\u0440\u0435\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u043d\u0430\u0448\u0438\u0445 \u043f\u043b\u0435\u0447 \u2014 \u043f\u043b\u0435\u0447 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430 \u2014 \u043d\u0430 \u043f\u043b\u0435\u0447\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044f; \u0442\u043e \u0435\u0441\u0442\u044c \u043d\u0430 \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u044b\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043b\u0435\u0447\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043c\u0438\u043a\u0440\u043e\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430, \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0430 <em>Haskell<\/em> \u0438 \u0432\u0441\u0435\u0433\u043e \u0442\u0430\u043a\u043e\u0433\u043e.<\/p>\n<p>  \u0427\u0442\u043e \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432 \u043a\u043e\u0434\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u2014 \u044d\u0442\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u044b\u0435 \u0431\u0443\u043a\u0432\u044b \u043d\u0430 \u044d\u043a\u0440\u0430\u043d \u0432\u044b\u0432\u0435\u043b\u0438\u0441\u044c \u0438 \u0443\u0437\u043d\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u0435 \u0432\u0432\u0435\u043b\u0438\u0441\u044c. \u0418 \u0432\u043e\u0442 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u0438 \u043f\u0440\u0438\u0433\u043e\u0434\u044f\u0442\u0441\u044f \u043c\u0430\u0448\u0438\u043d\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u0430\u044f \u0432\u0441\u0435\u043b\u0435\u043d\u043d\u0430\u044f.<\/p>\n<p>  \u0418\u0434\u0435\u044f \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0438\u0442\u044c \u0412\u0441\u0435\u043b\u0435\u043d\u043d\u0443\u044e (\u0432\u0441\u0451, \u0447\u0442\u043e \u0431\u044b\u043b\u043e, \u0435\u0441\u0442\u044c \u0438 \u0431\u0443\u0434\u0435\u0442), \u0437\u0430\u0442\u0435\u043c \u0437\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c (\u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430) \u0432 base64 \u0438 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432 \u043d\u0430\u0448\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0432 \u0432\u0438\u0434\u0435 \u0437\u0430\u0445\u0430\u0440\u0434\u043a\u043e\u0436\u0435\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u044f \u043d\u0435 \u0443\u0432\u0435\u0440\u0435\u043d \u043a\u0430\u043a \u0432 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 (\u043c\u0430\u0448\u0438\u043d\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 + \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u0430\u044f \u0432\u0441\u0435\u043b\u0435\u043d\u043d\u0430\u044f), \u0442\u0430\u043a \u0438 \u0432 \u0435\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438. \u041e\u0434\u043d\u0430\u043a\u043e, \u0431\u0435\u0437 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0439 \u0432\u0441\u0435\u043b\u0435\u043d\u043d\u043e\u0439, \u043f\u043e-\u043c\u043e\u0435\u043c\u0443, \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f, \u0442\u0430\u043a \u043a\u0430\u043a \u0437\u0430\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0438\u0442\u044c \u0432\u0441\u0435\u043b\u0435\u043d\u043d\u0443\u044e, \u043d\u0430\u0445\u043e\u0434\u044f\u0441\u044c \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432 \u0441\u0430\u043c\u043e\u0439 \u044d\u0442\u043e\u0439 \u0432\u0441\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0431\u0443\u0434\u0435\u0442, \u043f\u043e\u0436\u0430\u043b\u0443\u0439, \u043f\u043e\u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u0447\u0435\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c quin \u043d\u0430 POSIX shell.<\/p>\n<p>  \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0430 <em>Haskell<\/em> (\u044f\u0432\u043b\u044f\u044e\u0449\u0430\u044f\u0441\u044f \u0447\u0438\u0441\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439) \u043c\u043e\u0433\u043b\u0430 \u0432\u044b\u0442\u0430\u0449\u0438\u0442\u044c \u0438\u0437 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0412\u0441\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0443\u044e\u0441\u044f \u043a \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c\u0443 \u0437\u0430\u043f\u0443\u0441\u043a\u0443 (\u0438\u043d\u0441\u0442\u0430\u043d\u0441\u0443) \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u043d\u0430 \u0432\u0445\u043e\u0434 \u043e\u043d\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u043d\u0435\u043a\u0438\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u044d\u0442\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u0430. \u0418 \u043e\u043d\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0435\u0433\u043e \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u2014 \u0432 \u0432\u0438\u0434\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u0430 <code>RealWorld<\/code> (\u0441\u043c. \u0443\u0436\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u0432\u0448\u0443\u044e\u0441\u044f \u0441\u0442\u0430\u0442\u044c\u044e <a href=\"https:\/\/wiki.haskell.org\/IO_inside\">IO inside<\/a>). \u041f\u0440\u044f\u043c\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u044d\u0442\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u0432 <em>Haskell<\/em> \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430, \u043d\u043e \u043d\u0435\u0442\u0440\u0443\u0434\u043d\u043e \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 <code>RealWorld<\/code> \u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 <code>Integer,<\/code> <code>String<\/code> \u0438\u043b\u0438 \u043b\u044e\u0431\u043e\u0433\u043e \u0434\u0440\u0443\u0433\u043e\u0433\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0442\u0438\u043f \u0438 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0438 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0412\u0441\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432\u0432\u043e\u0434\u0430-\u0432\u044b\u0432\u043e\u0434\u0430.<\/p>\n<p>  \u0414\u0435\u0439\u0441\u0442\u0432\u0443\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043d\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u0442\u0440\u0443\u0434\u0430 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0447\u0438\u0441\u0442\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432\u0432\u043e\u0434\u0430-\u0432\u044b\u0432\u043e\u0434\u0430. \u0421\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0430\u043a\u0438\u043c\u0438 (\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u043c\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u043c \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u043c \u0432\u0432\u043e\u0434\u043e\u043c-\u0432\u044b\u0432\u043e\u0434\u043e\u043c \u0441\u0442\u0440\u043e\u043a):<\/p>\n<pre><code class=\"haskell\">getOutText :: AppInstance -&gt; IOIndex -&gt; Maybe String getInText :: AppInstance -&gt; IOIndex -&gt; Maybe String <\/code><\/pre>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>getOutText<\/code> \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0438\u043d\u0441\u0442\u0430\u043d\u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u043d\u043e\u043c\u0435\u0440 \u0442\u0435\u043a\u0441\u0442\u0430 \u0432 \u0434\u0438\u0430\u043b\u043e\u0433\u0435 \u044e\u0437\u0435\u0440\u0430 \u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0432\u044b\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043e\u043c \u0442\u0435\u043a\u0441\u0442 \u043b\u0438\u0431\u043e <code>Nothing<\/code> \u0435\u0441\u043b\u0438 \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 <code>Nothing<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0439 \u043d\u043e\u043c\u0435\u0440 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u043c\u0443 \u044e\u0437\u0435\u0440\u043e\u043c, \u0430 \u043d\u0435 \u0432\u044b\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c\u0443 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043e\u043c \u0442\u0435\u043a\u0441\u0442\u0443. \u0422\u0430\u043a, \u0435\u0441\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0430\u043d\u0441 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0432\u044b\u0432\u043e\u0434\u0438\u043b, \u0442\u043e \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u043e\u043c\u0435\u0440\u0430 \u0434\u043e\u043b\u0436\u043d\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f <code>Nothing.<\/code> \u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>getInText<\/code> \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0442\u0430\u043a\u0438\u0435 \u0436\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0432\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0439 \u044e\u0437\u0435\u0440\u043e\u043c \u0442\u0435\u043a\u0441\u0442 \u043b\u0438\u0431\u043e <code>Nothing<\/code>.<\/p>\n<p>  \u0412 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432\u043c\u0435\u0441\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>getOutText<\/code> \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0439, \u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0439 \u0434\u043b\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043d\u0430\u0434\u043e\u0431\u043d\u043e\u0441\u0442\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 <code>isOutTextEquals<\/code> \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u043e\u0439 \u0438 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u043e\u0439:<\/p>\n<pre><code class=\"haskell\">isOutTextEquals :: String -&gt; AppInstance -&gt; IOIndex -&gt; Bool isOutTextEquals text inst index = getOutText inst index == Just text <\/code><\/pre>\n<p>  <\/p>\n<h2>\u0427\u0438\u0441\u0442\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u0432\u043e\u0434\u0430-\u0432\u044b\u0432\u043e\u0434\u0430 \u043d\u0430 <em>Haskell.<\/em> \u041c\u043e\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h2>\n<p>  \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0434\u043e\u0432\u0435\u0441\u0442\u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432\u044b\u0448\u0435 \u0438\u0434\u0435\u0438 \u0434\u043e \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u0412\u0441\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0432\u0441\u0435\u043b\u0435\u043d\u043d\u043e\u0439.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043f\u0443\u0441\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u0441\u0435\u043b\u0435\u043d\u043d\u0430\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0436\u0438\u0432\u0451\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u043f\u043e \u0438\u043c\u0435\u043d\u0438 noname. Noname \u0443\u0447\u0438\u0442\u0441\u044f \u0432 \u0432\u0443\u0437\u0435 \u043d\u0430 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 computer science, \u0438 \u0435\u043c\u0443 \u0434\u043b\u044f \u0441\u0434\u0430\u0447\u0438 \u0433\u043e\u0441\u044d\u043a\u0437\u0430\u043c\u0435\u043d\u0430 \u043f\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u2014 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438\u043c\u044f, \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u043e\u0442\u0432\u0435\u0442 \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435:  <\/p>\n<blockquote><p><code>What is your name?<\/code><br \/>  <em><code>\u0412\u0430\u0441\u044f<\/code><\/em><br \/>  <code>Hi, \u0412\u0430\u0441\u044f!<\/code>  <\/p><\/blockquote>\n<p>  \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u044d\u0442\u043e\u0439 \u0432\u0441\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u2014 <em>Haskell<\/em>, \u043f\u0440\u0438\u0447\u0451\u043c \u0431\u0435\u0437 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u043c\u043e\u043d\u0430\u0434\u044b <code>IO<\/code>. \u0417\u0430\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0430\u044f noname, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"haskell\">module Main_ where import Control.Monad import Data.Vector (Vector, (!?)) import qualified Data.ByteString.Lazy.UTF8 as U import Data.ByteString.Base64.Lazy  worldBase64 :: String worldBase64   =  &quot;V29ybGQge2FwcEluc3RhbmNlcyA9IFtbSU9PcGVyYXRpb24gSU9Xcml0ZSAiV2hhdCBpcyB5b3Vy&quot;   ++ &quot;IG5hbWU\/CiIsSU9PcGVyYXRpb24gSU9SZWFkICJub25hbWUiLElPT3BlcmF0aW9uIElPV3JpdGUg&quot;   ++ &quot;IkhpLCBub25hbWUhCiJdLFtJT09wZXJhdGlvbiBJT1dyaXRlICJXaGF0IGlzIHlvdXIgbmFtZT8K&quot;   ++ &quot;IixJT09wZXJhdGlvbiBJT1JlYWQgIlwxMDQyXDEwNzJcMTA4OVwxMTAzIixJT09wZXJhdGlvbiBJ&quot;   ++ &quot;T1dyaXRlICJIaSwgXDEwNDJcMTA3MlwxMDg5XDExMDMhCiJdLFtJT09wZXJhdGlvbiBJT1dyaXRl&quot;   ++ &quot;ICJXaGF0IGlzIHlvdXIgbmFtZT8KIixJT09wZXJhdGlvbiBJT1JlYWQgIlwxMDU0XDEwODNcMTEw&quot;   ++ &quot;MyIsSU9PcGVyYXRpb24gSU9Xcml0ZSAiSGksIFwxMDU0XDEwODNcMTEwMyEKIl1dfQo=&quot;  type AppInstance = Int type IOIndex = Int data IOAction = IORead | IOWrite deriving (Eq, Show, Read) data IOOperation = IOOperation IOAction String deriving (Show, Read) data World = World { appInstances :: Vector (Vector IOOperation) } deriving (Show, Read)  world :: World world = read $ U.toString $ decodeLenient $ U.fromString worldBase64  getInOutText :: IOAction -&gt; AppInstance -&gt; IOIndex -&gt; Maybe String getInOutText action app i = do   IOOperation actual_action result &lt;- (!? i) &lt;=&lt; (!? app) $ appInstances world   if actual_action == action then return result else Nothing  getInText :: AppInstance -&gt; IOIndex -&gt; Maybe String getInText = getInOutText IORead  getOutText :: AppInstance -&gt; IOIndex -&gt; Maybe String getOutText = getInOutText IOWrite  isOutTextEquals :: String -&gt; AppInstance -&gt; IOIndex -&gt; Bool isOutTextEquals text inst index = getOutText inst index == Just text  _main :: AppInstance -&gt; Maybe String _main app = do   let question = &quot;What is your name?\\n&quot;   _ &lt;- if isOutTextEquals question app 0 then return () else Nothing   name &lt;- getInText app 1   let greeting = &quot;Hi, &quot; ++ name ++ &quot;!\\n&quot;   _ &lt;- if isOutTextEquals greeting app 2 then return () else Nothing   return $ question ++ name ++ &quot;\\n&quot; ++ greeting <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041f\u043e \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c \u0433\u043b\u0430\u0432\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438 \u043c\u043e\u0434\u0443\u043b\u044c \u0432 \u044d\u0442\u043e\u0439 \u0432\u0441\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, <code>Main_<\/code> \u0438 <code>_main<\/code>, \u0438, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0432\u0438\u0434\u0435\u0442\u044c, \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>_main<\/code> \u0438\u043c\u0435\u0435\u0442 \u0442\u0438\u043f <code>AppInstance -&gt; Maybe String<\/code>. \u0412 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 noname <code>_main<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u0434\u0438\u0430\u043b\u043e\u0433\u0430 \u2014 \u044d\u0442\u043e \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438 \u0437\u0430\u0434\u0430\u0447\u0438, \u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0432 \u0446\u0435\u043b\u044f\u0445 \u043e\u0442\u043b\u0430\u0434\u043a\u0438.<\/p>\n<p>  Noname \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b \u0440\u0430\u0431\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0432 \u0435\u0451 \u0438 \u0432\u0432\u0435\u0434\u044f \u0441\u0432\u043e\u0451 \u0438\u043c\u044f \u2014 \u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0432\u0440\u043e\u0434\u0435 \u0431\u044b \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0430 \u043a\u0430\u043a \u043d\u0430\u0434\u043e \u2014 \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u043b\u0430 \u0438\u043c\u044f \u0438 \u0432 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u00abnoname\u00bb \u0432\u044b\u0434\u0430\u043b\u0430 \u00abHi, noname!\u00bb<\/p>\n<p>  (\u041a\u0430\u043a \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u044f\u0432\u043d\u044b\u0445 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0439 \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430\u0434\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u043d\u0430 \u044d\u043a\u0440\u0430\u043d \u0438 \u0432 \u043a\u0430\u043a\u0438\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u0436\u0434\u0430\u0442\u044c \u0432\u0432\u043e\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0442\u0430\u043a \u0447\u0442\u043e \u0444\u0430\u043a\u0442 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0432\u0435\u0441\u044c\u043c\u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u043d \u0432 \u0441\u043c\u044b\u0441\u043b\u0435 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043c\u043e\u0449\u0438 \u044d\u0432\u0440\u0438\u0441\u0442\u0438\u043a\u0438, \u0437\u0430\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0439 \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0440\u0430\u0439\u043d\u0442\u0430\u0439\u043c <em>Haskell<\/em> \u0432\u0441\u0435\u043b\u0435\u043d\u043d\u043e\u0439 noname.)<\/p>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0430 \u0432\u0435\u0440\u043d\u043e \u043f\u0440\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c \u043f\u0435\u0440\u0432\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435, \u0443 noname \u043d\u0435\u0442 \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u0438, \u0447\u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0438 \u0434\u0430\u043b\u044c\u0448\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c: \u0432\u0435\u0434\u044c \u00ab\u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 \u0432\u0441\u0435\u043b\u0435\u043d\u043d\u043e\u0439\u00bb (<code>worldBase64<\/code>) \u043e\u043d \u0432\u043f\u0438\u0441\u0430\u043b \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0443\u044e \u043e\u043d \u043d\u0435 \u0437\u043d\u0430\u0435\u0442. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 noname \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043c\u0430\u0448\u0438\u043d\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 (\u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438, \u0441 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u043e\u0449\u043d\u044b\u043c \u043f\u043e\u0434\u0430\u0432\u0438\u0442\u0435\u043b\u0435\u043c \u043f\u0430\u0440\u0430\u0434\u043e\u043a\u0441\u043e\u0432) \u0438 \u0432\u044b\u0448\u0435\u043b \u043d\u0430 \u0441\u0432\u044f\u0437\u044c \u0441 \u043d\u0430\u0448\u0435\u0439 \u0412\u0441\u0435\u043b\u0435\u043d\u043d\u043e\u0439, \u043f\u0435\u0440\u0435\u0434\u0430\u0432 \u043b\u0438\u0441\u0442\u0438\u043d\u0433 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438 \u0447\u0435\u0440\u0442\u0435\u0436\u0438 \u043c\u0430\u0448\u0438\u043d\u044b \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432 \u043e\u0431\u043c\u0435\u043d \u043d\u0430 \u043e\u0431\u0435\u0449\u0430\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0435\u043c\u0443 \u0442\u043e\u0447\u043d\u0443\u044e \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 \u0435\u0433\u043e \u0432\u0441\u0435\u043b\u0435\u043d\u043d\u043e\u0439 (\u0442\u043e\u0447\u043d\u0435\u0435, \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0435\u0439 \u0435\u0433\u043e \u0447\u0430\u0441\u0442\u0438) \u2014 \u043d\u0430\u043c, \u043c\u043e\u043b, \u043e\u0442\u0441\u044e\u0434\u0430 \u0432\u0438\u0434\u043d\u0435\u0435, \u0447\u0435\u043c \u0435\u043c\u0443 \u0438\u0437\u043d\u0443\u0442\u0440\u0438.<\/p>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u044d\u0442\u0443 \u0438\u043d\u043e\u0432\u0441\u0435\u043b\u0435\u043d\u0441\u043a\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043a\u0430\u043a \u043e\u043d\u0430 \u0435\u0441\u0442\u044c, \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f. \u041d\u043e \u0435\u0441\u043b\u0438 \u0441\u043d\u0430\u0431\u0434\u0438\u0442\u044c \u0435\u0451 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u044b\u043c \u043c\u043e\u0434\u0443\u043b\u0435\u043c, \u0442\u043e \u043a\u0430\u043a-\u0442\u043e \u043e\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0431\u0443\u0434\u0435\u0442:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"haskell\">module Main where  import System.Environment import Data.Vector ((!?)) import qualified Data.Vector as V hiding ((!?)) import Main_  main :: IO () main = do   args &lt;- V.fromList &lt;$&gt; getArgs   case _main =&lt;&lt; read &lt;$&gt; (args !? 0) of     Just text -&gt; putStr text     Nothing -&gt; putStrLn &quot;Error!&quot; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  (\u041f\u043e\u043b\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u043b\u0435\u0436\u0438\u0442 \u043d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431\u0435: <a href=\"https:\/\/github.com\/A1-Triard\/pure-io\">pure-io<\/a>. \u041a\u0441\u0442\u0430\u0442\u0438 \u0435\u0441\u043b\u0438 \u0432\u044b \u0432\u0441\u0451 \u0435\u0449\u0451 \u043d\u0435 \u0437\u043d\u0430\u0435\u0442\u0435, \u043a\u0430\u043a \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0441 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438 <em>stack<\/em>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u0448\u0451\u043b \u043d\u0430 \u0441\u043c\u0435\u043d\u0443 <em>cabal<\/em>, \u0442\u043e \u0432\u043e\u0442 \u0445\u043e\u0440\u043e\u0448\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f: <a href=\"http:\/\/ruhaskell.org\/posts\/utils\/2015\/07\/13\/from-cabal-to-stack.html\">\u041f\u0440\u043e\u0449\u0430\u0439, cabal. \u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439, stack!<\/a>.)<\/p>\n<p>  \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043c\u044b \u043d\u0435 \u0443\u0432\u0438\u0434\u0438\u043c \u00ab\u0432\u044b\u0432\u043e\u0434\u0438\u043c\u044b\u0445\u00bb \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u0440\u0430\u0432\u043d\u043e \u043a\u0430\u043a \u0438 \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u043c \u0432\u0432\u0435\u0441\u0442\u0438 \u0438\u043c\u044f, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u043d\u0435\u0442 \u0443\u043c\u043d\u043e\u0433\u043e \u0438\u043d\u043e\u0432\u0441\u0435\u043b\u0435\u043d\u0441\u043a\u043e\u0433\u043e \u0440\u0430\u0439\u043d\u0442\u0430\u0439\u043c\u0430 \u2014 \u043b\u0438\u0448\u044c \u0437\u0430\u043f\u0438\u0441\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u0434\u0438\u0430\u043b\u043e\u0433\u0430, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 <code>_main<\/code>, \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430. \u041f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u043e\u043c\u0435\u0440 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 (<code>AppInstance<\/code>) \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u2014 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u043d\u043e \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c \u0438 \u0441\u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0432 \u0435\u0451 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438.<\/p>\n<p>  \u041f\u043e\u043d\u044f\u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0432 \u043c\u0430\u0448\u0438\u043d\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043f\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u0447\u0435\u0440\u0442\u0435\u0436\u0430\u043c, \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043f\u043e\u0434\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 <code>wordBase64<\/code> \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f: \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u0430 \u0432\u0441\u0435\u0433\u043e \u0442\u0440\u0438 \u0440\u0430\u0437\u0430 (\u0441\u0447\u0438\u0442\u0430\u044f \u043f\u0435\u0440\u0432\u044b\u0439 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a), \u0438 \u0432\u0441\u0435 \u0442\u0440\u0438 \u0440\u0430\u0437\u0430 \u0435\u0451 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u0440, \u0432\u0432\u043e\u0434\u044f \u0442\u0435 \u0441\u0430\u043c\u044b\u0435 \u0438\u043c\u0435\u043d\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043d \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u043d\u0430\u0447\u0430\u043b\u0430 \u0437\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043b \u0432 \u0442\u0435\u043a\u0441\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b!<\/p>\n<p>  \u0420\u0430\u0437\u043e\u0431\u0440\u0430\u0432\u0448\u0438\u0441\u044c \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0441 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u043e\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0447\u0438\u0441\u0442\u043e\u0433\u043e \u043d\u0435\u043c\u043e\u043d\u0430\u0434\u043d\u043e\u0433\u043e \u0432\u0432\u043e\u0434\u0430-\u0432\u044b\u0432\u043e\u0434\u0430 \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0432 \u0431\u0440\u0430\u0442\u0441\u043a\u0443\u044e \u043f\u043e\u043c\u043e\u0449\u044c \u0438\u043d\u043e\u0432\u0441\u0435\u043b\u0435\u043d\u0446\u0443 noname, \u043f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043e\u0442 \u043c\u043e\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0432\u0441\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043a \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0438 \u043e\u0442 <em>Haskell<\/em> \u043a <em>C#<\/em>.<\/p>\n<h2>\u0427\u0438\u0441\u0442\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u0432\u043e\u0434\u0430-\u0432\u044b\u0432\u043e\u0434\u0430 \u043d\u0430 <em>C#.<\/em> \u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441<\/h2>\n<p>  \u0418\u0437-\u0437\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u044d\u043a\u0441\u0435\u043f\u0448\u0435\u043d\u043e\u0432 <em>C#-<\/em>\u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0430\u044f <code>X,<\/code> \u043f\u043e \u0444\u0430\u043a\u0442\u0443 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>Either Exception X<\/code>; \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, <code>void<\/code>-\u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u00ab\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442\u00bb <code>Either Exception ().<\/code> (\u041a \u0441\u043b\u043e\u0432\u0443, \u0432 <em>Haskell<\/em> \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0441\u0445\u043e\u0436\u0430, \u0438 \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0442\u0430\u043c\u043e\u0448\u043d\u0435\u0433\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e <code>IO<\/code> \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u044d\u043a\u0441\u0435\u043f\u0448\u0435\u043d\u043e\u0432 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0435 \u043a\u0430\u043a <code>type IO a = RealWorld -&gt; (RealWorld, a),<\/code> \u0430 \u0441\u043a\u043e\u0440\u0435\u0435 \u043a\u0430\u043a <code>type IO a = RealWorld -&gt; (RealWorld, Either SomeException a).<\/code>).<\/p>\n<p>  \u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u043e\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u0443\u044e \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e \u0441 \u044d\u043a\u0441\u0435\u043f\u0448\u0435\u043d\u0430\u043c\u0438, \u0432\u044b\u0431\u0435\u0440\u0435\u043c \u0442\u0430\u043a\u0438\u0435 \u0437\u0430\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440 \u043d\u0430\u0448\u0438\u0445 \u0447\u0438\u0441\u0442\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432\u0432\u043e\u0434\u0430-\u0432\u044b\u0432\u043e\u0434\u0430:<\/p>\n<pre><code class=\"cs\">static void AssertOutTextEquals(string text, AppInstance inst, int index); static string GetInText(AppInstance inst, int index); <\/code><\/pre>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>AssertOutTextEquals<\/code> \u2014 \u044d\u0442\u043e \u0442\u0430 \u0436\u0435 <code>isOutTextEquals,<\/code> \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043c\u0435\u0441\u0442\u043e <code>True<\/code> \u043e\u043d\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>void<\/code> \u0431\u0435\u0437 \u044d\u043a\u0441\u043f\u0448\u0435\u043d\u0430, \u0430 \u0432\u043c\u0435\u0441\u0442\u043e <code>False<\/code> \u043a\u0438\u0434\u0430\u0435\u0442 \u044d\u043a\u0441\u0435\u043f\u0448\u0435\u043d. \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e, \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>GetInText<\/code> \u043b\u0438\u0431\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0435\u043d\u0443\u043b\u0435\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u043b\u0438\u0431\u043e \u043a\u0438\u0434\u0430\u0435\u0442 \u044d\u043a\u0441\u0435\u043f\u0448\u0435\u043d.<\/p>\n<p>  \u042d\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u2014 \u0447\u0438\u0441\u0442\u044b\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0432\u044b\u0440\u0430\u0437\u0438\u0442\u044c \u0438\u0445 \u0447\u0435\u0440\u0435\u0437 \u0434\u0440\u0443\u0433\u0438\u0435 \u0447\u0438\u0441\u0442\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (\u043a\u0430\u043a \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435), \u043d\u043e \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u043f\u043e\u0439\u0434\u0451\u043c \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u0443\u0442\u0451\u043c. \u0410 \u0438\u043c\u0435\u043d\u043d\u043e, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u0443\u044e \u043d\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u2014 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0435 \u0432\u0441\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0438 \u043c\u0430\u0448\u0438\u043d\u044b \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<p>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043d\u0435\u043b\u044c\u0437\u044f \u043b\u0438 \u043a\u0430\u043a-\u0442\u043e \u0435\u0449\u0451 \u043e\u0442\u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0442\u044c \u0438 \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u044d\u0442\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043d\u0435 \u043d\u0430\u0440\u0443\u0448\u0430\u044f \u0438\u0434\u0435\u043e\u043b\u043e\u0433\u0438\u0438. \u041c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0445 \u043d\u0435\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0447\u043b\u0435\u043d\u0430\u043c\u0438 <code>AppInstance<\/code>, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u043e <code>void<\/code> \u0447\u0442\u043e-\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u0438\u0434\u0438\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 (\u0434\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430):<\/p>\n<pre><code class=\"cs\">public sealed class None {     public static None _ { get { return null; } }     None() { } } public sealed class AppInstance {     public None AssertOutTextEquals(string text, int index);     publi string GetInText(int index); } <\/code><\/pre>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <code>None<\/code> \u0432\u043c\u0435\u0441\u0442\u043e <code>void<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043d\u0435\u043d\u0443\u0436\u043d\u043e\u0433\u043e \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0438 \u043e\u0431\u043b\u0435\u0433\u0447\u0438\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043c\u043e\u043d\u0430\u0434\u044b.<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0435\u0440\u0432\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u043c \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043e\u043c <code>Console.Write(string),<\/code> \u0430 \u0432\u0442\u043e\u0440\u0430\u044f \u2014 <code>Console.ReadLine().<\/code> \u041f\u043e\u043c\u0438\u043c\u043e \u044d\u0442\u0438\u0445 \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 <code>Console<\/code> \u0435\u0441\u0442\u044c \u0435\u0449\u0451 \u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432\u0432\u043e\u0434\u0430 \u0438 \u0432\u044b\u0432\u043e\u0434\u0430 \u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f linq expressions, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0431\u043e\u0431\u0449\u0438\u0442\u044c \u043d\u0430\u0448\u0438 \u0447\u0438\u0441\u0442\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u0438\u0445 \u0432\u0441\u0435:<\/p>\n<pre><code class=\"cs\">public None AssertOutTextEquals(Expression&lt;Action&gt; ioExpression, int index); public TResult GetInText(Expression&lt;Func&lt;TResult&gt;&gt; ioExpression, int index); <\/code><\/pre>\n<p>  \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0432\u0438\u043c \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438 \u0434\u0430\u0434\u0438\u043c \u043c\u0435\u0442\u043e\u0434\u0430\u043c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0435 \u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u0438\u043c\u044f, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u0447\u0435\u0440\u043a\u043d\u0443\u0442\u044c \u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u044e:<\/p>\n<pre><code class=\"cs\">public None AssertIO(int index, Expression&lt;Action&gt; ioExpression); public TResult AssertIO(int index, Expression&lt;Func&lt;TResult&gt;&gt; ioExpression); <\/code><\/pre>\n<p>  \u0422\u0430\u043a\u0430\u044f \u0443\u043d\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043e\u043f\u0440\u0430\u0432\u0434\u0430\u043d\u0430 \u0442\u0435\u043c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0431\u044b <code>None<\/code> \u0431\u044b\u043b\u043e \u0447\u0430\u0441\u0442\u044c\u044e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0442\u043e \u0432\u043c\u0435\u0441\u0442\u043e <code>Action<\/code> \u043c\u044b \u0438\u043c\u0435\u043b\u0438 \u0431\u044b <code>Func&lt;None&gt;<\/code> \u0438 \u043f\u0435\u0440\u0432\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u0441\u0447\u0435\u0437\u043b\u0430 \u0431\u044b \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0432\u0442\u043e\u0440\u043e\u0439.<\/p>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u044e\u043d\u0438\u0442-\u0442\u0435\u0441\u0442\u044b, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u044e, \u043d\u043e \u0438 \u0441 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0437\u0430\u043c\u0435\u043d\u043e\u0439:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">public sealed class AppInstance {     readonly static Lazy&lt;AppInstance&gt; inst = new Lazy&lt;AppInstance&gt;(() =&gt; new AppInstance((method, argTypes, args) =&gt; typeof(Console).GetMethod(method, BindingFlags.Static | BindingFlags.Public, null, argTypes, null).Invoke(null, args)));     public static AppInstance Get() { return inst.Value; }      readonly Func&lt;string, Type[], object[], object&gt; consoleDescriptor;      internal AppInstance(Func&lt;string, Type[], object[], object&gt; consoleDescriptor) {         this.consoleDescriptor = consoleDescriptor;     } } public static class AppInstanceTestExtensions {     public static AppInstance ForTests(this AppInstance inst, Func&lt;string, Type[], object[], object&gt; consoleDescriptor) {         return new AppInstance(consoleDescriptor);     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">[TestFixture] public class Tests {     TestConsole console;     AppInstance testInst;      protected void Setup(string input) {         console = new TestConsole(input);         testInst = AppInstance.Get().ForTests((method, argTypes, args) =&gt; {             var call = new object[] { console, console.In, console.Out }.Select(x =&gt; new { t = x, m = x.GetType().GetMethod(method, argTypes) }).Where(x =&gt; x.m != null).First();             return call.m.Invoke(call.t, args);         });     } } public class TestConsole {     readonly MemoryStream output;     StreamWriter writer;     readonly MemoryStream input;     StreamReader reader;      public TestConsole(string input) {         this.input = new MemoryStream(Encoding.UTF8.GetBytes(input));         this.reader = new StreamReader(this.input);         this.output = new MemoryStream();         this.writer = new StreamWriter(this.output);     }      public TextWriter Out { get { return writer; } }     public TextReader In { get { return reader; } }     public string Output {         get {             if(writer != null) {                 writer.Close();                 writer = null;             }             return Encoding.UTF8.GetString(output.ToArray());         }     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<h2>\u0427\u0438\u0441\u0442\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u0432\u043e\u0434\u0430-\u0432\u044b\u0432\u043e\u0434\u0430 \u043d\u0430 <em>C#.<\/em> \u0422\u0435\u0441\u0442\u044b<\/h2>\n<p>  \u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e:<\/p>\n<pre><code class=\"cs\">[Test] public void WriteChars() {     Setup(&quot;&quot;);     testInst.AssertIO(0, () =&gt; Console.Write(&#39;A&#39;));     testInst.AssertIO(1, () =&gt; Console.Write(&#39;B&#39;));     Assert.AreEqual(&quot;AB&quot;, console.Output); } <\/code><\/pre>\n<p>  \u0417\u0430\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u0447\u0438\u0441\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>AssertIO,<\/code> \u043d\u043e \u0438 \u0441\u0430\u0439\u0434-\u044d\u0444\u0444\u0435\u043a\u0442\u044b: \u0432 \u043a\u043e\u0434\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e <code>... Write('A') ... Write('B') ...,<\/code> \u0438 \u043e\u0436\u0438\u0434\u0430\u0435\u0442\u0441\u044f \u0447\u0442\u043e \u043d\u0430 \u044d\u043a\u0440\u0430\u043d \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0432\u0435\u0434\u0435\u043d\u043e \u00abAB\u00bb.<\/p>\n<p>  \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u043e\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0432\u0438\u043c \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u0432\u044b\u0437\u043e\u0432\u044b <code>AssertIO.<\/code> \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 <code>AssertIO<\/code> \u2014 \u0447\u0438\u0441\u0442\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0442\u043e \u043f\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 (\u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u044d\u043a\u0441\u0435\u043f\u0448\u0435\u043d\u043e\u0432) \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c\u0441\u044f. \u041d\u043e \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a: \u044d\u0442\u043e \u0434\u0440\u0443\u0433\u043e\u0439 \u0442\u0435\u0441\u0442, \u0432 \u043d\u0451\u043c \u0434\u0440\u0443\u0433\u043e\u0439 AppInstance, \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 <em>\u043c\u043e\u0436\u0435\u0442<\/em> \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c\u0441\u044f (\u0445\u043e\u0442\u044f \u043c\u043e\u0436\u0435\u0442 \u0438 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c\u0441\u044f). \u041d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f:<\/p>\n<pre><code class=\"cs\">[Test] public void WriteCharsInBackOrder() {     Setup(&quot;&quot;);     Assert.Throws&lt;ArgumentOutOfRangeException&gt;(() =&gt; testInst.AssertIO(1, () =&gt; Console.Write(&#39;B&#39;)));     Assert.Throws&lt;ArgumentOutOfRangeException&gt;(() =&gt; testInst.AssertIO(0, () =&gt; Console.Write(&#39;A&#39;)));     Assert.AreEqual(&quot;&quot;, console.Output); } <\/code><\/pre>\n<p>  \u0427\u0438\u0441\u0442\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0438 \u0442\u043e\u043c \u0436\u0435 \u043d\u0430\u0431\u043e\u0440\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432:<\/p>\n<pre><code class=\"cs\">[Test] public void WriteCharTwice() {     Setup(&quot;&quot;);     testInst.AssertIO(0, () =&gt; Console.Write(&#39;A&#39;));     testInst.AssertIO(0, () =&gt; Console.Write(&#39;A&#39;));     Assert.Throws&lt;ArgumentException&gt;(() =&gt; testInst.AssertIO(0, () =&gt; Console.Write(&#39;B&#39;)));     Assert.AreEqual(&quot;A&quot;, console.Output); } <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b\u0432\u043e\u0434 \u043d\u0435 \u0443\u0434\u0430\u043b\u0441\u044f \u043f\u043e \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435, \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443 \u0432 \u0432\u0438\u0434\u0435 \u044d\u043a\u0441\u0435\u043f\u0448\u0435\u043d\u0430:<\/p>\n<pre><code class=\"cs\">[Test] public void GetWriteError() {     Setup(&quot;&quot;);     console.Out.Close();     Assert.Throws&lt;AggregateException&gt;(() =&gt; testInst.AssertIO(0, () =&gt; Console.Write(&#39;A&#39;)));     Assert.Throws&lt;ArgumentException&gt;(() =&gt; testInst.AssertIO(0, () =&gt; Console.Write(&#39;B&#39;))); } <\/code><\/pre>\n<p>  \u041d\u0430\u043c \u0442\u0430\u043a\u0436\u0435 \u043d\u0443\u0436\u0435\u043d \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u0438\u043d \u0442\u0435\u0441\u0442 \u043d\u0430 \u0447\u0442\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"cs\">[Test] public void ReadChar() {     Setup(&quot;123&quot;);     Assert.AreEqual((int)&#39;1&#39;, testInst.AssertIO(0, () =&gt; Console.Read()));     Assert.AreEqual((int)&#39;2&#39;, testInst.AssertIO(1, () =&gt; Console.Read()));     Assert.AreEqual((int)&#39;3&#39;, testInst.AssertIO(2, () =&gt; Console.Read()));     Assert.AreEqual(-1, testInst.AssertIO(3, () =&gt; Console.Read())); } <\/code><\/pre>\n<p>  <\/p>\n<h2>\u0427\u0438\u0441\u0442\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u0432\u043e\u0434\u0430-\u0432\u044b\u0432\u043e\u0434\u0430 \u043d\u0430 <em>C#.<\/em> \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h2>\n<p>  \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0439 linq expression \u0438 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0439 <code>consoleDescriptor<\/code>:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">class IOOperation&lt;TResult&gt; {     readonly string method;     readonly Type[] argTypes;     readonly object[] args;      public IOOperation(LambdaExpression callExpression) {         var methodExpr = (MethodCallExpression)callExpression.Body;         this.args = methodExpr.Arguments.Select(x =&gt; Expression.Lambda&lt;Func&lt;object&gt;&gt;(Expression.Convert(x, typeof(object))).Compile()()).ToArray();         this.method = methodExpr.Method.Name;         this.argTypes = methodExpr.Method.GetParameters().Select(x =&gt; x.ParameterType).ToArray();     }      public TResult Do(Func&lt;string, Type[], object[], object&gt; consoleDescriptor) {         return (TResult)consoleDescriptor(method, argTypes, args);     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u043b\u044f \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 (\u043a\u0430\u043a \u0432 \u0442\u0435\u0441\u0442\u0435 <code>WriteCharTwice<\/code>) \u0443\u0434\u043e\u0431\u043d\u043e \u043f\u0435\u0440\u0435\u043a\u0440\u044b\u0442\u044c Equals:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">public static bool operator ==(IOOperation&lt;TResult&gt; a, IOOperation&lt;TResult&gt; b) {     bool aIsNull = ReferenceEquals(a, null);     bool bIsNull = ReferenceEquals(b, null);     return         aIsNull &amp;&amp; bIsNull ||         !aIsNull &amp;&amp; !bIsNull &amp;&amp;         string.Equals(a.method, b.method, StringComparison.Ordinal) &amp;&amp;         a.args.Length == b.args.Length &amp;&amp;         !a.args.Zip(b.args, Equals).Where(x =&gt; !x).Any(); } public override int GetHashCode() { return method.GetHashCode() ^ args.Length; } public static bool operator !=(IOOperation&lt;TResult&gt; a, IOOperation&lt;TResult&gt; b) { return !(a == b); } public override bool Equals(object obj) { return this == obj as IOOperation&lt;TResult&gt;; } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0432\u0435\u0441\u0442\u0438 \u0434\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 <code>AssertIO<\/code> \u043a \u043e\u0434\u043d\u043e\u043c\u0443:<\/p>\n<pre><code class=\"cs\">public None AssertIO(int index, Expression&lt;Action&gt; ioExpression) {     return AssertIO(index, new IOOperation&lt;None&gt;(ioExpression)); } public TResult AssertIO&lt;TResult&gt;(int index, Expression&lt;Func&lt;TResult&gt;&gt; ioExpression) {     return AssertIO(index, new IOOperation&lt;TResult&gt;(ioExpression)); } TResult AssertIO&lt;TResult&gt;(int index, IOOperation&lt;TResult&gt; operation);<\/code><\/pre>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 \u2014 \u0438 \u0434\u0435\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e.<\/p>\n<p>  \u042f\u0441\u043d\u043e, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u043a\u0430\u043a-\u0442\u043e \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0443\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043d\u0430\u0448\u0438\u0445 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0439 \u043a \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043a\u043e\u043d\u0441\u043e\u043b\u0438. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0438 \u0444\u0438\u043b\u0434\u044b:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">readonly List&lt;IOOperationWithResult&gt; completedOperations = new List&lt;IOOperationWithResult&gt;();  abstract class IOOperationResult { } sealed class IOOperationResult&lt;TResult&gt; : IOOperationResult {     readonly TResult returnValue;     readonly Exception exception;      public IOOperationResult(Func&lt;TResult&gt; getResult) {         try {             returnValue = getResult();             exception = null;         } catch(Exception e) {             returnValue = default(TResult);             exception = e;         }     }      public TResult Result {         get {             if(exception != null)                 throw new AggregateException(exception);             return returnValue;         }     } } abstract class IOOperationWithResult { } sealed class IOOperationWithResult&lt;TResult&gt; : IOOperationWithResult {     public IOOperationWithResult(IOOperation&lt;TResult&gt; operation, IOOperationResult&lt;TResult&gt; result) {         Operation = operation;         Result = result;     }     public readonly IOOperation&lt;TResult&gt; Operation;     public readonly IOOperationResult&lt;TResult&gt; Result; } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041f\u0440\u043e\u0434\u0435\u043b\u0430\u0432 \u043f\u0440\u0435\u0434\u0430\u0432\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e <code>AssertIO<\/code>:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">bool rejectOperations = false;  TResult AssertIO&lt;TResult&gt;(int index, IOOperation&lt;TResult&gt; operation) {     if(index &lt; 0)         throw new ArgumentOutOfRangeException(&quot;index&quot;);     if(index &lt; completedOperations.Count) {         var completedOperation = completedOperations[index] as IOOperationWithResult&lt;TResult&gt;;         if(completedOperation == null || completedOperation.Operation != operation)             throw new ArgumentException(&quot;&quot;, &quot;operation&quot;);         return completedOperation.Result.Result;     }     if(rejectOperations)         throw new ArgumentOutOfRangeException(&quot;index&quot;);     if(index == completedOperations.Count) {         var completedOperation = new IOOperationWithResult&lt;TResult&gt;(operation, new IOOperationResult&lt;TResult&gt;(() =&gt; operation.Do(consoleDescriptor)));         completedOperations.Add(completedOperation);         return completedOperation.Result.Result;     }     rejectOperations = true;     throw new ArgumentOutOfRangeException(&quot;index&quot;); } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0441\u0442\u043e\u0439. \u0415\u0441\u043b\u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0443\u0436\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u0442\u043e \u043c\u044b \u043b\u0435\u0437\u0435\u043c \u0432 \u043a\u044d\u0448 \u0438 \u0441\u0432\u0435\u0440\u044f\u0435\u043c IOOperation. \u0415\u0441\u043b\u0438 \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u043f\u043e\u043b\u043d\u043e\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435, \u0437\u043d\u0430\u0447\u0438\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u044b\u043b \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0451\u043d \u0432\u044b\u0437\u043e\u0432 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438, \u0438 \u043c\u044b \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442; \u0430 \u0435\u0441\u043b\u0438 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u2014 \u0440\u0435\u0439\u0437\u0438\u043c \u044d\u043a\u0441\u043f\u0435\u0448\u0435\u043d. \u0414\u0430\u043b\u0435\u0435, \u0435\u0441\u043b\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432 \u043a\u044d\u0448\u0435 \u0435\u0449\u0451 \u043d\u0435\u0442 \u0438 \u0441\u0435\u0439\u0447\u0430\u0441 \u043a\u0430\u043a \u0440\u0430\u0437 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0447\u0442\u043e\u0431\u044b \u0435\u0451 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u2014 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0432 \u043a\u044d\u0448, \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u0415\u0441\u043b\u0438 \u0436\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432 \u043a\u044d\u0448\u0435 \u043d\u0435\u0442 \u0438 \u0434\u043b\u044f \u0435\u0451 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043c\u0430\u0448\u0438\u043d\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u2014 \u043d\u0438\u0447\u0435\u0433\u043e \u0445\u043e\u0440\u043e\u0448\u0435\u0433\u043e \u043d\u0435 \u0432\u044b\u0439\u0434\u0435\u0442, \u0442\u0430\u043a \u0447\u0442\u043e \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0443\u043f\u0430\u0441\u0442\u044c, \u0432\u0437\u0432\u0435\u0434\u044f \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u043b\u0430\u0436\u043e\u043a <code>rejectOperations,<\/code> \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442 \u043a\u043e\u043d\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u0440\u0438 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0445 \u0432\u044b\u0437\u043e\u0432\u0430\u0445.<\/p>\n<p>  \u0422\u0430\u043a\u0430\u044f \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u0435\u0434\u0451\u0442 \u0441\u0435\u0431\u044f \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0430 \u0447\u0438\u0441\u0442\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445, \u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 (\u0438 \u043d\u0435\u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445) \u0442\u0435\u0441\u0442\u043e\u0432.<\/p>\n<h2>\u041c\u043e\u043d\u0430\u0434\u0430 <code>IO<\/code><\/h2>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0447\u0438\u0441\u0442\u044b\u0435 \u043d\u0435\u043c\u043e\u043d\u0430\u0434\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u0432\u043e\u0434\u0430-\u0432\u044b\u0432\u043e\u0434\u0430, \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u043e\u043d\u0430\u0434\u0443 <code>IO<\/code> \u043d\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0442\u0440\u0443\u0434\u0430:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">public sealed class IO&lt;T&gt; {     readonly Func&lt;RealWorld, Tuple&lt;RealWorld, T&gt;&gt; func;      internal IO(Func&lt;RealWorld, Tuple&lt;RealWorld, T&gt;&gt; func) {         this.func = func;     }     internal RealWorld Execute(RealWorld index, out T result) {         var resultTuple = func(index);         result = resultTuple.Item2;         return resultTuple.Item1;     } } class RealWorld {     readonly AppInstance inst;     readonly int index;      public RealWorld(AppInstance inst, int index) {         this.inst = inst;         this.index = index;     }     public Tuple&lt;RealWorld, None&gt; Do(Expression&lt;Action&gt; callExpression) {         return Tuple.Create(Yield(), inst.AssertIO(index, callExpression));     }     public Tuple&lt;RealWorld, TResult&gt; Do&lt;TResult&gt;(Expression&lt;Func&lt;TResult&gt;&gt; callExpression) {         return Tuple.Create(Yield(), inst.AssertIO(index, callExpression));     }     public RealWorld Yield() {         return new RealWorld(inst, index + 1);     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041c\u044b \u0434\u0430\u0436\u0435 \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0438\u043c\u0435\u044e\u0449\u0438\u0439\u0441\u044f \u0432 <em>C#<\/em> \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u043e\u043d\u0430\u0434\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 <code>(from ... in ... select ...).<\/code> \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043a\u0440\u043e\u043c\u0435 \u043d\u0430\u0448\u0438\u0445 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 <code>Return<\/code> \u0438 <code>Do<\/code> \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b <code>Select<\/code> \u0438 <code>SelectMany<\/code> (\u043e\u043d\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a \u0438 \u0438\u043c\u0435\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u0443\u044e \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0443 \u2014 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0443\u0442\u0438\u043d\u0430\u044f \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u044f):<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">public static class IO {     public static IO&lt;T&gt; Return&lt;T&gt;(T value) {         return new IO&lt;T&gt;(x =&gt; Tuple.Create(x, value));     }     public static IO&lt;R&gt; Select&lt;T, R&gt;(this IO&lt;T&gt; io, Func&lt;T, R&gt; selector) {         return new IO&lt;R&gt;(x =&gt; {             T t;             var index = io.Execute(x, out t);             return Tuple.Create(index, selector(t));         });     }     public static IO&lt;R&gt; SelectMany&lt;T, C, R&gt;(this IO&lt;T&gt; io, Func&lt;T, IO&lt;C&gt;&gt; selector, Func&lt;T, C, R&gt; projector) {         return new IO&lt;R&gt;(x =&gt; {             T t;             var index = io.Execute(x, out t);             var ioc = selector(t);             C c;             var resultIndex = ioc.Execute(index, out c);             return Tuple.Create(resultIndex, projector(t, c));         });     }     public static IO&lt;None&gt; Do(Expression&lt;Action&gt; callExpression) {         return new IO&lt;None&gt;(x =&gt; x.Do(callExpression));     }     public static IO&lt;TResult&gt; Do&lt;TResult&gt;(Expression&lt;Func&lt;TResult&gt;&gt; callExpression) {         return new IO&lt;TResult&gt;(x =&gt; x.Do(callExpression));     }     public static IO&lt;T&gt; Handle&lt;T&gt;(this IO&lt;T&gt; io, Func&lt;Exception, IO&lt;T&gt;&gt; handler) {         return new IO&lt;T&gt;(x =&gt; {             RealWorld rw;             T t;             try {                 rw = io.Execute(x, out t);             } catch(Exception e) {                 rw = handler(e).Execute(x.Yield(), out t);             }             return Tuple.Create(rw, t);         });     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041a\u0440\u043e\u043c\u0435 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0445, \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0432\u0435\u0441\u044c\u043c\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 <code>Handle<\/code>, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u0440\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u0438 \u044d\u043a\u0441\u0435\u043f\u0448\u0435\u043d\u0430.<\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u00ab\u043c\u043e\u043d\u0430\u0434\u043d\u0430\u044f\u00bb \u0442\u043e\u0447\u043a\u0430 \u0432\u0445\u043e\u0434\u0430 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"cs\">public static class AppInstanceIOExtensions {     public static void DoMain(this AppInstance inst, Func&lt;IO&lt;None&gt;&gt; body) {         None result;         body().Execute(new RealWorld(inst, 0), out result);     } } <\/code><\/pre>\n<p>  <\/p>\n<h2>\u0414\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430<\/h2>\n<p>  \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0435\u0435 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043c\u043e\u043d\u0430\u0434\u0443 <code>IO<\/code>:<\/p>\n<pre><code class=\"cs\">class Program {     static void Main(string[] args) {         AppInstance.Get().DoMain(IOMain);     }     static IO&lt;None&gt; IOMain() {         return             from _ in IO.Do(() =&gt; Console.WriteLine(&quot;What is your name?&quot;))             from name in IO.Do(() =&gt; Console.ReadLine())             let message = &quot;Hi, &quot; + name + &quot;!&quot;             from r in IO.Do(() =&gt; Console.WriteLine(message))             select r;     } } <\/code><\/pre>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/448\/1c2\/155\/4481c2155c4448c58e9d3f4a1e56250e.png\"\/><\/p>\n<p>  \u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431\u0435: <a href=\"https:\/\/github.com\/A1-Triard\/IOMonad\">IOMonad<\/a>.       <\/p>\n<div class=\"clear\"><\/div>\n<p> \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:\/\/habrahabr.ru\/post\/282940\/\"> https:\/\/habrahabr.ru\/post\/282940\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u0412 \u0436\u0438\u0437\u043d\u0438 \u043d\u0435\u0440\u0435\u0434\u043a\u043e \u0431\u044b\u0432\u0430\u044e\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0435\u0441\u0442\u044c \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0434\u0435\u043b\u043e, \u043d\u0435 \u0437\u0430\u0431\u0438\u0432\u0430\u044f \u0441\u0435\u0431\u0435 \u0433\u043e\u043b\u043e\u0432\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u043c\u0438 \u0432\u0440\u043e\u0434\u0435 &quot;\u0430 \u0447\u0442\u043e \u044d\u0442\u043e \u0434\u0430\u0441\u0442?&quot;, &quot;\u0430 \u043a\u043e\u043c\u0443 \u044d\u0442\u043e \u043d\u0443\u0436\u043d\u043e?&quot; \u0438 \u0442. \u043f. \u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u043e\u043d\u0430\u0434\u044b <code>IO \u2014<\/code> \u0431\u0435\u0437\u0443\u0441\u043b\u043e\u0432\u043d\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u0441\u043b\u0443\u0447\u0430\u0439. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0437 \u043e \u0442\u043e\u043c <em>\u043a\u0430\u043a<\/em> \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u043e\u043d\u0430\u0434\u0443 <code>IO<\/code> \u043d\u0430 <em>C#,<\/em> \u0431\u0435\u0437 \u043c\u0430\u043b\u0435\u0439\u0448\u0438\u0445 \u043f\u043e\u043f\u044b\u0442\u043e\u043a \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c <em>\u0437\u0430\u0447\u0435\u043c<\/em> \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0411\u0430\u044f\u043d\u0438\u0441\u0442\u0430\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430, \u043e\u0442\u0440\u0430\u0436\u0430\u044e\u0449\u0430\u044f \u0441\u0443\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u0438<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"http:\/\/cs.pikabu.ru\/images\/big_size_comm\/2013-09_5\/13798569678719.gif\"\/>  <\/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-279561","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/279561","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=279561"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/279561\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=279561"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=279561"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=279561"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}