<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>Pranav - Tutorial</title>
    <subtitle>My personal blog</subtitle>
    <link rel="self" type="application/atom+xml" href="https://pranavmanoj.net/tags/tutorial/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://pranavmanoj.net"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>1970-01-01T00:00:00+00:00</updated>
    <id>https://pranavmanoj.net/tags/tutorial/atom.xml</id>
    <entry xml:lang="en">
        <title>Lorem</title>
        <published>1970-01-01T00:00:00+00:00</published>
        <updated>1970-01-01T00:00:00+00:00</updated>
        
        <author>
          <name>
            Pranav
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://pranavmanoj.net/blog/megaparsec/"/>
        <id>https://pranavmanoj.net/blog/megaparsec/</id>
        
        <content type="html" xml:base="https://pranavmanoj.net/blog/megaparsec/">&lt;h1 id=&quot;hello-world&quot;&gt;Hello World&lt;&#x2F;h1&gt;
&lt;h2 id=&quot;random-stuff&quot;&gt;Random stuff&lt;&#x2F;h2&gt;
&lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim aeque doleamus animo, cum corpore dolemus, fieri tamen permagna accessio potest, si aliquod aeternum et infinitum impendere malum nobis opinemur. Quod idem licet transferre in voluptatem, ut postea.&lt;&#x2F;p&gt;
&lt;p&gt;Ullus investigandi veri, nisi inveneris, et quaerendi defatigatio turpis est, cum esset accusata et vituperata ab Hortensio. Qui liber cum et mortem contemnit, qua qui est imbutus quietus esse numquam potest. Praeterea bona praeterita grata recordatione renovata delectant. Est.&lt;&#x2F;p&gt;
&lt;p&gt;Ullus investigandi veri, nisi inveneris, et quaerendi defatigatio turpis est, cum esset accusata et vituperata ab Hortensio. Qui liber cum et mortem contemnit, qua qui est imbutus quietus esse numquam potest. Praeterea.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;code&quot;&gt;Code&lt;&#x2F;h2&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #ADBAC7; background-color: #22272E;&quot;&gt;&lt;code data-lang=&quot;haskell&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #768390;&quot;&gt;-- Parse a given user request and run the corresponding action&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #DCBDFB;&quot;&gt;handleRequest&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F47067;&quot;&gt; :: String -&amp;gt; StateT Memory&lt;&#x2F;span&gt;&lt;span&gt; (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F47067;&quot;&gt;InputT IO&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6CB6FF;&quot;&gt; ()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;handleRequest str &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F47067;&quot;&gt;= do&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #768390;&quot;&gt;  -- Parse and update state&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F47067;&quot;&gt;  let&lt;&#x2F;span&gt;&lt;span&gt; parserAction &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F47067;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt; runParserT parseRequest &lt;&#x2F;span&gt;&lt;span style=&quot;color: #96D0FF;&quot;&gt;&amp;quot;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; str&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  result &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F47067;&quot;&gt;&amp;lt;-&lt;&#x2F;span&gt;&lt;span&gt; state &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F47067;&quot;&gt;$ \&lt;&#x2F;span&gt;&lt;span&gt;st &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F47067;&quot;&gt;-&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; runState parserAction st&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #768390;&quot;&gt;  -- Allow IO actions to be interrupted with Ctrl-C&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F47067;&quot;&gt;  let&lt;&#x2F;span&gt;&lt;span&gt; interruptable &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F47067;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt; handleInterrupt (outputStrLn &lt;&#x2F;span&gt;&lt;span style=&quot;color: #96D0FF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F47067;&quot;&gt;\n&lt;&#x2F;span&gt;&lt;span style=&quot;color: #96D0FF;&quot;&gt;Interrupted.&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F47067;&quot;&gt; .&lt;&#x2F;span&gt;&lt;span&gt; withInterrupt&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F47067;&quot;&gt;  let&lt;&#x2F;span&gt;&lt;span&gt; liftInterruptableIO action &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F47067;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt; lift &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F47067;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; interruptable &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F47067;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; liftIO action&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  liftInterruptableIO &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F47067;&quot;&gt;$ case&lt;&#x2F;span&gt;&lt;span&gt; result &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F47067;&quot;&gt;of&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6CB6FF;&quot;&gt;    Left&lt;&#x2F;span&gt;&lt;span&gt; error &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F47067;&quot;&gt;-&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; handleErrorBundle error&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6CB6FF;&quot;&gt;    Right&lt;&#x2F;span&gt;&lt;span&gt; action &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F47067;&quot;&gt;-&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; action&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;more-random-stuff&quot;&gt;More random stuff&lt;&#x2F;h2&gt;
&lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim aeque doleamus animo, cum corpore dolemus, fieri tamen permagna accessio potest, si aliquod aeternum et infinitum impendere malum nobis opinemur. Quod idem licet transferre in voluptatem, ut postea.&lt;&#x2F;p&gt;
&lt;p&gt;Ullus investigandi veri, nisi inveneris, et quaerendi defatigatio turpis est, cum esset accusata et vituperata ab Hortensio. Qui liber cum et mortem contemnit, qua qui est imbutus quietus esse numquam potest. Praeterea bona praeterita grata recordatione renovata delectant. Est.&lt;&#x2F;p&gt;
&lt;p&gt;Ullus investigandi veri, nisi inveneris, et quaerendi defatigatio turpis est, cum esset accusata et vituperata ab Hortensio. Qui liber cum et mortem contemnit, qua qui est imbutus quietus esse numquam potest. Praeterea&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-1-1&quot;&gt;&lt;a href=&quot;#fn-1&quot;&gt;1&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;thing&quot;&gt;Thing&lt;&#x2F;h1&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;input disabled=&quot;&quot; type=&quot;checkbox&quot;&#x2F;&gt;
Check&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;input disabled=&quot;&quot; type=&quot;checkbox&quot;&#x2F;&gt;
List&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Unordered&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;List&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;ol&gt;
&lt;li&gt;Ordered&lt;&#x2F;li&gt;
&lt;li&gt;List&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;blockquote class=&quot;markdown-alert-note&quot;&gt;
&lt;p&gt;hi&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h2 id=&quot;more-stuff&quot;&gt;More stuff&lt;&#x2F;h2&gt;
&lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim aeque doleamus animo, cum corpore dolemus, fieri tamen permagna accessio potest, si aliquod aeternum et infinitum impendere malum nobis opinemur. Quod idem licet transferre in voluptatem, ut postea.&lt;&#x2F;p&gt;
&lt;p&gt;Ullus investigandi veri, nisi inveneris, et quaerendi defatigatio turpis est, cum esset accusata et vituperata ab Hortensio. Qui liber cum et mortem contemnit, qua qui est imbutus quietus esse numquam potest. Praeterea bona praeterita grata recordatione renovata delectant. Est.&lt;&#x2F;p&gt;
&lt;p&gt;Ullus investigandi veri, nisi inveneris, et quaerendi defatigatio turpis est, cum esset accusata et vituperata ab Hortensio. Qui liber cum et mortem contemnit, qua qui est imbutus quietus esse numquam potest. Praeterea.&lt;&#x2F;p&gt;
&lt;p&gt;“Quote test”&lt;&#x2F;p&gt;
&lt;section class=&quot;footnotes&quot;&gt;
&lt;ol class=&quot;footnotes-list&quot;&gt;
&lt;li id=&quot;fn-1&quot;&gt;
&lt;p&gt;Citation. &lt;a href=&quot;#fr-1-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;section&gt;
</content>
        
    </entry>
</feed>
