lecture 14: add note about library versions & docs

fixes #77
related to #66
This commit is contained in:
Joel Kaasinen
2023-01-20 14:37:38 +02:00
parent 6191a49f54
commit 9d04ae8465
+1
View File
@@ -3561,6 +3561,7 @@ None of the above
<section id="lecture-14-lets-use-some-libraries" data-number="6">
<h1 data-number="14"><span class="header-section-number">14</span> Lecture 14: Let’s Use Some Libraries!</h1>
<p>Now that you know monads, you pretty much know everything about Haskell to start writing real programs that use libraries to do useful things. This lecture will go over some examples of libraries that are commonly used in such real programs. Using these libraries is also a good way to practice using monads, reading docs, and understanding type errors.</p>
<p><strong>Note!</strong> When reading the documentation for the libraries, remember to pay attention to the library version. You can see the versions used on the course in the <a href="https://github.com/moocfi/haskell-mooc/blob/master/exercises/tests.cabal"><code>tests.cabal</code> file</a>. The links in the course material always take you to the right version, as does the <code>stack haddock --open &lt;package&gt;</code> command. See also <a href="https://haskell.mooc.fi/part1#reading-docs">Reading Docs in Part 1</a>.</p>
<section id="text-and-bytestring" data-number="6.1">
<h2 data-number="14.1"><span class="header-section-number">14.1</span> <code>Text</code> and <code>ByteString</code></h2>
<p>So far, we’ve been using the Haskell <code>String</code> type to work with strings. However <code>String</code> is just <code>[Char]</code>, a linked list of characters. This is horribly inefficient, both in terms of memory, and in terms of time. Once we move beyond processing short strings and start processing whole files or network requests, a more time efficient string type becomes a must.</p>