{"id":263554,"date":"2015-08-14T10:35:02","date_gmt":"2015-08-14T06:35:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=263554"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=263554","title":{"rendered":"\u0420\u0430\u0437\u0433\u043e\u0432\u043e\u0440 \u0441\u043e \u0441\u043f\u0438\u043a\u0435\u0440\u0430\u043c\u0438 FPConf (\u0447\u0430\u0441\u0442\u044c 2)"},"content":{"rendered":"<p>     \t\u041f\u0440\u0438\u0432\u0435\u0442!<\/p>\n<p>  \u041a\u043e\u043d\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u044f <a href=\"http:\/\/fpconf.ru\/\">FPConf<\/a> \u0443\u0436\u0435 \u0437\u0430\u0432\u0442\u0440\u0430, \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0448\u0430\u043d\u0441 \u043a\u0443\u043f\u0438\u0442\u044c \u0431\u0438\u043b\u0435\u0442 \u0438 \u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u044c\u0441\u044f! \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u2014 <a href=\"http:\/\/fpconf.ru\/\">\u0442\u0443\u0442<\/a>.<\/p>\n<p>  \u041d\u0430\u043a\u0430\u043d\u0443\u043d\u0435 \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u0437\u0430\u0434\u0430\u0442\u044c \u043d\u0430\u0448\u0438\u043c \u0441\u043f\u0438\u043a\u0435\u0440\u0430\u043c \u043e\u0434\u0438\u043d \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043d\u0435\u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441. \u0411\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u0431\u044b\u043b\u0430 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u0430 \u0432\u0447\u0435\u0440\u0430 \u2014 <a href=\"http:\/\/habrahabr.ru\/company\/railsclub\/blog\/264695\/\">\u0442\u0443\u0442<\/a><\/p>\n<p>  \u0410 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043e\u0442\u0432\u0435\u0442 \u043e\u0442 \u043d\u0430\u0448\u0435\u0433\u043e \u0433\u043e\u0441\u0442\u044f \u042d\u0434\u0432\u0430\u0440\u0434\u0430 \u041a\u043c\u0435\u0442\u0442\u0430. \u041f\u043e\u043a\u0430 \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u043c \u0431\u0435\u0437 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430, \u043e\u0431\u043d\u043e\u0432\u0438\u043c \u043f\u043e\u0441\u0442 \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u043d\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0438.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/b9b\/b0f\/0ff\/b9bb0f0ffe8c47b637a470dd809b267e.jpg\" alt=\"image\"\/><\/p>\n<p>  \u0412\u043e\u043f\u0440\u043e\u0441 \u0431\u044b\u043b \u0442\u0430\u043a\u043e\u0439:<\/p>\n<p>  <i>\u0412 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u0430\u0445 \u0435\u0441\u0442\u044c \u0448\u0438\u0440\u043e\u043a\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f (design patterns) \u043e\u0442 \u00ab\u0411\u0430\u043d\u0434\u044b \u0447\u0435\u0442\u044b\u0440\u0435\u0445\u00bb (Gang of Four). \u0412 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u0430\u0445 \u0442\u0430\u043a\u043e\u0433\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442. \u0421 \u0432\u0430\u0448\u0435\u0439 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f, \u043f\u043e\u0447\u0435\u043c\u0443 \u0442\u0430\u043a?<br \/>  \u041f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u043d\u0435 \u043d\u0443\u0436\u043d\u044b \u043f\u0440\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u0430\u0445 \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0445 \u043a\u0430\u043d\u043e\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0435\u0449\u0435 \u043d\u0435 \u0441\u043b\u043e\u0436\u0438\u043b\u0441\u044f?<\/i><\/p>\n<p>  <a name=\"habracut\"><\/a><\/p>\n<p>  <b>\u042d\u0434\u0432\u0430\u0440\u0434 \u041a\u043c\u0435\u0442\u0442<\/b>, \u0413\u043b\u0430\u0432\u0430 Haskell core libraries committee, Haskell \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442, \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a.<\/p>\n<p>  Design patterns give you a vocabulary for how to talk about things that your language isn&#8217;t able to let you craft into a library. We use the term \u00abdesign pattern\u00bb to talk about iterators, visitors, singletons, command patterns, etc. Each of which conveys the \u00abgeneral idea\u00bb of what is going on but doesn&#8217;t actually give you the details of how to use the particular instantiation. You still have to care a great deal about the instances of the abstraction, and can do nothing based on symbol pushing with laws alone. Functional programmers are much much happier with symbol pushing than imperative programmers. That is a lot easier in a functional setting, where you don&#8217;t have to go off and reason with Hoare logic or separation logic to figure out the state of the universe after each instruction like you do in an imperative setting.<\/p>\n<p>  We do have \u00abdesign patterns\u00bb after a fashion in the functional programming world. The notion of monad \u00abtransformers\u00bb, of effect systems, of encoding things in a &#8216;finally tagless&#8217; manner, or initial encodings of syntax trees, of using &#8216;data types a la carte&#8217;, building interpreters for embedded DSLs, or \u00abclassy lenses\u00bb all have that same sort of design pattern feel to them. Data.Vector replicates the same list-like API a half dozen times. These all rise at least to the level functional programming idioms. The major difference in culture I think is that for the most part we like even these patterns or abstractions to carry with them some laws, while design patterns merely carry cultural guidelines.<\/p>\n<p>  In practice I personally like to pursue constructions that are somehow universal or free or something that is initial or terminal in a category theoretic sense. Why? Because if I can produce such a solution any other solution in the space should factor through mine.<\/p>\n<p>  But I think ultimately a design pattern in most settings is an attempt to go a bit beyond the notion of the idioms of a language, but not quite into the realm of laws, and that middle ground isn&#8217;t something we tend to like too much as functional programmers. After all, an abstraction you can&#8217;t reason about isn&#8217;t an abstraction at all.<\/p>\n<p>  \u0410 \u0447\u0442\u043e \u0432\u044b \u0434\u0443\u043c\u0430\u0435\u0442\u0435 \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0432\u043e\u0434\u0443?<br \/>  \u041e\u0431\u0441\u0443\u0434\u0438\u043c \u043d\u0430 <a href=\"http:\/\/fpconf.ru\/\">FPConf.ru<\/a>. \u041f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0439\u0442\u0435\u0441\u044c!     \t<\/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=\"http:\/\/habrahabr.ru\/post\/264737\/\"> http:\/\/habrahabr.ru\/post\/264737\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>     \t\u041f\u0440\u0438\u0432\u0435\u0442!<\/p>\n<p>  \u041a\u043e\u043d\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u044f <a href=\"http:\/\/fpconf.ru\/\">FPConf<\/a> \u0443\u0436\u0435 \u0437\u0430\u0432\u0442\u0440\u0430, \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0448\u0430\u043d\u0441 \u043a\u0443\u043f\u0438\u0442\u044c \u0431\u0438\u043b\u0435\u0442 \u0438 \u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u044c\u0441\u044f! \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u2014 <a href=\"http:\/\/fpconf.ru\/\">\u0442\u0443\u0442<\/a>.<\/p>\n<p>  \u041d\u0430\u043a\u0430\u043d\u0443\u043d\u0435 \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u0437\u0430\u0434\u0430\u0442\u044c \u043d\u0430\u0448\u0438\u043c \u0441\u043f\u0438\u043a\u0435\u0440\u0430\u043c \u043e\u0434\u0438\u043d \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043d\u0435\u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441. \u0411\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u0431\u044b\u043b\u0430 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u0430 \u0432\u0447\u0435\u0440\u0430 \u2014 <a href=\"http:\/\/habrahabr.ru\/company\/railsclub\/blog\/264695\/\">\u0442\u0443\u0442<\/a><\/p>\n<p>  \u0410 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043e\u0442\u0432\u0435\u0442 \u043e\u0442 \u043d\u0430\u0448\u0435\u0433\u043e \u0433\u043e\u0441\u0442\u044f \u042d\u0434\u0432\u0430\u0440\u0434\u0430 \u041a\u043c\u0435\u0442\u0442\u0430. \u041f\u043e\u043a\u0430 \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u043c \u0431\u0435\u0437 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430, \u043e\u0431\u043d\u043e\u0432\u0438\u043c \u043f\u043e\u0441\u0442 \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u043d\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0438.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/b9b\/b0f\/0ff\/b9bb0f0ffe8c47b637a470dd809b267e.jpg\" alt=\"image\"\/><\/p>\n<p>  \u0412\u043e\u043f\u0440\u043e\u0441 \u0431\u044b\u043b \u0442\u0430\u043a\u043e\u0439:<\/p>\n<p>  <i>\u0412 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u0430\u0445 \u0435\u0441\u0442\u044c \u0448\u0438\u0440\u043e\u043a\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f (design patterns) \u043e\u0442 \u00ab\u0411\u0430\u043d\u0434\u044b \u0447\u0435\u0442\u044b\u0440\u0435\u0445\u00bb (Gang of Four). \u0412 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u0430\u0445 \u0442\u0430\u043a\u043e\u0433\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442. \u0421 \u0432\u0430\u0448\u0435\u0439 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f, \u043f\u043e\u0447\u0435\u043c\u0443 \u0442\u0430\u043a?<br \/>  \u041f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u043d\u0435 \u043d\u0443\u0436\u043d\u044b \u043f\u0440\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u0430\u0445 \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0445 \u043a\u0430\u043d\u043e\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0435\u0449\u0435 \u043d\u0435 \u0441\u043b\u043e\u0436\u0438\u043b\u0441\u044f?<\/i><\/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-263554","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/263554","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=263554"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/263554\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=263554"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=263554"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=263554"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}