mirror of
https://github.com/iritmaximus/haskell.git
synced 2026-10-12 19:13:39 +03:00
lecture 14: fix typo / simplify
This commit is contained in:
+1
-1
@@ -3625,7 +3625,7 @@ None of the above
|
||||
<span id="cb316-3"><a href="#cb316-3" aria-hidden="true" tabindex="-1"></a><span class="dt">Prelude</span> <span class="dt">T</span><span class="op">></span> <span class="kw">import</span> <span class="kw">qualified</span> <span class="dt">Data.Text.Lazy</span> <span class="kw">as</span> <span class="dt">TL</span></span>
|
||||
<span id="cb316-4"><a href="#cb316-4" aria-hidden="true" tabindex="-1"></a><span class="dt">Prelude</span> <span class="dt">T</span> <span class="dt">TL</span><span class="op">></span> TL.head (TL.pack (<span class="fu">repeat</span> <span class="ch">'x'</span>))</span>
|
||||
<span id="cb316-5"><a href="#cb316-5" aria-hidden="true" tabindex="-1"></a><span class="ch">'x'</span></span></code></pre></div>
|
||||
<p>Another practical problem that sometimes crops is that you can end up with a mismatch between strict and lazy <code>Text</code>s when using libraries. You can usually fix this by using <code>toStrict</code> or <code>fromStrict</code> as needed.</p>
|
||||
<p>Another practical problem is that you can end up with a mismatch between strict and lazy <code>Text</code>s when using libraries. You can usually fix this by using <code>toStrict</code> or <code>fromStrict</code> as needed.</p>
|
||||
<div class="sourceCode" id="cb317"><pre class="sourceCode haskell"><code class="sourceCode haskell"><span id="cb317-1"><a href="#cb317-1" aria-hidden="true" tabindex="-1"></a><span class="dt">Prelude</span> <span class="dt">T</span> <span class="dt">TL</span><span class="op">></span> lazyPhrase <span class="ot">=</span> TL.pack <span class="st">"brevity is the soul of wit"</span></span>
|
||||
<span id="cb317-2"><a href="#cb317-2" aria-hidden="true" tabindex="-1"></a><span class="dt">Prelude</span> <span class="dt">T</span> <span class="dt">TL</span><span class="op">></span> <span class="op">:</span>t lazyPhrase</span>
|
||||
<span id="cb317-3"><a href="#cb317-3" aria-hidden="true" tabindex="-1"></a><span class="ot">lazyPhrase ::</span> <span class="dt">TL.Text</span></span>
|
||||
|
||||
Reference in New Issue
Block a user