Skip to content

Commit

Permalink
Undo space in links to Ch6
Browse files Browse the repository at this point in the history
  • Loading branch information
bwignall committed Oct 30, 2019
1 parent 37c4582 commit 5f1c861
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion 1-getting-started.org
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ second case, we ask ~ghci~ to print the type of the expression
without actually evaluating it, so it does not have to be so
specific. It answers, in effect, "its type is numeric". We will
see more of this style of type annotation in
[[file:6-using-type classes.org][Chapter 6, Using Type Classes]].
[[file:6-using-typeclasses.org][Chapter 6, Using Type Classes]].

** A simple program

Expand Down
2 changes: 1 addition & 1 deletion 13-data-structures.org
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ We've told you how powerful and expressive Haskell's type system
is. We've shown you a lot of ways to use that power. Here's a
chance to really see that in action.

Back in [[file:6-using-type classes.org::*Numeric Types][the section called "Numeric Types"]]
Back in [[file:6-using-typeclasses.org::*Numeric Types][the section called "Numeric Types"]]
type classes that come with Haskell. Let's see what we can do by
defining new types and utilizing the numeric type classes to
integrate them with basic mathematics in Haskell.
Expand Down
2 changes: 1 addition & 1 deletion 16-programming-with-monads.org
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ ghci> second odd ('a',1)
#+END_SRC

