{"id":159127,"date":"2012-11-18T14:32:04","date_gmt":"2012-11-18T10:32:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=159127"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=159127","title":{"rendered":"<span class=\"post_title\">\u0414\u0432\u0435 \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0430 Haskell (\u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445)<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t\u041f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0425\u0430\u0431\u0440\u0430\u0445\u0430\u0431\u0440!<br \/>  \u042f \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u043d\u0430\u0447\u0430\u043b \u0438\u0437\u0443\u0447\u0430\u0442\u044c Haskell, \u0438, \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0441\u0432\u043e\u0438\u0432 \u0435\u0433\u043e, \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043d\u0430\u043a\u043e\u043f\u043b\u0435\u043d\u043d\u044b\u043c \u043e\u043f\u044b\u0442\u043e\u043c. \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u0437\u043d\u0430\u043d\u0438\u044f Haskell \u0443 \u043c\u0435\u043d\u044f \u043d\u0435 \u043d\u0430 \u0442\u0430\u043a\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u043a\u0430\u043a \u0443 <a href=\"http:\/\/habrahabr.ru\/users\/darkus\/\" class=\"user_link\">Darkus<\/a>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u0432\u0435 \u0437\u0430\u0434\u0430\u0447\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u043d\u0438\u0436\u0435, \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0430 \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432, \u043d\u043e \u043e\u043f\u044b\u0442\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438 \u043f\u043e\u043f\u0440\u0430\u0432\u044f\u0442, \u0438 \u043f\u043e\u0434\u0441\u043a\u0430\u0436\u0443\u0442 \u043a\u0430\u043a \u043b\u0443\u0447\u0448\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c. \u042d\u0442\u0430 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u044f \u043f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0430 \u0425\u0430\u0431\u0440\u0430\u0445\u0430\u0431\u0440, \u043d\u043e \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u043c\u043e\u0439 \u043f\u0435\u0440\u0432\u044b\u0439 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u043a\u043e\u0433\u0434\u0430-\u043b\u0438\u0431\u043e \u043f\u0438\u0441\u0430\u043b.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h3>\u0417\u0430\u0434\u0430\u0447\u0430 1 <\/h3>\n<p>  \u0412 \u0433\u043e\u0440\u043e\u0434\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0435\u043c \u0438\u0437 n \u0440\u0430\u0439\u043e\u043d\u043e\u0432 \u043d\u0430\u0434\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0443\u043d\u043a\u0442\u044b \u0442\u0430\u043c\u043e\u0436\u043d\u0438. \u041d\u043e \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0438\u0445 \u043d\u0430\u0434\u043e \u0432 \u0441\u0430\u043c\u044b\u0445 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0445 \u0440\u0430\u0439\u043e\u043d\u0430\u0445 \u0433\u043e\u0440\u043e\u0434\u0430. \u0417\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u043c \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0439\u043e\u043d, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430\u0434\u043e \u043f\u0440\u043e\u0435\u0445\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u0435\u0445\u0430\u0442\u044c \u0438\u0437 \u0447\u0430\u0441\u0442\u0438 \u0433\u043e\u0440\u043e\u0434\u0430 \u0410 \u0432 \u0447\u0430\u0441\u0442\u044c \u0412, \u0442.\u0435. \u0435\u0441\u043b\u0438 \u043d\u0435\u0442 \u043e\u0431\u044a\u0435\u0437\u043d\u043e\u0433\u043e \u043f\u0443\u0442\u0438. \u0415\u0441\u043b\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0433\u043e\u0440\u043e\u0434 \u043a\u0430\u043a \u0433\u0440\u0430\u0444, \u0430 \u0440\u0430\u0439\u043e\u043d\u044b \u043a\u0430\u043a \u0443\u0437\u043b\u044b, \u0442\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043a\u0430\u0442\u044c \u0432\u0441\u0435 \u00ab\u0431\u0443\u0442\u044b\u043b\u043e\u0447\u043d\u044b\u0435 \u0433\u043e\u0440\u043b\u0430\u00bb (=bottlenecks \u0438\u043b\u0438 \u0435\u0449\u0435 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u00ab\u0438\u0433\u043e\u043b\u044c\u043d\u043e\u0435 \u0443\u0448\u043a\u043e\u00bb) \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043f\u0443\u0442\u0438. \u0414\u0430\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"haskell\">type District       = Integer type NumOfDistricts = Integer type Route\t    = (District, District) newtype CityMap\t    = CM (NumOfDistricts, [Route]) -- \u0412\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u0438\u043f\u044b: type Path = [District] type Bottleneck = District<\/code><\/pre>\n<p>  \u0412 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0438\u0442\u043e\u0433\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f:<\/p>\n<pre><code class=\"haskell\">bottlenecks :: CityMap -&gt; District -&gt; District -&gt; [Bottleneck]<\/code><\/pre>\n<p>  \u0422.\u0435. \u043f\u0435\u0440\u0435\u0434\u0430\u0432 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 CityMap \u0438 \u0434\u0432\u0430 \u0440\u0430\u0439\u043e\u043d\u0430 (\u043d\u0430\u0447\u0430\u043b\u043e \u0438 \u043a\u043e\u043d\u0435\u0446), \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043c\u0430\u0441\u0441\u0438\u0432 \u0432\u0441\u0435\u0445 \u0443\u0437\u043b\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430\u0434\u043e \u043f\u0440\u043e\u0439\u0442\u0438 \u0435\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u043f\u0430\u0441\u0442\u044c \u0438\u0437 \u043e\u0434\u043d\u043e \u043f\u0443\u043d\u043a\u0430 \u0432 \u0434\u0440\u0443\u0433\u043e\u0439.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u0440\u0438\u043c\u0435\u0440. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u0435\u0441\u0442\u044c \u0443 \u043d\u0430\u0441 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0433\u043e\u0440\u043e\u0434<\/p>\n<p>  city = CM (6, [(2,3), (1,2), (3,1), (4,3), (4,6), (5,6), (5,3)])<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/72e\/2e0\/33a\/72e2e033a9d2b97c4a6a242476a65e3c.png\"\/><\/p>\n<p>  \u0442\u043e \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <\/p>\n<pre><code class=\"haskell\">bottlenecks city 1 6<\/code><\/pre>\n<p> \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0443\u0437\u0435\u043b \u043d\u043e\u043c\u0435\u0440 3 (\u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u0443\u0437\u043b\u0430).<\/p>\n<p>  \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432\u0441\u0435\u0445 \u0441\u043e\u0441\u0435\u0434\u0435\u0439 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u0443\u0437\u043b\u0430.<\/p>\n<pre><code class=\"haskell\">neighbours :: CityMap -&gt; District -&gt; [District]<\/code><\/pre>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u043a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 Route \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432\u0441\u0435\u0433\u043e \u0438\u0437 \u0434\u0432\u0443\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u043e\u0434\u0438\u043d \u0438\u0437 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u0430\u0440\u044b (p, q) \u0438\u0441\u043a\u043e\u043c\u043e\u043c\u0443 (b) \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443. \u0415\u0441\u043b\u0438 b \u0440\u0430\u0432\u0435\u043d p, \u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c q \u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e mapMaybe.<\/p>\n<pre><code class=\"haskell\">neighbours (CM (_,rs)) b = mapMaybe neighbour rs \twhere neighbour (p,q) \t\t| b == p    = Just q \t\t| b == q    = Just p \t\t| otherwise = Nothing<\/code><\/pre>\n<p>  \u0422\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c:<\/p>\n<p>  <code>*Main Data.List&gt; neighbours city 3<\/code><br \/>  <code>[2,1,4,5]<\/code><\/p>\n<p>  \u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442! \u0422\u0435\u043f\u0435\u0440\u044c \u043a\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0441\u043e\u0441\u0435\u0434\u0435\u0439 \u043b\u044e\u0431\u043e\u0433\u043e \u0443\u0437\u043b\u0430, \u0445\u043e\u0440\u043e\u0448\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u043f\u0443\u0442\u044c \u043c\u0435\u0436\u0434\u0443 \u043b\u044e\u0431\u044b\u043c\u0438 \u0434\u0432\u0443\u043c\u044f \u0442\u043e\u0447\u043a\u0430\u043c\u0438. \u0410 \u0442\u043e\u0447\u043d\u0435\u0435 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0443\u0442\u044c, \u0430 \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043f\u0443\u0442\u0438:<\/p>\n<pre><code class=\"haskell\">paths :: CityMap -&gt; District -&gt; District -&gt; [Path]<\/code><\/pre>\n<p>  \u041d\u0430\u0434\u043e \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0448\u0430\u0433\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c \u0442\u043e\u0442 \u0443\u0437\u0435\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0443\u0436\u0435 \u043f\u043e\u0441\u0435\u0442\u0438\u043b\u0438 (\u0438\u043d\u0430\u0447\u0435 \u0431\u0443\u0434\u0435\u043c \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e \u043a\u0440\u0443\u0433\u0430\u043c\u0438 \u0445\u043e\u0434\u0438\u0442\u044c). \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u0443\u0442\u0435\u0439 \u043e\u0442 start \u043a goal:<\/p>\n<p>  1. \u0435\u0441\u043b\u0438 start == goal, \u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c [[start]]<br \/>  2. \u0435\u0441\u043b\u0438 start \u041d\u0415 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u043f\u043e\u0441\u0435\u0449\u0451\u043d\u043d\u044b\u0445 \u0443\u0437\u043b\u043e\u0432 (=visited), \u0442\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0441\u043e\u0435\u0441\u0435\u0434\u0435\u0439 (=next) \u0438\u0449\u0435\u043c \u043f\u0443\u0442\u044c \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0441\u0435\u0434\u0430 \u043a goal.<br \/>  3. \u0438\u043d\u0430\u0447\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c [] (\u0442.\u0435. \u0435\u0441\u043b\u0438 \u043c\u044b \u0443\u0436\u0435 \u043f\u043e\u0441\u0435\u0449\u0430\u043b\u0438 start)<\/p>\n<p>  \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430\u0448\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f paths \u043d\u0435 \u00ab\u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u00bb \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0448\u0430\u0433\u0435 \u043c\u0430\u0441\u0441\u0438\u0432 \u043f\u043e\u0441\u0435\u0449\u0451\u043d\u043d\u044b\u0445 \u0443\u0437\u043b\u043e\u0432. \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u043e\u0434-\u0444\u0443\u043d\u043a\u0446\u0438\u0438 paths&#8217;:<\/p>\n<pre><code class=\"haskell\">paths :: CityMap -&gt; District-&gt; District -&gt; [Pfad] paths cm start goal = paths' [] cm start goal \twhere paths' visited cm start goal \t\t| start == goal \t  = [[start]] \t\t| start `notElem` visited = [start:rest | next &lt;- neighbours cm start, \t\t\t\t\t\t\t\t\t\t\t\t  rest &lt;- paths' (start:visited) cm next goal] \t\t| otherwise \t\t  = []<\/code><\/pre>\n<p>  \u0422\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c:<\/p>\n<p>  <code>*Main Data.List&gt; paths city 1 2<\/code><br \/>  <code>[[1,2],[1,3,2]]<\/code><\/p>\n<p>  \u0418\u043c\u0435\u044f \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043f\u0443\u0442\u0438 \u043e\u0442 \u0410 \u0434\u043e \u0412, \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043d\u0430\u0439\u0442\u0438 bottleneck \u2014 \u044d\u0442\u043e \u0442\u043e\u0442 \u0443\u0437\u0435\u043b \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432\u043e \u0432\u0441\u0435\u0445 \u043f\u0443\u0442\u044f\u0445. \u041d\u0430\u0434\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0443\u0437\u043b\u044b \u0410 \u0438 \u0412 \u0442\u043e\u0436\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432\u043e \u0432\u0441\u0435\u0445 \u043f\u0443\u0442\u044f\u0445, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0445 \u043d\u0430\u0434\u043e \u0441\u0440\u0430\u0437\u0443 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0438\u0437 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0433\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u0439:<\/p>\n<pre><code class=\"haskell\">[1..n] \\\\ [start, goal] -- \u0433\u0434\u0435 n \u043a\u043e\u043b-\u0432\u043e \u0443\u0437\u043b\u043e\u0432<\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u0442\u043e \u0447\u0438\u0441\u043b\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432\u043e \u0432\u0441\u0435\u0445 paths, \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e intersect, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0434\u0430\u0451\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u0432 \u043e\u0431\u043e\u0438\u0445 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430\u0445. \u0422.\u0435. \u043d\u0430\u0434\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043a\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0443 \u0432\u0441\u0435\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0438 \u043f\u0435\u0440\u0432\u043e\u043c\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 paths, \u043f\u043e\u0442\u043e\u043c \u043e\u0442\u0432\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043a\u043e \u0432\u0442\u043e\u0440\u043e\u043c\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443, \u0438 \u0442.\u0434. \u041e\u0442\u0432\u0435\u0442 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  <code>((((([1..n] \\\\ [start, goal]) intersect paths[0]) intersect paths[1]) intersect paths[2]) intersect...)<\/code><\/p>\n<p>  \u0422\u043e\u0433\u0434\u0430, \u0444\u0443\u043d\u043a\u0446\u0438\u044e bottlenecks \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u043e\u0434\u043d\u0443 \u0441\u0442\u0440\u043e\u0447\u043a\u0443:<\/p>\n<pre><code class=\"haskell\">bottlenecks :: CityMap -&gt; District -&gt; District -&gt; [Bottleneck] bottlenecks cm@(CM (n,_)) start goal = foldl intersect ([1..n] \\\\ [start, goal]) $ (paths cm start goal)<\/code><\/pre>\n<p>  \u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u0438 Data.Maybe (\u0434\u043b\u044f mapMaybe) \u0438 Data.List (\u0434\u043b\u044f intersect).<\/p>\n<h3>\u0417\u0430\u0434\u0430\u0447\u0430 2<\/h3>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0437\u0430\u0434\u0430\u0447\u0443 \u043f\u0440\u043e <a href=\"http:\/\/ru.wikipedia.org\/wiki\/%D0%A7%D0%B8%D1%81%D0%BB%D0%BE_%D0%AD%D1%80%D0%B4%D1%91%D1%88%D0%B0\">\u0427\u0438\u0441\u043b\u043e \u042d\u0440\u0434\u0451\u0448\u0430<\/a>. \u0412\u043a\u0440\u0430\u0442\u0446\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u044e \u0447\u0442\u043e \u044d\u0442\u043e \u0442\u0430\u043a\u043e\u0435: \u0432\u0441\u0435 \u0442\u0435, \u043a\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043d\u0430\u0443\u0447\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u0441 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u043e\u043c <a href=\"http:\/\/ru.wikipedia.org\/wiki\/%D0%AD%D1%80%D0%B4%D1%91%D1%88,_%D0%9F%D0%BE%D0%BB\">\u041f\u043e\u043b\u043e\u043c \u042d\u0440\u0434\u0451\u0448\u043e\u043c<\/a> \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442 \u0447\u0438\u0441\u043b\u043e 1, \u0432\u0441\u0435 \u0442\u0435 \u043a\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043a\u0430\u043a\u0443\u044e-\u043b\u0438\u0431\u043e \u043d\u0430\u0443\u0447\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u0441 \u0441\u043e\u0430\u0432\u0442\u043e\u0440\u0430\u043c\u0438 \u041f\u043e\u043b\u0430 \u042d\u0440\u0434\u0451\u0448\u0430 (\u043d\u043e \u043d\u0435 \u0441 \u043d\u0438\u043c \u0441\u0430\u043c\u0438\u043c) \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442 \u0447\u0438\u0441\u043b\u043e 2, \u0438 \u0442.\u0434. \u0422\u043e \u0435\u0441\u0442\u044c \u0441\u043e\u0430\u0432\u0442\u043e\u0440\u044b \u043b\u044e\u0434\u0435\u0439 \u0441 \u0447\u0438\u0441\u043b\u043e\u043c \u042d\u0440\u0434\u0451\u0448\u0430, \u0440\u0430\u0432\u043d\u044b\u043c n, \u0438\u043c\u0435\u044e\u0442 \u0447\u0438\u0441\u043b\u043e \u042d\u0440\u0434\u0451\u0448\u0430 n+1. \u0417\u0430\u0434\u0430\u0447\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430 \u043d\u0430\u0439\u0442\u0438 \u044d\u0442\u043e \u0447\u0438\u0441\u043b\u043e (\u0435\u0441\u043b\u0438 \u0441\u0432\u044f\u0437\u044c \u043c\u0435\u0436\u0434\u0443 \u044d\u0442\u0438\u043c \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u043e\u043c \u0438 \u042d\u0440\u0434\u0451\u0448\u043e\u043c \u043d\u0430\u0439\u0442\u0438 \u043d\u0435 \u0443\u0434\u0430\u0451\u0442\u0441\u044f, \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0447\u0438\u0441\u043b\u043e -1). \u0418\u0442\u0430\u043a, \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u2014 \u044d\u0442\u043e \u0443\u0447\u0451\u043d\u044b\u0435 (\u0443\u0447\u0451\u043d\u044b\u0439 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0430 \u0438 \u0444\u0430\u043c\u0438\u043b\u0438\u0438), \u043e\u043d\u0438 \u0436\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u0440\u0430\u043c\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0439, \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 (\u043d\u0430\u0443\u0447\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b) \u0438 \u0438\u043c\u0435\u043d\u0430 \u0430\u0432\u0442\u043e\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0435\u0451 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043b\u0438. \u0415\u0449\u0435 \u0437\u0430\u0434\u0435\u043a\u043b\u0430\u0440\u0438\u0440\u0443\u0435\u043c \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432:<\/p>\n<pre><code class=\"haskell\">type ErdosNumber = Int data Scientist \t = Sc Initial SurName type Initial\t = Char type SurName\t = String type Author \t = Scientist newtype Database = Db [([Author],PaperTitle)] type PaperTitle  = String type Path = [Author]  db = Db [([Sc 'M' &quot;Smith&quot;,Sc 'G' &quot;Martin&quot;,Sc 'P' &quot;Erdos&quot;],&quot;Newtonian Forms of Prime Factors&quot;), \t\t([Sc 'P' &quot;Erdos&quot;,Sc 'W' &quot;Reisig&quot;],&quot;Stuttering in Petri Nets&quot;), \t\t([Sc 'M' &quot;Smith&quot;,Sc 'X' &quot;Chen&quot;],&quot;First Order Derivates in Structured Programming&quot;), \t\t([Sc 'T' &quot;Jablonski&quot;,Sc 'Z' &quot;Hsueh&quot;],&quot;Selfstabilizing Data Structures&quot;), \t\t([Sc 'X' &quot;Chen&quot;,Sc 'L' &quot;Li&quot;],&quot;Prime Numbers and Beyond&quot;)] <\/code><\/pre>\n<p>  \u041d\u0430\u0447\u043d\u0435\u043c \u043a\u0430\u043a \u0438 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0435 \u0441 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0432\u0441\u0435\u0445 \u0441\u043e\u0441\u0435\u0434\u0435\u0439 (\u0442.\u0435. \u0442\u0435\u0445, \u043a\u0442\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438 \u0441 \u044d\u0442\u0438\u043c \u0430\u0432\u0442\u043e\u0440\u043e\u043c):<\/p>\n<pre><code class=\"haskell\">neighbours :: Database -&gt; Author -&gt; [Author]<\/code><\/pre>\n<p>  \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0438, \u043a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0443 \u043d\u0430\u0441 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0434\u0432\u0443\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0442\u0438\u043f\u0430 Author, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 mapMaybe \u043d\u0435 \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c. \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 ([Author],PaperTitle) \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c, \u0432\u0445\u043e\u0434\u0438\u0442 \u043b\u0438 \u0430\u0432\u0442\u043e\u0440, \u0441\u043e\u0441\u0435\u0434\u0435\u0439 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u043d\u0430\u0439\u0442\u0438, \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 [Author], \u0435\u0441\u043b\u0438 \u0434\u0430, \u0442\u043e \u0431\u0435\u0440\u0435\u043c \u0432\u0435\u0441\u044c \u043c\u0430\u0441\u0441\u0438\u0432 [Author], \u0435\u0441\u043b\u0438 \u043d\u0435\u0442, \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445. \u0412 \u043a\u043e\u043d\u0446\u0435 \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u0431\u0440\u0430\u0442\u044c \u0438\u043c\u044f \u0430\u0432\u0442\u043e\u0440\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u0438\u0441\u043a\u0430\u043b\u0438 \u0438\u0437 \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0433\u043e\u0441\u044f \u0441\u043f\u0438\u0441\u043a\u0430 (\u043c\u044b \u0436\u0435 \u0438\u0449\u0435\u043c \u0435\u0433\u043e \u0441\u043e\u0441\u0435\u0434\u0435\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043d \u043d\u0430\u043c \u043d\u0438 \u043a \u0447\u0435\u043c\u0443):<\/p>\n<pre><code class=\"haskell\">neighbours :: Database -&gt; Author -&gt; [Author] neighbours (Db []) _ = [] neighbours (Db ((a,_):xs)) (Sc i s) = filter (\/= (Sc i s)) ((neighbour a) ++ (neighbours (Db xs) (Sc i s))) \twhere  \t\tneighbour a \t\t\t| (Sc i s) `elem` a = a \t\t\t| otherwise\t\t= []<\/code><\/pre>\n<p>  \u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u0435\u043c \u0437\u0430\u0434\u0435\u043a\u043b\u0430\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u043e, \u043a\u0430\u043a \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0438\u0445 \u0443\u0447\u0451\u043d\u044b\u0445:<\/p>\n<pre><code class=\"haskell\">instance Eq Scientist where \t(Sc i1 s1) == (Sc i2 s2) = (i1 == i2) && (s1 == s2)<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043a\u0430\u0442\u044c \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043f\u0443\u0442\u0438 \u043e\u0442 \u0430\u0432\u0442\u043e\u0440\u0430 \u00abstart\u00bb \u0434\u043e \u0443\u0447\u0451\u043d\u043e\u0433\u043e (Sc &#8216;P&#8217; \u00abErdos\u00bb). \u0424\u0443\u043d\u043a\u0446\u0438\u044f paths \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435 \u0447\u0435\u043c \u043d\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0442\u043e\u0439, \u0447\u0442\u043e \u043c\u044b \u0443\u0436\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438:<\/p>\n<pre><code class=\"haskell\">paths :: Database -&gt; Author -&gt; [Pfad] paths db start = paths' [] db start \twhere paths' visited db start \t\t| start == (Sc 'P' &quot;Erdos&quot;) = [[start]] \t\t| start `notElem` visited   = [start:rest | next &lt;- neighbours db start, \t\t\t\t\t\t\t\t\t\t\t\t\trest &lt;- paths' (start:visited) db next] \t\t| otherwise\t\t    = []<\/code><\/pre>\n<p>  \u0418\u043c\u0435\u044f \u043c\u0430\u0441\u0441\u0438\u0432 \u0432\u0441\u0435\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043f\u0443\u0442\u0435\u0439 \u043e\u0442 \u0430\u0432\u0442\u043e\u0440\u0430 \u043a \u042d\u0440\u0434\u0451\u0448\u0443, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043f\u0443\u0442\u0435\u0439 \u0432 \u0435\u0433\u043e \u0434\u043b\u0438\u043d\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 length (\u0442.\u0435. \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043c\u0430\u0441\u0441\u0438\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u043b\u0438\u043d\u044b \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043f\u0443\u0442\u0435\u0439). \u0418\u0437 \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0433\u043e\u0441\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u0432\u044b\u0431\u0435\u0440\u0435\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e (=\u043a\u0440\u0430\u0442\u0447\u0430\u0439\u0448\u0438\u0439 \u043f\u0443\u0442\u044c) \u0438 \u043e\u0442\u043d\u0438\u043c\u0435\u043c \u0435\u0434\u0438\u043d\u0438\u0446\u0443 \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430, \u0442.\u043a. \u0441\u0430\u043c \u042d\u0440\u0434\u0451\u0448 \u0438\u043c\u0435\u0435\u0442 \u0447\u0438\u0441\u043b\u043e 0. \u041d\u0435\u0437\u0430\u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u0434 \u044d\u0442\u0438\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0435\u0441\u0442\u044c \u043b\u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u043f\u0443\u0442\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0435\u0434\u0435\u0442 \u043a \u042d\u0440\u0434\u0451\u0448\u0443 (\u0435\u0441\u043b\u0438 \u043d\u0435\u0442, \u0442\u043e \u0432\u0435\u0440\u043d\u0435\u043c -1):<\/p>\n<pre><code class=\"haskell\">erdosNum :: Database -&gt; Scientist -&gt; ErdosNumber erdosNum db sc  \t| length (paths db sc) == 0 = (-1) \t| otherwise \t        = (-) (minimum (map length (paths db sc))) 1<\/code><\/pre>\n<p>  \u0423\u0441\u043f\u0435\u0445\u043e\u0432 \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438! \t\t\t \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/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=\"http:\/\/habrahabr.ru\/post\/159127\/\"> http:\/\/habrahabr.ru\/post\/159127\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t\u041f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0425\u0430\u0431\u0440\u0430\u0445\u0430\u0431\u0440!<br \/>  \u042f \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u043d\u0430\u0447\u0430\u043b \u0438\u0437\u0443\u0447\u0430\u0442\u044c Haskell, \u0438, \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0441\u0432\u043e\u0438\u0432 \u0435\u0433\u043e, \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043d\u0430\u043a\u043e\u043f\u043b\u0435\u043d\u043d\u044b\u043c \u043e\u043f\u044b\u0442\u043e\u043c. \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u0437\u043d\u0430\u043d\u0438\u044f Haskell \u0443 \u043c\u0435\u043d\u044f \u043d\u0435 \u043d\u0430 \u0442\u0430\u043a\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u043a\u0430\u043a \u0443 <a href=\"http:\/\/habrahabr.ru\/users\/darkus\/\" class=\"user_link\">Darkus<\/a>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u0432\u0435 \u0437\u0430\u0434\u0430\u0447\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u043d\u0438\u0436\u0435, \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0430 \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432, \u043d\u043e \u043e\u043f\u044b\u0442\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438 \u043f\u043e\u043f\u0440\u0430\u0432\u044f\u0442, \u0438 \u043f\u043e\u0434\u0441\u043a\u0430\u0436\u0443\u0442 \u043a\u0430\u043a \u043b\u0443\u0447\u0448\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c. \u042d\u0442\u0430 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u044f \u043f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0430 \u0425\u0430\u0431\u0440\u0430\u0445\u0430\u0431\u0440, \u043d\u043e \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u043c\u043e\u0439 \u043f\u0435\u0440\u0432\u044b\u0439 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u043a\u043e\u0433\u0434\u0430-\u043b\u0438\u0431\u043e \u043f\u0438\u0441\u0430\u043b.  <\/p>\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-159127","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/159127","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=159127"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/159127\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=159127"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=159127"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=159127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}