You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ Well, I began learning Haskell in 2021 at my undergrad studies and quickly came
12
12
13
13
However, I quickly realised some parts are slowly becoming outdated as Haskell continues to evolve. That is why, with the author's blessing, I decided to create this open-source fork to enable the Haskell community to participate in preserving and maintaining this awesome resource for the future times.
14
14
15
-
Anyone is invited to **contribute**be either opening a pull request (preferred) or opening a content edit request (in the pipeline, open soon!) for proposed changes.
15
+
Anyone is invited to **contribute**by either opening a pull request (preferred) or opening a content edit request (in the pipeline, open soon!) for proposed changes.
16
16
17
17
The whole thing is completely free to read online, but the original is also available in print and we encourage you to buy a copy!
Copy file name to clipboardExpand all lines: docs/making-our-own-types-and-typeclasses.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -156,7 +156,7 @@ <h1>Making Our Own Types and Typeclasses</h1>
156
156
ghci> guy
157
157
Person "Buddy" "Finklestein" 43 184.2 "526-2928" "Chocolate"
158
158
</pre>
159
-
<p>That's kind of cool, although slightly unreadable. What if we want to create a function to get seperate info from a person? A function that gets some person's first name, a function that gets some person's last name, etc. Well, we'd have to define them kind of like this.</p>
159
+
<p>That's kind of cool, although slightly unreadable. What if we want to create a function to get separate info from a person? A function that gets some person's first name, a function that gets some person's last name, etc. Well, we'd have to define them kind of like this.</p>
Copy file name to clipboardExpand all lines: docs/modules.html
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -81,7 +81,7 @@ <h1>Modules</h1>
81
81
ghci> intersperse 0 [1,2,3,4,5,6]
82
82
[1,0,2,0,3,0,4,0,5,0,6]
83
83
</pre>
84
-
<p><spanclass="label function">intercalate</span> takes a list of lists and a list. It then inserts that list in between all those lists and then flattens the result.</p>
84
+
<p><spanclass="label function">intercalate</span> takes a list and a list of lists. It then inserts that list in between all those lists and then flattens the result.</p>
85
85
<prename="code" class="haskell:ghci">
86
86
ghci> intercalate " " ["hey","there","guys"]
87
87
"hey there guys"
@@ -276,7 +276,7 @@ <h1>Modules</h1>
276
276
find :: (a -> Bool) -> [a] -> Maybe a
277
277
</pre>
278
278
<p>Notice the type of <spanclass="fixed">find</span>. Its result is <spanclass="fixed">Maybe a</span>. That's kind of like having the type of <spanclass="fixed">[a]</span>, only a value of the type <spanclass="fixed">Maybe</span> can contain either no elements or one element, whereas a list can contain no elements, one element or several elements.</p>
279
-
<p>Remember when we were searching for the first time our stock went over $1000. We did <spanclass="fixed">head (dropWhile (\(val,y,m,d) -> val < 1000) stock)</span>. Remember that <spanclass="fixed">head</span> is not really safe. What would happen if our stock never went over $1000? Our application of <spanclass="fixed">dropWhile</span> would return an empty list and getting the head of an empty list would result in an error. However, if we rewrote that as <spanclass="fixed">find (\(val,y,m,d) -> val > 1000) stock</span>, we'd be much safer. If our stock never went over $1000 (so if no element satisfied the predicate), we'd get back a <spanclass="fixed">Nothing</span>. But there was a valid answer in that list, we'd get, say, <spanclass="fixed">Just (1001.4,2008,9,4)</span>.
279
+
<p>Remember when we were searching for the first time our stock went over $1000. We did <spanclass="fixed">head (dropWhile (\(val,y,m,d) -> val < 1000) stock)</span>. Remember that <spanclass="fixed">head</span> is not really safe. What would happen if our stock never went over $1000? Our application of <spanclass="fixed">dropWhile</span> would return an empty list and getting the head of an empty list would result in an error. However, if we rewrote that as <spanclass="fixed">find (\(val,y,m,d) -> val > 1000) stock</span>, we'd be much safer. If our stock never went over $1000 (so if no element satisfied the predicate), we'd get back a <spanclass="fixed">Nothing</span>. But if there was a valid answer in that list, we'd get, say, <spanclass="fixed">Just (1001.4,2008,9,4)</span>.
280
280
<p><spanclass="label function">elemIndex</span> is kind of like <spanclass="fixed">elem</span>, only it doesn't return a boolean value. It maybe returns the index of the element we're looking for. If that element isn't in our list, it returns a <spanclass="fixed">Nothing</span>. </p>
281
281
<prename="code" class="haskell:ghci">
282
282
ghci> :t elemIndex
@@ -308,7 +308,7 @@ <h1>Modules</h1>
308
308
[(2,2,5,2),(3,2,5,2),(3,2,3,2)]
309
309
</pre>
310
310
<p>Just like with normal zipping, lists that are longer than the shortest list that's being zipped are cut down to size.</p>
311
-
<p><spanclass="label function">lines</span> is a useful function when dealing with files or input from somewhere. It takes a string and returns every line of that string in a separate list.</p>
311
+
<p><spanclass="label function">lines</span> is a useful function when dealing with files or input from somewhere. It takes a string and returns every line of that string as separate element of a list.</p>
<p><spanclass="label function">isOctDigit</span> checks whether a character is an octal digit.</p>
424
424
<p><spanclass="label function">isHexDigit</span> checks whether a character is a hex digit.</p>
425
425
<p><spanclass="label function">isLetter</span> checks whether a character is a letter.</p>
426
-
<p><spanclass="label function">isMark</span> checks for Unicode mark characters. Those are characters that combine with preceding letters to form latters with accents. Use this if you are French.</p>
426
+
<p><spanclass="label function">isMark</span> checks for Unicode mark characters. Those are characters that combine with preceding letters to form letters with accents. Use this if you are French.</p>
427
427
<p><spanclass="label function">isNumber</span> checks whether a character is numeric.</p>
428
428
<p><spanclass="label function">isPunctuation</span> checks whether a character is punctuation.</p>
429
429
<p><spanclass="label function">isSymbol</span> checks whether a character is a fancy mathematical or currency symbol.</p>
@@ -635,7 +635,7 @@ <h1>Modules</h1>
635
635
fromList [(3,9),(5,9)]
636
636
</pre>
637
637
<p><spanclass="label function">lookup</span> works like the <spanclass="fixed">Data.List</span><spanclass="fixed">lookup</span>, only it operates on maps. It returns <spanclass="fixed">Just something</span> if it finds something for the key and <spanclass="fixed">Nothing</span> if it doesn't.</p>
638
-
<p><spanclass="label function">member</span> is a predicate takes a key and a map and reports whether the key is in the map or not.</p>
638
+
<p><spanclass="label function">member</span> is a predicate that takes a key and a map and reports whether the key is in the map or not.</p>
0 commit comments