Bryan O'Sullivan, John Goerzen, Don Stewart - Real World Haskell Date: 2022-12-04 | A helpful analogy to understand the value of static typing is to | look at it as putting pieces into a jigsaw puzzle. In Haskell, if a | piece has the wrong shape, it simply won’t fit. In a dynamically | typed language, all the pieces are 1×1 squares and always fit, | so you have to constantly examine the resulting picture and check | (through testing) whether it’s correct. Chapter: Static Types Date: 2022-12-04 | A composite data type is constructed from other types. The most | common composite data types in Haskell are lists and tuples Chapter: Useful Composite Data Types: Lists and Tuples Date: 2022-12-04 | Because the values in a list can have any type, we call the list | type polymorphic. Chapter: Useful Composite Data Types: Lists and Tuples Date: 2022-12-04 | We can now see why a type name must start with an uppercase letter: | it makes it distinct from a type variable, which must start with | a lowercase letter Chapter: Useful Composite Data Types: Lists and Tuples Date: 2022-12-05 | Once a variable is bound to (i.e., associated with) a particular | expression, its value does not change: we can always use the name | of the variable instead of writing out the expression, and we will | get the same result either way. If you’re used to imperative | programming languages, you’re likely to think of a variable as | a way of identifying a memory location Chapter: Just What Is a Variable, Anyway? Date: 2022-12-05 | Recall that Haskell is an expression-oriented language. In | an imperative language, it can make sense to omit the else | branch from an if, because we’re working with statements, not | expressions. However, when we’re working with expressions, an if | that was missing an else wouldn’t have a result or type if the | predicate evaluated to False, so it would be nonsensical. Chapter: Conditional Evaluation Date: 2022-12-05 | The record that we use to track an unevaluated expression is | referred to as a thunk. This is all that happens: we create a thunk | and defer the actual evaluation until it’s really needed. If the | result of this expression is never subsequently used, we will not | compute its value at all. Chapter: Lazy Evaluation Date: 2022-12-06 | parametric polymorphism. The choice of naming is easy to understand | by analogy: just as a function can have parameters that we can | later bind to real values, a Haskell type can have parameters that | we can later bind to other types Chapter: Polymorphism in Haskell Date: 2022-12-06 | Haskell’s parametric polymorphism directly influenced the design | of the generic facilities of the Java and C# languages. Chapter: Polymorphism in Haskell Date: 2022-12-06 | value constructor as just another function—one that happens to | create and return a new value of the type we desire Chapter: Defining a New Data Type Date: 2022-12-08 | A type synonym creates only a new name that refers to an existing | type. Chapter: Type Synonyms Date: 2022-12-08 | An algebraic data type can have more than one value constructor: Chapter: Algebraic Data Types