Skip to content

Commit

Permalink
Merge pull request #244 from zhongl/review
Browse files Browse the repository at this point in the history
Fix typo in chapter ADT
  • Loading branch information
noelwelsh authored Oct 30, 2023
2 parents 33926eb + f02ae10 commit 0b369f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/pages/adt/conclusions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

We have covered a lot of material in this chapter. Let's recap the key points.

Algebraic data types allow us to express data types by combining existing data types with logical and and logical or. A logical and constructs a sum type while a logical or constructs a product type. Algebraic data types are the main way to represent data in Scala.
Algebraic data types allow us to express data types by combining existing data types with logical and and logical or. A logical and constructs a product type while a logical or constructs a sum type. Algebraic data types are the main way to represent data in Scala.

Structural recursion gives us a skeleton for transforming any given algebraic data type into any other type. Structural recursion can be abstracted into a `fold` method.

Expand Down Expand Up @@ -31,7 +31,7 @@ and relatively recent work is caked in layers of mathematics and obtuse notation
The infamous [Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire][banana] is an example of such work.
I suspect the core ideas of both date back to at least the emergence of computability theory in the 1930s, well before any digital computers existed.

The earliest reference I've found to structural recursion is [Proving Properties of Programs by Structural Induction][structural-induction]), which dates to 1969.
The earliest reference I've found to structural recursion is [Proving Properties of Programs by Structural Induction][structural-induction], which dates to 1969.
Algebraic data types don't seem to have been fully developed, along with pattern matching, until [NPL][npl] in 1977.
NPL was quickly followed by the more influential language [Hope][hope], which spread the concept to other programming languages.

Expand Down
2 changes: 1 addition & 1 deletion src/pages/adt/structural-recursion.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ CssLength.Em(2.0) match {
```

Exhaustivity checking is incredibly useful.
For example, if we add or remove a case from an algebraic data type, the cmopiler will us all the pattern matches that need to be updated.
For example, if we add or remove a case from an algebraic data type, the compiler will us all the pattern matches that need to be updated.


### Dynamic Dispatch
Expand Down

0 comments on commit 0b369f9

Please sign in to comment.