<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Recently I found <a href="http://hackage.haskell.org/package/store">http://hackage.haskell.org/package/store</a> which I missed during my previous investigation. It based on same principles and runs at same speed as my prototype. And it ready-to-use. It seems I just reinvented what was done before by FP Complete :)</div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">ср, 20 мар. 2019 г. в 00:58, Станислав Черничкин <<a href="mailto:schernichkin@gmail.com">schernichkin@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail-m_1394277285197008020gmail-OutlineElement gmail-m_1394277285197008020gmail-Ltr gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;overflow:visible;clear:both;direction:ltr;color:rgb(0,0,0);font-family:"Segoe UI","Segoe UI Web",Arial,Verdana,sans-serif;font-size:12px"><p class="gmail-m_1394277285197008020gmail-Paragraph gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="RU-RU" style="margin:0px;padding:0px;vertical-align:baseline;background-color:transparent;color:windowtext"><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">I was investigating Haskell’s binary serialization libraries and has found that lot of them (binary, cereal and </span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">protocol-buffers</span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">) has pretty similar design. They capable to consume lazy </span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-SpellingError gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-repeat:repeat-x;background-position:0% 100%;background-image:url("");border-bottom:1px solid transparent;background-color:inherit">bytestrings</span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit"> and </span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">either </span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">produce result, report error or produce partial result, indicating that more input data required. Such design leads to </span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">quite complex readers, and often ends up with producing closures in runtime. If you take a close look at binary’s </span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-SpellingError gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-repeat:repeat-x;background-position:0% 100%;background-image:url("");border-bottom:1px solid transparent;background-color:inherit">microbenches</span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit"> (</span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">binary</span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit"> in general bit faster than cereal, so I focused on binary) you will discover, that it triggers GC </span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">even </span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">during simple tasks, such as reading a bunch of Word64 and summing results. And it relatively slow. Binary’s performance limited to hundreds of megabytes per second even in simple scenarios, but actual memory bandwidth should allow us process gigabytes per second. So, I decided to try a different approach. </span></span><span class="gmail-m_1394277285197008020gmail-EOP gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;font-size:11pt;line-height:19.425px;font-family:Calibri,Calibri_MSFontService,sans-serif"> </span></p></div><div class="gmail-m_1394277285197008020gmail-OutlineElement gmail-m_1394277285197008020gmail-Ltr gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;overflow:visible;clear:both;direction:ltr;color:rgb(0,0,0);font-family:"Segoe UI","Segoe UI Web",Arial,Verdana,sans-serif;font-size:12px"><p class="gmail-m_1394277285197008020gmail-Paragraph gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="RU-RU" style="margin:0px;padding:0px;vertical-align:baseline;background-color:transparent;color:windowtext"><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit"></span></span><span class="gmail-m_1394277285197008020gmail-EOP gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;font-size:11pt;line-height:19.425px;font-family:Calibri,Calibri_MSFontService,sans-serif"> </span></p></div><div class="gmail-m_1394277285197008020gmail-OutlineElement gmail-m_1394277285197008020gmail-Ltr gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;overflow:visible;clear:both;direction:ltr;color:rgb(0,0,0);font-family:"Segoe UI","Segoe UI Web",Arial,Verdana,sans-serif;font-size:12px"><p class="gmail-m_1394277285197008020gmail-Paragraph gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="RU-RU" style="margin:0px;padding:0px;vertical-align:baseline;background-color:transparent;color:windowtext"><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">My approach is based on two assumptions so if it does not suit your case it </span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-FindHit gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:rgb(255,238,128)">obliviously</span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit"> </span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">will not work for you. </span></span><span class="gmail-m_1394277285197008020gmail-EOP gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;font-size:11pt;line-height:19.425px;font-family:Calibri,Calibri_MSFontService,sans-serif"> </span></p></div><div class="gmail-m_1394277285197008020gmail-OutlineElement gmail-m_1394277285197008020gmail-Ltr gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;overflow:visible;clear:both;direction:ltr;color:rgb(0,0,0);font-family:"Segoe UI","Segoe UI Web",Arial,Verdana,sans-serif;font-size:12px"><p class="gmail-m_1394277285197008020gmail-Paragraph gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="RU-RU" style="margin:0px;padding:0px;vertical-align:baseline;background-color:transparent;color:windowtext"><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit"></span></span><span class="gmail-m_1394277285197008020gmail-EOP gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;font-size:11pt;line-height:19.425px;font-family:Calibri,Calibri_MSFontService,sans-serif"> </span></p></div><div class="gmail-m_1394277285197008020gmail-OutlineElement gmail-m_1394277285197008020gmail-Ltr gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;overflow:visible;clear:both;direction:ltr;color:rgb(0,0,0);font-family:"Segoe UI","Segoe UI Web",Arial,Verdana,sans-serif;font-size:12px"><p class="gmail-m_1394277285197008020gmail-Paragraph gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="RU-RU" style="margin:0px;padding:0px;vertical-align:baseline;background-color:transparent;color:windowtext"><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">First – when dealing with binary data we always know exactly how many bytes we want to read. This happens because we either read a fixed size primitive type or length-prefixed variable size data (possibly not “prefixed”, but you always know expected message length from somewhere).</span></span><span class="gmail-m_1394277285197008020gmail-EOP gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;font-size:11pt;line-height:19.425px;font-family:Calibri,Calibri_MSFontService,sans-serif"> </span></p></div><div class="gmail-m_1394277285197008020gmail-OutlineElement gmail-m_1394277285197008020gmail-Ltr gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;overflow:visible;clear:both;direction:ltr;color:rgb(0,0,0);font-family:"Segoe UI","Segoe UI Web",Arial,Verdana,sans-serif;font-size:12px"><p class="gmail-m_1394277285197008020gmail-Paragraph gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="RU-RU" style="margin:0px;padding:0px;vertical-align:baseline;background-color:transparent;color:windowtext"><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit"></span></span><span class="gmail-m_1394277285197008020gmail-EOP gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;font-size:11pt;line-height:19.425px;font-family:Calibri,Calibri_MSFontService,sans-serif"> </span></p></div><div class="gmail-m_1394277285197008020gmail-OutlineElement gmail-m_1394277285197008020gmail-Ltr gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;overflow:visible;clear:both;direction:ltr;color:rgb(0,0,0);font-family:"Segoe UI","Segoe UI Web",Arial,Verdana,sans-serif;font-size:12px"><p class="gmail-m_1394277285197008020gmail-Paragraph gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="RU-RU" style="margin:0px;padding:0px;vertical-align:baseline;background-color:transparent;color:windowtext"><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">Second – </span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">chunks of data are continuous. I.e. we working with strict </span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-SpellingError gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-repeat:repeat-x;background-position:0% 100%;background-image:url("");border-bottom:1px solid transparent;background-color:inherit">bytestrings</span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit"> more often. Even when you processing chunked stream of data with unknown number of messages (such as </span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">Mesos </span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-SpellingError gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-repeat:repeat-x;background-position:0% 100%;background-image:url("");border-bottom:1px solid transparent;background-color:inherit">RecordIO</span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit"> Format</span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">) you should always be able to allocate </span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">continuous</span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit"> memory buffer for a single entity you want to deserialize.</span></span><span class="gmail-m_1394277285197008020gmail-EOP gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;font-size:11pt;line-height:19.425px;font-family:Calibri,Calibri_MSFontService,sans-serif"> </span></p></div><div class="gmail-m_1394277285197008020gmail-OutlineElement gmail-m_1394277285197008020gmail-Ltr gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;overflow:visible;clear:both;direction:ltr;color:rgb(0,0,0);font-family:"Segoe UI","Segoe UI Web",Arial,Verdana,sans-serif;font-size:12px"><p class="gmail-m_1394277285197008020gmail-Paragraph gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="RU-RU" style="margin:0px;padding:0px;vertical-align:baseline;background-color:transparent;color:windowtext"><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit"></span></span><span class="gmail-m_1394277285197008020gmail-EOP gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;font-size:11pt;line-height:19.425px;font-family:Calibri,Calibri_MSFontService,sans-serif"> </span></p></div><div class="gmail-m_1394277285197008020gmail-OutlineElement gmail-m_1394277285197008020gmail-Ltr gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;overflow:visible;clear:both;direction:ltr;color:rgb(0,0,0);font-family:"Segoe UI","Segoe UI Web",Arial,Verdana,sans-serif;font-size:12px"><p class="gmail-m_1394277285197008020gmail-Paragraph gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="RU-RU" style="margin:0px;padding:0px;vertical-align:baseline;background-color:transparent;color:windowtext"><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">If it’s ok for you lets go on. First thing I’ve created was so called static reader. Static – because reader knows how mush bytes it wants to consume at compile time. Such readers suitable for reading combinations of primitive values. Here the implementation </span></span><a class="gmail-m_1394277285197008020gmail-Hyperlink gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" href="https://github.com/PROTEINE-INSAIDERS/lev-tolstoy/blob/master/src/Lev/Reader/Static.hs" rel="noreferrer" style="margin:0px;padding:0px;text-decoration-line:none;color:inherit" target="_blank"><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-Underlined gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;color:rgb(5,99,193);text-decoration-line:underline;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">https://github.com/PROTEINE-INSAIDERS/lev-tolstoy/blob/master/src/Lev/Reader/Static.hs</span></span></a><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit"> Static reader is somewhat monadic (you can use do-syntax with </span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;color:rgb(36,41,46);font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-SpellingError gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-repeat:repeat-x;background-position:0% 100%;background-image:url("");border-bottom:1px solid transparent;background-color:inherit">RebindableSyntax</span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;color:rgb(36,41,46);font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit"> extension like here </span></span><a class="gmail-m_1394277285197008020gmail-Hyperlink gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" href="https://github.com/PROTEINE-INSAIDERS/lev-tolstoy/blob/master/bench/Bench/Lev/Reader/Static.hs" rel="noreferrer" style="margin:0px;padding:0px;text-decoration-line:none;color:inherit" target="_blank"><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-Underlined gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;color:rgb(5,99,193);text-decoration-line:underline;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">https://github.com/PROTEINE-INSAIDERS/lev-tolstoy/blob/master/bench/Bench/Lev/Reader/Static.hs</span></span></a><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit"> ) but it actually indexed monad and it unfortunately incompatible with traditional monads. Off</span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">sets</span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit"> and si</span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">zes are </span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-ContextualSpellingAndGrammarError gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-repeat:repeat-x;background-position:0% 100%;background-image:url("");border-bottom:1px solid transparent;background-color:inherit">calculates</span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit"> at type level during the compile time and according to </span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-SpellingError gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-repeat:repeat-x;background-position:0% 100%;background-image:url("");border-bottom:1px solid transparent;background-color:inherit">microbences</span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit"> s</span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">tatic reader</span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit"> does not introduced any overhead compared to hand-written reader using the low-level indexInt64OffAddr# function (</span></span><a class="gmail-m_1394277285197008020gmail-Hyperlink gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" href="https://github.com/PROTEINE-INSAIDERS/lev-tolstoy/blob/master/bench/Bench/Handwritten.hs" rel="noreferrer" style="margin:0px;padding:0px;text-decoration-line:none;color:inherit" target="_blank"><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-Underlined gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;color:rgb(5,99,193);text-decoration-line:underline;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">https://github.com/PROTEINE-INSAIDERS/lev-tolstoy/blob/master/bench/Bench/Handwritten.hs</span></span></a><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit"> </span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">)</span></span><span class="gmail-m_1394277285197008020gmail-EOP gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;font-size:11pt;line-height:19.425px;font-family:Calibri,Calibri_MSFontService,sans-serif"> </span></p></div><div class="gmail-m_1394277285197008020gmail-OutlineElement gmail-m_1394277285197008020gmail-Ltr gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;overflow:visible;clear:both;direction:ltr;color:rgb(0,0,0);font-family:"Segoe UI","Segoe UI Web",Arial,Verdana,sans-serif;font-size:12px"><p class="gmail-m_1394277285197008020gmail-Paragraph gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="RU-RU" style="margin:0px;padding:0px;vertical-align:baseline;background-color:transparent;color:windowtext"><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit"></span></span><span class="gmail-m_1394277285197008020gmail-EOP gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;font-size:11pt;line-height:19.425px;font-family:Calibri,Calibri_MSFontService,sans-serif"> </span></p></div><div class="gmail-m_1394277285197008020gmail-OutlineElement gmail-m_1394277285197008020gmail-Ltr gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;overflow:visible;clear:both;direction:ltr;color:rgb(0,0,0);font-family:"Segoe UI","Segoe UI Web",Arial,Verdana,sans-serif;font-size:12px"><p class="gmail-m_1394277285197008020gmail-Paragraph gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="RU-RU" style="margin:0px;padding:0px;vertical-align:baseline;background-color:transparent;color:windowtext"><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">Next thing was a dynamic reader. D</span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">ynamic</span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit"> readers are composed from static readers, they are fully monadic and allow you to read length-prefixed data structures (you read length with wrapped static reader and then perform normal monadic binding to supply a reader which reads a value). Here the implementation </span></span><a class="gmail-m_1394277285197008020gmail-Hyperlink gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" href="https://github.com/PROTEINE-INSAIDERS/lev-tolstoy/blob/master/src/Lev/Reader/Dynamic.hs" rel="noreferrer" style="margin:0px;padding:0px;text-decoration-line:none;color:inherit" target="_blank"><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-Underlined gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;color:rgb(5,99,193);text-decoration-line:underline;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">https://github.com/PROTEINE-INSAIDERS/lev-tolstoy/blob/master/src/Lev/Reader/Dynamic.hs</span></span></a><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit"> </span></span><span class="gmail-m_1394277285197008020gmail-EOP gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;font-size:11pt;line-height:19.425px;font-family:Calibri,Calibri_MSFontService,sans-serif"> </span></p></div><div class="gmail-m_1394277285197008020gmail-OutlineElement gmail-m_1394277285197008020gmail-Ltr gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;overflow:visible;clear:both;direction:ltr;color:rgb(0,0,0);font-family:"Segoe UI","Segoe UI Web",Arial,Verdana,sans-serif;font-size:12px"><p class="gmail-m_1394277285197008020gmail-Paragraph gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="RU-RU" style="margin:0px;padding:0px;vertical-align:baseline;background-color:transparent;color:windowtext"><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit"></span></span><span class="gmail-m_1394277285197008020gmail-EOP gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;font-size:11pt;line-height:19.425px;font-family:Calibri,Calibri_MSFontService,sans-serif"> </span></p></div><div class="gmail-m_1394277285197008020gmail-OutlineElement gmail-m_1394277285197008020gmail-Ltr gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;overflow:visible;clear:both;direction:ltr;color:rgb(0,0,0);font-family:"Segoe UI","Segoe UI Web",Arial,Verdana,sans-serif;font-size:12px"><p class="gmail-m_1394277285197008020gmail-Paragraph gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="RU-RU" style="margin:0px;padding:0px;vertical-align:baseline;background-color:transparent;color:windowtext"><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">I’ve discovered, that </span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-SpellingError gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-repeat:repeat-x;background-position:0% 100%;background-image:url("");border-bottom:1px solid transparent;background-color:inherit">typeclasses</span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit"> are surprisingly fast. So, it’s completely ok to have something like “(Cursor c) => … Reader” where cursor contains functions for </span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">overflow checking</span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit"> and memory buffer progression. I was not able to achieve same performance when I passed buffer </span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-SpellingError gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-repeat:repeat-x;background-position:0% 100%;background-image:url("");border-bottom:1px solid transparent;background-color:inherit">callbacks</span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit"> explicitly, possibly because of </span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-SpellingError gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-repeat:repeat-x;background-position:0% 100%;background-image:url("");border-bottom:1px solid transparent;background-color:inherit">inlining</span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit"> of specialization magic. So, I've created </span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-SpellingError gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-repeat:repeat-x;background-position:0% 100%;background-image:url("");border-bottom:1px solid transparent;background-color:inherit">ByteStringCursor</span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit"> ( </span></span><a class="gmail-m_1394277285197008020gmail-Hyperlink gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" href="https://github.com/PROTEINE-INSAIDERS/lev-tolstoy/blob/master/src/Lev/Reader/ByteString.hs" rel="noreferrer" style="margin:0px;padding:0px;text-decoration-line:none;color:inherit" target="_blank"><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-Underlined gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;color:rgb(5,99,193);text-decoration-line:underline;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">https://github.com/PROTEINE-INSAIDERS/lev-tolstoy/blob/master/src/Lev/Reader/ByteString.hs</span></span></a><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit"> ) which allows to read strict </span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-SpellingError gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-repeat:repeat-x;background-position:0% 100%;background-image:url("");border-bottom:1px solid transparent;background-color:inherit">bytestrings</span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">. I suppose that cursors introduce flexibility: you may read </span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">strict </span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-SpellingError gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-repeat:repeat-x;background-position:0% 100%;background-image:url("");border-bottom:1px solid transparent;background-color:inherit">bytestring</span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit"> or you may define custom cursor for reading custom memory buffers.</span></span><span class="gmail-m_1394277285197008020gmail-EOP gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;font-size:11pt;line-height:19.425px;font-family:Calibri,Calibri_MSFontService,sans-serif"> </span></p></div><div class="gmail-m_1394277285197008020gmail-OutlineElement gmail-m_1394277285197008020gmail-Ltr gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;overflow:visible;clear:both;direction:ltr;color:rgb(0,0,0);font-family:"Segoe UI","Segoe UI Web",Arial,Verdana,sans-serif;font-size:12px"><p class="gmail-m_1394277285197008020gmail-Paragraph gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="RU-RU" style="margin:0px;padding:0px;vertical-align:baseline;background-color:transparent;color:windowtext"><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit"></span></span><span class="gmail-m_1394277285197008020gmail-EOP gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;font-size:11pt;line-height:19.425px;font-family:Calibri,Calibri_MSFontService,sans-serif"> </span></p></div><div class="gmail-m_1394277285197008020gmail-OutlineElement gmail-m_1394277285197008020gmail-Ltr gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;overflow:visible;clear:both;direction:ltr;color:rgb(0,0,0);font-family:"Segoe UI","Segoe UI Web",Arial,Verdana,sans-serif;font-size:12px"><p class="gmail-m_1394277285197008020gmail-Paragraph gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="RU-RU" style="margin:0px;padding:0px;vertical-align:baseline;background-color:transparent;color:windowtext"><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">Finally, I’ve written some </span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-SpellingError gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-repeat:repeat-x;background-position:0% 100%;background-image:url("");border-bottom:1px solid transparent;background-color:inherit">microbenches</span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit"> for my cases and also ported one </span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-SpellingError gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-repeat:repeat-x;background-position:0% 100%;background-image:url("");border-bottom:1px solid transparent;background-color:inherit">micro</span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-SpellingError gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-repeat:repeat-x;background-position:0% 100%;background-image:url("");border-bottom:1px solid transparent;background-color:inherit">bench</span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit"> from binary. And my implementation was able to run 10x-15x faster than binary on strict </span><span class="gmail-m_1394277285197008020gmail-SpellingError gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-repeat:repeat-x;background-position:0% 100%;background-image:url("");border-bottom:1px solid transparent;background-color:inherit">bytestring</span><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">. Moreover, it does not trigger GC during the run at all! You may find the project and all the </span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">bench</span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">es here </span></span><a class="gmail-m_1394277285197008020gmail-Hyperlink gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" href="https://github.com/PROTEINE-INSAIDERS/lev-tolstoy" rel="noreferrer" style="margin:0px;padding:0px;text-decoration-line:none;color:inherit" target="_blank"><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-Underlined gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;color:rgb(5,99,193);text-decoration-line:underline;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">https://github.com/PROTEINE-INSAIDERS/lev-tolstoy</span></span></a><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-EmptyTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"></span><span class="gmail-m_1394277285197008020gmail-EOP gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;font-size:11pt;line-height:19.425px;font-family:Calibri,Calibri_MSFontService,sans-serif"> </span></p></div><div class="gmail-m_1394277285197008020gmail-OutlineElement gmail-m_1394277285197008020gmail-Ltr gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;overflow:visible;clear:both;direction:ltr;color:rgb(0,0,0);font-family:"Segoe UI","Segoe UI Web",Arial,Verdana,sans-serif;font-size:12px"><p class="gmail-m_1394277285197008020gmail-Paragraph gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="RU-RU" style="margin:0px;padding:0px;vertical-align:baseline;background-color:transparent;color:windowtext"><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit"></span></span><span class="gmail-m_1394277285197008020gmail-EOP gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;font-size:11pt;line-height:19.425px;font-family:Calibri,Calibri_MSFontService,sans-serif"> </span></p></div><div class="gmail-m_1394277285197008020gmail-OutlineElement gmail-m_1394277285197008020gmail-Ltr gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;overflow:visible;clear:both;direction:ltr;color:rgb(0,0,0);font-family:"Segoe UI","Segoe UI Web",Arial,Verdana,sans-serif;font-size:12px"><p class="gmail-m_1394277285197008020gmail-Paragraph gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="RU-RU" style="margin:0px;padding:0px;vertical-align:baseline;background-color:transparent;color:windowtext"><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">So, what's the purpose of my message? It’s quite unlikely that I’ll release my code on the </span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-SpellingError gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-repeat:repeat-x;background-position:0% 100%;background-image:url("");border-bottom:1px solid transparent;background-color:inherit">H</span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-SpellingError gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-repeat:repeat-x;background-position:0% 100%;background-image:url("");border-bottom:1px solid transparent;background-color:inherit">ackage</span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">. This is because I’m a hobbyist Haskell developer and doing it all in my free time. But before </span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-SpellingError gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-repeat:repeat-x;background-position:0% 100%;background-image:url("");border-bottom:1px solid transparent;background-color:inherit">mr</span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">. Putin will close Internet in Russia</span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit"> I’d like to demonstrate that it’s possible to </span></span><span class="gmail-m_1394277285197008020gmail-TextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" lang="EN-GB" style="margin:0px;padding:0px;font-size:11pt;font-family:Calibri,Calibri_MSFontService,sans-serif;font-kerning:none;line-height:19.425px;font-variant-ligatures:none"><span class="gmail-m_1394277285197008020gmail-NormalTextRun gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;background-color:inherit">write very fast binary deserializer taking in account several assumptions which seems quite reasonably for me. So, feel free to borrow the ideas, or share the ideas, if you know how it could be implemented better. </span></span><span class="gmail-m_1394277285197008020gmail-EOP gmail-m_1394277285197008020gmail-BCX0 gmail-m_1394277285197008020gmail-SCXW213930002" style="margin:0px;padding:0px;font-size:11pt;line-height:19.425px;font-family:Calibri,Calibri_MSFontService,sans-serif"> </span></p></div><div><br></div>-- <br><div dir="ltr" class="gmail-m_1394277285197008020gmail_signature"><div dir="ltr"><span style="font-family:arial;font-size:small">Sincerely, Stanislav Chernichkin.</span><br></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><span style="font-family:arial;font-size:small">Sincerely, Stanislav Chernichkin.</span><br></div></div>