(Indeed, we already encountered ~second~, in
[[file:6-using-type classes.org::*JSON type classes without overlapping instances][the section called "JSON type classes without overlapping instances"]]
[[file:6-using-typeclasses.org::*JSON type classes without overlapping instances][the section called "JSON type classes without overlapping instances"]]
We can use ~first~ to golf our definition of ~randomsIO~, turning
it into a one-liner.

Expand Down
4 changes: 2 additions & 2 deletions 2-types-and-functions.org
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ useful kinds of code. In languages like Python, "duck typing" is
common, where an object acts enough like another to be used as a
substitute for it[fn:1]. Fortunately, Haskell's system of
/type classes/, which we will cover in
[[file:6-using-type classes.org][Chapter 6, Using Type Classes]], provides almost all of the
[[file:6-using-typeclasses.org][Chapter 6, Using Type Classes]], provides almost all of the
benefits of dynamic typing, in a safe and convenient form. Haskell
has some support for programming with truly dynamic types, though
it is not quite as easy as in a language that wholeheartedly
Expand Down Expand Up @@ -1277,7 +1277,7 @@ point numbers. Haskell deliberately avoids even this kind of
simple automatic coercion.

This is not the whole story of polymorphism in Haskell: we'll
return to the subject in [[file:6-using-type classes.org][Chapter 6, Using Type Classes]].
return to the subject in [[file:6-using-typeclasses.org][Chapter 6, Using Type Classes]].

*** Reasoning about polymorphic functions

Expand Down
2 changes: 1 addition & 1 deletion 20-systems-programming-in-haskell.org
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ highlighted:
and ~Show~ type classes. In addition, ~Month~ and ~Day~ are
declared as members of the ~Enum~ and ~Bounded~ type classes. For
more information on these type classes, refer to
[[file:6-using-type classes.org::*Important%20Built-In%20Type%20Classes][the section called "Important Built-In Type Classes"]]
[[file:6-using-typeclasses.org::*Important%20Built-In%20Type%20Classes][the section called "Important Built-In Type Classes"]]

You can generate ~CalendarTime~ values several ways. You could
start by converting a ~ClockTime~ to a ~CalendarTime~ such as
Expand Down
2 changes: 1 addition & 1 deletion 3-defining-types-streamlining-functions.org
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ their type and value constructors have different names.
Deriving what?

We'll explain the full meaning of ~deriving (Show)~ later, in
[[file:6-using-type classes.org::*Show][the section called "Show"]]
[[file:6-using-typeclasses.org::*Show][the section called "Show"]]
need to tack this onto a type declaration so that ~ghci~ will
automatically know how to print a value of this type.
#+END_NOTE
Expand Down
12 changes: 6 additions & 6 deletions 6-using-typeclasses.org
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ that we could fix the problem by defining an instance of ~BasicEq~
for ~[Char]~, which is the same as ~String~.

We'll go into more detail on defining instances in
[[file:6-using-type classes.org::*Declaring type class instances][the section called "Declaring type class instances"]]
[[file:6-using-typeclasses.org::*Declaring type class instances][the section called "Declaring type class instances"]]
let's continue to look at ways to define type classes. In this
example, a not-equal-to function might be useful. Here's what we
might say to define a type class with two functions:
Expand Down Expand Up @@ -228,7 +228,7 @@ instances of a particular type class by implementing the functions
necessary for that type class.

Recall our attempt to create a test for equality over a ~Color~
type back in [[file:6-using-type classes.org::*The need for type classes][the section called "The need for type classes"]]
type back in [[file:6-using-typeclasses.org::*The need for type classes][the section called "The need for type classes"]]
let's see how we could make that same ~Color~ type a member of the
~BasicEq3~ class.

Expand All @@ -244,13 +244,13 @@ instance BasicEq3 Color where
#+END_SRC

Notice that we provide essentially the same function as we used
back in [[file:6-using-type classes.org::*The need for type classes][the section called "The need for type classes"]]
back in [[file:6-using-typeclasses.org::*The need for type classes][the section called "The need for type classes"]]
the implementation is identical. However, in this case, we can use
~isEqual3~ on /any/ type that we declare is an instance of
~BasicEq3~, not just this one color type. We could define equality
tests for anything from numbers to graphics using the same basic
pattern. In fact, as you will see in
[[file:6-using-type classes.org::*Equality, Ordering, and Comparisons][the section called "Equality, Ordering, and Comparisons"]]
[[file:6-using-typeclasses.org::*Equality, Ordering, and Comparisons][the section called "Equality, Ordering, and Comparisons"]]
exactly how you can make Haskell's ~==~ operator work for your own
custom types.

Expand Down Expand Up @@ -351,7 +351,7 @@ instance Show Color where
#+END_SRC

This example defines an instance of ~Show~ for our type ~Color~
(see [[file:6-using-type classes.org::*The need for type classes][the section called "The need for type classes"]]
(see [[file:6-using-typeclasses.org::*The need for type classes][the section called "The need for type classes"]]
implementation is simple: we define a function ~show~ and that's
all that's needed.

Expand Down Expand Up @@ -574,7 +574,7 @@ True

Since so many different types are instances of ~Read~ and ~Show~
by default (and others can be made instances easily; see
[[file:6-using-type classes.org::*Automatic Derivation][the section called "Automatic Derivation"]]
[[file:6-using-typeclasses.org::*Automatic Derivation][the section called "Automatic Derivation"]]
some really complex data structures. Here are a few examples of
slightly more complex data structures:

Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ typeclass:
# First, manually check that all instances of "Typeclass" don't need to be "Type Class"
sed -i 's/Typeclass/Type class/g' *.org
sed -i 's/typeclass/type class/g' *.org
sed -i 's/6-using-type classes.org/6-using-typeclasses.org/g' *.org
2 changes: 1 addition & 1 deletion README.org
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ changes listed as /enhancements/ in the issue tracker.
4. DONE [[file:3-defining-types-streamlining-functions.org][Defining Types, Streamlining Functions]]
5. DONE [[file:4-functional-programming.org][Functional programming]]
6. DONE [[file:5-writing-a-library.org][Writing a library]]
7. DONE [[file:6-using-type classes.org][Using type classes]]
7. DONE [[file:6-using-typeclasses.org][Using type classes]]
8. DONE [[file:7-io.org][I/O]]
9. DONE [[file:8-efficient-file-processing-regular-expressions-and-file-name-matching.org][Effiient file processing]]
10. DONE [[file:9-a-library-for-searching-the-file-system.org][A library for searching the file system]]
Expand Down

0 comments on commit 5f1c861

Please sign in to comment.