{"id":171425,"date":"2013-03-05T11:22:03","date_gmt":"2013-03-05T07:22:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=171425"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=171425","title":{"rendered":"<span class=\"post_title\">\u041f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0425\u0430\u0441\u043a\u0435\u043b\u044f \u043f\u043e\u0434 GHC<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \tGHC (Glasgow Haskell Compiler) \u2014 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0425\u0430\u0441\u043a\u0435\u043b\u044f. GHC \u2014 \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043a\u0440\u0443\u0442\u044b\u0445 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432 \u0432 \u043c\u0438\u0440\u0435, \u043d\u043e \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u0431\u0435\u0437 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u043b\u043e\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0439 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0438\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043f\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e\u0442 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0435, \u0442. \u0435. \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043e\u0447\u0435\u043d\u044c \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e. \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u043b\u0438 \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u044c \u0432\u0435\u0441\u044c \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430, \u0425\u0430\u0441\u043a\u0435\u043b\u044c \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043a \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u043c\u0443 \u043a\u043e\u0434\u0443 \u043d\u0430 C.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043e\u0431\u043e\u0431\u0449\u0430\u044e \u043e\u043f\u044b\u0442 \u0432\u044b\u0436\u0438\u043c\u0430\u043d\u0438\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u0430 \u0438\u0437 GHC \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/170571\/\">dataflow-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 Yarr<\/a>.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0421\u0442\u0430\u0442\u044c\u044f \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0439, \u043d\u043e, \u0434\u0443\u043c\u0430\u044e, \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u043a\u0430\u043a \u043f\u0430\u043c\u044f\u0442\u043a\u0430 \u0438\u043b\u0438 \u0441\u0442\u0430\u0440\u0442 \u0432 \u0442\u0435\u043c\u0435. \u041e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u2014 \u044d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0435, \u044f \u043d\u0435 \u0437\u043d\u0430\u044e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 GHC. \u0422\u0435\u043e\u0440\u0438\u044e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432 \u0442\u043e\u0436\u0435 \u043d\u0435 \u0437\u043d\u0430\u044e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0441\u043b\u0438 \u0434\u043b\u044f \u0447\u0435\u0433\u043e-\u0442\u043e \u0435\u0441\u0442\u044c \u043e\u0431\u0449\u0435\u043f\u0440\u0438\u043d\u044f\u0442\u044b\u0435 \u0442\u0435\u0440\u043c\u0438\u043d\u044b, \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0439\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p>\n<p>  \u0410\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0435\u0440\u0441\u0438\u044f GHC \u2014 7.6.1.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435: \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0441 GHC \u00ab\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e\u00bb \u0432\u0441\u0435 \u043d\u0435 \u0442\u0430\u043a \u043f\u043b\u043e\u0445\u043e, \u043a\u0430\u043a \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u0430\u0431\u0437\u0430\u0446\u0435, \u0445\u043e\u0442\u044f \u0431\u044b \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u043e\u043f\u0446\u0438\u0435\u0439 <code>-O2<\/code>. \u0418\u043d\u043e\u0433\u0434\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0434\u0435\u043b\u0430\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438 \u0431\u0435\u0437 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043e\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430, \u043d\u043e \u044d\u0442\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u0442 <i>\u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0442 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0437\u0432\u0435\u0437\u0434<\/i>, \u0431\u044b\u0432\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u043e\u0434\u043d\u0443 \u0431\u0443\u043a\u0432\u0443, \u0447\u0442\u043e\u0431\u044b GHC \u0432\u0434\u0440\u0443\u0433 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043b \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u043a\u0430\u043a \u0435\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c.<\/p>\n<hr\/>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c 2 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442 GHC:  <\/p>\n<ul>\n<li>\u0420\u0430\u0441\u0449\u0435\u043f\u043b\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u043d\u044b\u0435 \u043a\u0443\u0441\u043e\u0447\u043a\u0438 \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u043b\u044f \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0438\u043c\u0438 (\u0441\u043c. <a href=\"http:\/\/www.haskell.org\/ghc\/docs\/7.6.1\/html\/users_guide\/primitives.html\">Unboxed types and primitive operations<\/a>)<\/li>\n<li>\u0412\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043d\u0438\u0435 (inline) \u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439<\/li>\n<\/ul>\n<p>  \u041e\u043d\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0430, \u0442. \u0435. \u0435\u0441\u043b\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435 \u0440\u0430\u0441\u0449\u0435\u043f\u043b\u044f\u044e\u0442\u0441\u044f, \u0442\u043e \u0445\u0443\u0436\u0435 \u0438 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u043e \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0435 \u043d\u0438\u0436\u0435\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u043e\u0432\u0435\u0442\u043e\u0432, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043f\u043e\u0447\u0442\u0438 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442.<\/p>\n<h4>\u0422\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445<\/h4>\n<p>  <\/p>\n<h5>\u0418\u0437\u0431\u0435\u0433\u0430\u0439\u0442\u0435 \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430\u043c\u0438<\/h5>\n<p>  <i>\u0412 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 Maybe, Either \u0438 <b>\u0441\u043f\u0438\u0441\u043a\u043e\u0432<\/b>, \u043a\u0430\u043a\u0438\u043c\u0438 \u0431\u044b \u00ab\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c\u0438\u00bb \u043e\u043d\u0438 \u043d\u0435 \u0431\u044b\u043b\u0438.<\/i> \u041f\u0440\u0438\u0447\u0438\u043d\u0430 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u0430 \u2014 \u0442\u0430\u043a\u0438\u0435 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435\u043b\u044c\u0437\u044f \u0440\u0430\u0437\u043b\u043e\u0436\u0438\u0442\u044c \u043d\u0430 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u043a\u0430\u043a\u0430\u044f \u0443 \u043d\u0438\u0445 \u0432\u043e\u043e\u0431\u0449\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430.<\/p>\n<p>  \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u2014 \u0442\u0438\u043f\u044b-\u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430\u043c\u0438 \u0431\u0435\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432: <code>Bool<\/code>, <code>Ordering<\/code> \u0438 \u0442. \u0434.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u0434\u0443\u043c\u0430\u0442\u044c\u0441\u044f, \u0441\u043f\u0438\u0441\u043a\u0438 \u0432 \u0425\u0430\u0441\u043a\u0435\u043b\u0435 \u2014 \u0441\u0443\u0442\u044c \u043e\u0434\u043d\u043e\u0441\u0432\u044f\u0437\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u0438\u043c\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u0430\u0445 \u0438\u0437-\u0437\u0430 \u0441\u0432\u043e\u0435\u0439 \u043c\u0435\u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u0422\u0430\u043a \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u0438 \u0432 \u0425\u0430\u0441\u043a\u0435\u043b\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u043e \u043d\u0438\u0445 <a href=\"http:\/\/hackage.haskell.org\/package\/vector\">\u0432\u0435\u043a\u0442\u043e\u0440\u0430<\/a> (\u0432\u043c\u0435\u0441\u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0441\u0442\u0440\u043e\u043a \u2014 <a href=\"http:\/\/hackage.haskell.org\/package\/bytestring\">ByteString<\/a>), \u0435\u0434\u0432\u0430 \u043b\u0438 \u0443\u0441\u0442\u0443\u043f\u0430\u044e\u0449\u0438\u0435 \u0441\u043f\u0438\u0441\u043a\u0430\u043c \u043f\u043e \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0443 \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c. \u0414\u043b\u044f \u0437\u0430\u043c\u0435\u043d\u044b \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0445 \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0435\u0449\u0435 \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u0434\u043e\u0439\u0434\u0443\u0442 <a href=\"http:\/\/hackage.haskell.org\/package\/fixed-vector\">\u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b<\/a>.<\/p>\n<p>  \u0421\u043c. \u0442\u0430\u043a\u0436\u0435: <a href=\"http:\/\/www.haskell.org\/haskellwiki\/Performance\/Data_types\">HaskellWiki \u2014 Performance\/Data types<\/a>.<\/p>\n<h5>\u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0439\u0442\u0435 \u043f\u043e\u043b\u044f \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u0445 \u0441\u0442\u0440\u043e\u0433\u0438\u043c\u0438, \u0435\u0441\u043b\u0438 \u0442\u043e\u0447\u043d\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u0442\u0435, \u043f\u043e\u0447\u0435\u043c\u0443 \u043e\u043d\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043b\u0435\u043d\u0438\u0432\u044b\u043c\u0438<\/h5>\n<p>  \u041e\u0431\u044b\u0447\u043d\u043e\u0435, \u043b\u0435\u043d\u0438\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 \u2014 \u044d\u0442\u043e \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0437\u0430\u043c\u044b\u043a\u0430\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0435\u0440\u043d\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044f. \u0421\u0442\u0440\u043e\u0433\u043e\u0435 \u043f\u043e\u043b\u0435 \u2014 \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044f. \u0412\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0435 (unboxed) \u043f\u043e\u043b\u0435 \u2014 \u0441\u0430\u043c\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 (\u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u0442\u043e\u0436\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430, \u0442\u043e \u043e\u043d\u0430 \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0443\u044e). \u0412\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0435 \u043f\u043e\u043b\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043a \u0441\u0442\u0440\u043e\u0433\u043e\u043c\u0443 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b <code>{-# UNPACK #-}<\/code>.<\/p>\n<p>  \u0411\u0435\u0437 1-\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430, \u043a\u0430\u043a \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u0430\u043c\u0438, \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0432\u043f\u043e\u043b\u043d\u0435 \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0436\u0438\u0432\u0435\u0442\u0441\u044f. \u0412 \u043a\u0430\u0436\u0434\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u043e\u0441\u043e\u0437\u043d\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0431\u043e\u0440 \u0432 \u043f\u043e\u043b\u044c\u0437\u0443 2 \u0438\u043b\u0438 3 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430. \u041f\u043e\u043b\u044f \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 \u0438\u043d\u043e\u0433\u0434\u0430 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0435 \u043f\u043e \u043f\u0430\u043c\u044f\u0442\u0438, \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440, \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430\u0445 \u043d\u0430 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e. \u0412\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043f\u0440\u0438 \u0447\u0442\u0435\u043d\u0438\u0438. \u0415\u0441\u043b\u0438 \u0447\u0430\u0449\u0435 \u043d\u0443\u0436\u043d\u044b \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044f (\u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e), \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0439\u0442\u0435 \u0441 \u0444\u043b\u0430\u0433\u043e\u043c <code>-funbox-strict-fields<\/code> \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0439\u0442\u0435 \u043a \u00ab\u0441\u0441\u044b\u043b\u043e\u0447\u043d\u044b\u043c\u00bb \u043f\u043e\u043b\u044f\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0443 <code>{-# NOUNPACK #-}<\/code>.<\/p>\n<p>  \u0421\u043c. \u0442\u0430\u043a\u0436\u0435: <a href=\"https:\/\/github.com\/tibbe\/haskell-style-guide\/blob\/master\/haskell-style.md#dealing-with-laziness\">Haskell Style Guide\/Dealing with laziness<\/a>.<\/p>\n<h5>\u042f\u0432\u043d\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0439\u0442\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043f\u0435\u0440\u0435\u0434 \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u044b\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c<\/h5>\n<p>  \u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 <code>t<\/code> \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u0430:  <\/p>\n<pre><code class=\"haskell\">import Data.Vector as V ... data T = T !Int !Int fSum (T x y) = x + y ...     -- t :: T     V.map (+ (fSum t)) longVectorOfInts <\/code><\/pre>\n<p>  GHC \u043d\u0435 \u0432\u044b\u043d\u043e\u0441\u0438\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0438\u0437 \u00ab\u0446\u0438\u043a\u043b\u0430\u00bb:  <\/p>\n<pre><code class=\"haskell\">-- \u041a\u0430\u043a \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e GHC \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u0441\u0442\u0440\u043e\u0447\u043a\u0443 V.map (\\x -&gt; case t of (T y z) -&gt; x + y + z) longVectorOfInts <\/code><\/pre>\n<p>  \u0412 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 \u0438 \u0447\u0442\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u0438\u0445 \u0438 \u0442\u0435\u0445 \u0436\u0435 \u043f\u043e\u043b\u0435\u0439.<\/p>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u043b\u0438 \u00ab\u043f\u043e\u0434\u0441\u043a\u0430\u0437\u0430\u0442\u044c\u00bb \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443 \u0441\u043d\u0430\u0440\u0443\u0436\u0438 \u0446\u0438\u043a\u043b\u0430, \u043e\u043d \u043d\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f, \u0443\u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u0433\u0434\u0435-\u0442\u043e \u0432\u044b\u0448\u0435 \u043f\u043e \u0410\u0421\u0414 (\u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e\u043c\u0443 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u0434\u0435\u0440\u0435\u0432\u0443):  <\/p>\n<pre><code class=\"haskell\">case t of (T x y) -&gt; V.map (+ (fSum t)) longVectorOfInts -- GHC \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e: case t of (T x y) -&gt; let s = x + y in V.map (\\x -&gt; x + s) longVectorOfInts <\/code><\/pre>\n<p>  \u0412\u043c\u0435\u0441\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u0435\u0439\u0441\u043e\u0432 \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u044b\u0439 control flow \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 <a href=\"http:\/\/hackage.haskell.org\/package\/deepseq\">deepseq<\/a>.<\/p>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u0430\u0447\u043d\u044b\u0439, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 <code>t<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c <code>fSum t<\/code> \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e, \u043d\u043e \u0434\u0443\u043c\u0430\u044e \u0441\u0443\u0442\u044c \u043f\u0440\u0438\u0435\u043c\u0430 \u044f\u0441\u043d\u0430.<\/p>\n<h4>\u0424\u0443\u043d\u043a\u0446\u0438\u0438<\/h4>\n<p>  <b>\u041f\u0440\u0430\u0432\u0438\u043b\u043e \u21161:<\/b> \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0439\u0442\u0435 \u043a\u043e <i>\u0432\u0441\u0435\u043c<\/i> \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u043c, \u0447\u0430\u0441\u0442\u043e (\u043d\u0430 \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0435) \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u043c, \u0436\u0438\u0432\u0443\u0449\u0438\u043c \u0434\u0430\u043b\u0435\u043a\u043e \u043e\u0442 \u043a\u043e\u0440\u043d\u044f \u0410\u0421\u0414 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0443 <code>INLINE<\/code>. \u0415\u0441\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0435 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e\u0442\u0441\u044f, \u0441\u043e\u0432\u0435\u0442\u044b \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0430 \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u0432\u0440\u0435\u0434\u043d\u044b\u043c\u0438.<\/p>\n<h5>\u0411\u043e\u043b\u044c\u0448\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043b\u044f\u043c\u0431\u0434, \u043a\u0430\u0440\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f!<\/h5>\n<p>  \u0418\u043b\u0438, \u0433\u043e\u0432\u043e\u0440\u044f \u043f\u043e-\u0443\u043c\u043d\u043e\u043c\u0443, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0439\u0442\u0435 <a href=\"https:\/\/www.google.com\/search?hl=en&amp;q=haskell+continuation+passing+style+performance\">continuation passing style<\/a>.<\/p>\n<p>  \u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u043c\u044b\u043a\u0430\u043d\u0438\u0439 \u043f\u0435\u0440\u0435\u0434 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e GHC \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u0435\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d \u043d\u0430 \u0438\u0445 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0438 \u0440\u0435\u0434\u0443\u043a\u0446\u0438\u044e.<\/p>\n<p>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435 Yarr \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0446\u0435\u043b\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0432\u043c\u0435\u0441\u0442\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440. \u041d\u0430 \u0441\u0445\u0435\u043c\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0430 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044f <i>\u0442\u0438\u043f\u043e\u0432<\/i> \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0441\u0442\u0440\u0435\u043b\u043a\u0430 \u00abA \u2192 B\u00bb \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u00abB \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u044b\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u0438\u0437 A\u00bb, \u0431\u043e\u0440\u0434\u043e\u0432\u044b\u043c \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u044b \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0442\u043e\u0436\u0435 \u044f\u0432\u043b\u044f\u044e\u0449\u0438\u0435\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/07d\/c40\/039\/07dc40039da60d374e23059aedefa595.png\"\/><\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0430, \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u0440\u0430\u0437\u0431\u0435\u0439\u0442\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043b\u044f\u043c\u0431\u0434\u043e\u0439:  <\/p>\n<pre><code class=\"haskell\">f :: A -&gt; B -&gt; C {-# INLINE f #-} f a b =     ... -- body   where ... -- declarations  --&gt;  f a \\b -&gt;     let ... -- declarations     in ... -- body <\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u0442\u0440\u044e\u043a \u043e\u043f\u0438\u0441\u0430\u043d \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 <a href=\"http:\/\/www.haskell.org\/ghc\/docs\/7.6.1\/html\/users_guide\/pragmas.html#inline-pragma\">INLINE paragma<\/a> \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043f\u043e GHC.<\/p>\n<h5>\u0411\u0443\u0434\u044c\u0442\u0435 \u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u044b \u0441 \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u044b\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438<\/h5>\n<p>  \u0412\u044b\u0437\u043e\u0432 \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (\u0430-\u043b\u044f \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u043f\u043e\u043b\u0438\u043c\u043e\u0440\u0444\u0438\u0437\u043c \u0432 \u0438\u043c\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u0430\u0445) \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u0438\u043d\u043b\u0430\u0439\u043d\u0435\u043d \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0430\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0432 \u043c\u0435\u0441\u0442\u0435 \u0432\u044b\u0437\u043e\u0432\u0430. \u0415\u0441\u043b\u0438 GHC \u0442\u043e\u0447\u043d\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d \u0442\u0438\u043f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u0438 \u0441\u0430\u043c\u0430 \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0441\u043d\u0430\u0431\u0436\u0435\u043d\u0430 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u043e\u0439 <code>INLINE<\/code>, \u0442\u043e \u043e\u043d \u043e\u0431\u044b\u0447\u043d\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e. \u041f\u0440\u0438 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0438 \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0440\u043e\u0432\u043d\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u2014 \u043d\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442.<\/p>\n<h5>\u041f\u043e\u0434\u043d\u0438\u043c\u0430\u0439\u0442\u0435 \u043d\u0430 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0442\u0438\u043f\u043e\u0432 \u0432\u0441\u0435, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e<\/h5>\n<p>  \u0415\u0441\u043b\u0438 \u0441\u0442\u043e\u0438\u0442 \u0446\u0435\u043b\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u043b\u0443\u0447\u0448\u0435 \u0435\u0435 \u043f\u043e\u0434\u043e\u043b\u044c\u0448\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0447\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0442\u044c. \u0412 \u0425\u0430\u0441\u043a\u0435\u043b\u0435 \u0435\u0441\u0442\u044c <a href=\"http:\/\/www.haskell.org\/haskellwiki\/Category:Type-level_programming\">\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u0432 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u043d\u0430 \u044d\u0442\u0430\u043f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<\/a>.<\/p>\n<p>  \u0412 Yarr \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u043c\u0430\u0440\u043a\u0435\u0440\u043d\u044b\u0435 <a href=\"http:\/\/www.haskell.org\/haskellwiki\/GHC\/Indexed_types\">\u0442\u0438\u043f\u044b-\u0438\u043d\u0434\u0435\u043a\u0441\u044b<\/a> \u0434\u043b\u044f <a href=\"http:\/\/habrahabr.ru\/post\/170571\/#static-double-dispatch\">\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0434\u0432\u043e\u0439\u043d\u043e\u0439 \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0438<\/a>, <a href=\"http:\/\/www.haskell.org\/haskellwiki\/Type_arithmetic\">\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u0443<\/a> (\u0433\u043e\u0442\u043e\u0432\u0430\u044f \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u0430 \u0438 \u043b\u043e\u0433\u0438\u043a\u0430 \u0435\u0441\u0442\u044c \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 <a href=\"http:\/\/hackage.haskell.org\/package\/type-level\">type-level<\/a>) \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u0432\u0435\u0449\u0438.<\/p>\n<h4>\u0424\u043b\u0430\u0433\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<\/h4>\n<p>  <code>-O2<\/code> \u2014 \u0432\u0441\u0435\u0433\u0434\u0430.<\/p>\n<p>  \u041e <code>-funbox-strict-fields<\/code> \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432\u044b\u0448\u0435.<\/p>\n<p>  \u0421\u0435\u0439\u0447\u0430\u0441 \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0440\u0435\u0434\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0431\u0435\u043a\u0435\u043d\u0434 LLVM: <code>-fllvm -optlo-O3<\/code>.<\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b GHC \u043d\u0435 \u0437\u0430\u043d\u0438\u043c\u0430\u043b\u0441\u044f \u0433\u0430\u0434\u0430\u043d\u0438\u0435\u043c \u043d\u0430 \u043a\u043e\u0444\u0435\u0439\u043d\u043e\u0439 \u0433\u0443\u0449\u0435 \u0438 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043b \u0432\u0441\u0435, \u0447\u0442\u043e \u0441\u043a\u0430\u0436\u0443\u0442, Ben Lippmeier <a href=\"http:\/\/hackage.haskell.org\/packages\/archive\/repa\/3.2.3.1\/doc\/html\/Data-Array-Repa.html\">\u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442<\/a> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u043b\u0430\u0433\u0438 <code>-funfolding-use-threshold1000 -funfolding-keeness-factor1000<\/code>.    \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\/171425\/\"> http:\/\/habrahabr.ru\/post\/171425\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \tGHC (Glasgow Haskell Compiler) \u2014 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0425\u0430\u0441\u043a\u0435\u043b\u044f. GHC \u2014 \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043a\u0440\u0443\u0442\u044b\u0445 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432 \u0432 \u043c\u0438\u0440\u0435, \u043d\u043e \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u0431\u0435\u0437 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u043b\u043e\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0439 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0438\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043f\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e\u0442 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0435, \u0442. \u0435. \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043e\u0447\u0435\u043d\u044c \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e. \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u043b\u0438 \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u044c \u0432\u0435\u0441\u044c \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430, \u0425\u0430\u0441\u043a\u0435\u043b\u044c \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043a \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u043c\u0443 \u043a\u043e\u0434\u0443 \u043d\u0430 C.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043e\u0431\u043e\u0431\u0449\u0430\u044e \u043e\u043f\u044b\u0442 \u0432\u044b\u0436\u0438\u043c\u0430\u043d\u0438\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u0430 \u0438\u0437 GHC \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/170571\/\">dataflow-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 Yarr<\/a>.  <\/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-171425","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/171425","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=171425"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/171425\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=171425"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=171425"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=171425"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}