Skip to content

Commit 678b1fd

Browse files
committed
2 parents dee6122 + 5f06439 commit 678b1fd

File tree

4 files changed

+25
-8
lines changed

4 files changed

+25
-8
lines changed

_chapters/haskell0.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ stack config set snapshot lts-23.25
197197

198198
## Troubleshooting
199199

200+
For further issues, see [GHCup’s Troubleshooting page](https://www.haskell.org/ghcup/guide/#troubleshooting).
201+
200202
### Windows Issues
201203

202204
#### `invalid argument (invalid character)`
@@ -243,6 +245,10 @@ Add the following line to the bottom of the file:
243245
local-programs-path: C:\stack-programs
244246
```
245247
248+
#### Script immediately exits
249+
250+
If the script exits without installing anything, you might need to disable any third-party antivirus software.
251+
246252
### macOS Issues
247253
248254
If you get an error that looks something like `fatal error: 'ffi.h'`, it may be because you do not have the Xcode command line tools installed. (These are a collection of command line utilities and other developer tools that many programs rely on.) You can install them by running the following command in your terminal:

_chapters/haskell3.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -372,11 +372,13 @@ We can formalise the definition of Functor with two laws:
372372

373373
The law of ***identity***
374374

375-
∀ x: (id <$> x) ≡ x
375+
∀ x: (id <\\$> x) ≡ x
376376

377377
The law of ***composition***
378378

379-
∀ f, g, x: (f ∘ g <$> x) ≡ (f <$> (g <$> x))
379+
∀ f, g, x: (f ∘ g <\\$> x) ≡ (f <\\$> (g <\\$> x))
380+
381+
(∘ has higher precedence than <\\$>, so f ∘ g <\\$> x is equal to (f ∘ g) <\\$> x.)
380382

381383
Note that these laws are not enforced by the compiler when you create your own instances of `Functor`. You’ll need to test them for yourself. Following these laws guarantees that general code (e.g. algorithms) using `fmap` will also work for your own instances of `Functor`.
382384

@@ -433,7 +435,7 @@ Node (Node (Leaf 1) 2 (Leaf 3)) 4 (Node (Leaf 5) 6 (Leaf 7))
433435
Law of Composition:
434436

435437
```haskell
436-
> (+1) <$> (*2) <$> tree
438+
> (+1) <$> ((*2) <$> tree)
437439
Node (Node (Leaf 3) 5 (Leaf 7)) 9 (Node (Leaf 11) 13 (Leaf 15))
438440
> (+1).(*2) <$> tree
439441
Node (Node (Leaf 3) 5 (Leaf 7)) 9 (Node (Leaf 11) 13 (Leaf 15))

_data/glossary.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
definition: The processes a computer follows when executing a program in a given language.
3636
first_appeared: levelsofabstraction
3737
- term: Imperative
38-
definition: Imperative programs are a sequence of statements that change a program’s state. This is probably the dominant paradigm for programming languages today. Languages from Assembler to Python are built around this concept and most modern languages still allow you to program in this style.
38+
definition: Imperative programs are a sequence of statements that change a program’s state. This is probably the dominant paradigm for programming languages today. Languages from Assembly to Python are built around this concept and most modern languages still allow you to program in this style.
3939
first_appeared: levelsofabstraction
4040
- term: Procedural
4141
definition: Procedural languages are basically *imperative* in nature, but add the concept of named *procedures*, i.e. named subroutines that may be invoked from elsewhere in the program, with parameterised variables that may be passed in.
@@ -146,7 +146,7 @@
146146
definition: A TypeScript construct that allows a variable to hold values of multiple specified types, separated by the `|` symbol.
147147
first_appeared: typescript1
148148
- term: Functor
149-
definition: A type class in Haskell that represents types that can be mapped over. Instances of Functor must define the fmap function, which applies a function to every element in a structure.
149+
definition: A type class in Haskell that represents types that can be mapped over. Instances of [Functor](/assets/WhatTheFunctor.mp3) must define the fmap function, which applies a function to every element in a structure.
150150
first_appeared: haskell3
151151
- term: Applicative
152152
definition: A type class in Haskell that extends Functor, allowing functions that are within a context to be applied to values that are also within a context. Applicative defines the functions pure and (<*>).
@@ -184,6 +184,15 @@
184184
- term: Lazy Evaluation
185185
definition: A strategy where expressions are not evaluated until their values are needed, allowing for the creation of infinite sequences and delayed computations.
186186
first_appeared: lazyevaluation
187+
- term: Callback
188+
definition: A function passed as an argument to another function, to be executed after some event or action has occurred.
189+
first_appeared: functionaljavascript
190+
- term: Chained Functions
191+
definition: A programming pattern where multiple function calls are made sequentially, with each function returning an object that allows the next function to be called.
192+
first_appeared: functionaljavascript
193+
- term: Fluent Interface
194+
definition: A method chaining pattern where a sequence of method calls is made on the same object, with each method returning the object itself or another chainable object.
195+
first_appeared: functionaljavascript
187196
- term: Operator Sectioning
188197
definition: The process of partially applying an infix operator in Haskell by specifying one of its arguments. For example, (+1) is a section of the addition operator with 1 as the second argument.
189198
first_appeared: haskell3
@@ -223,8 +232,8 @@
223232
- term: K-combinator
224233
definition: A combinator that takes two arguments and returns the first one.
225234
first_appeared: higherorderfunctions
226-
- term: Algebraic Data Types (or ADTs)
227-
definition: Custom data types in Haskell defined using the data keyword, allowing the combination of different types into one composite type using the \| operator.
235+
- term: Algebraic Data Types
236+
definition: (or ADTs) Custom data types in Haskell defined using the data keyword, allowing the combination of different types into one composite type using the \| operator.
228237
first_appeared: haskell2
229238
- term: Record Syntax
230239
definition: An alternate way to define data structures in Haskell with named fields, automatically creating accessor functions for those fields.

_plugins/glossary.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def generate(site)
2828

2929
site.data.glossary.each do |entry|
3030
term = entry['term'].downcase
31-
definition = Kramdown::Document.new(entry['definition']).to_html.gsub(/<\/?p>/, '')
31+
definition = Kramdown::Document.new(entry['definition']).to_html.gsub(/<\/?p>/, '').gsub(/<a.*?>(.+?)<\/a>/, '$1')
3232
first_appeared = entry['first_appeared']
3333

3434
@@glossary_terms[term] = [definition, first_appeared]

0 commit comments

Comments
 (0)