Skip to content

Commit

Permalink
Merge pull request #6 from bwignall/typecheck
Browse files Browse the repository at this point in the history
Replace "typecheck" with "type-check"
  • Loading branch information
bwignall authored Oct 30, 2019
2 parents 50d0850 + 1fe1da7 commit 897aa30
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion 10-parsing-a-binary-data-format.org
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ push a s = Item a s
#+END_SRC

Try removing that ~Ord~ constraint above, and the definition of
~push~ will fail to typecheck.
~push~ will fail to type-check.

This is why our attempt to write a ~Functor~ instance for ~Bar~
failed earlier: it would have required an ~Eq~ constraint to
Expand Down
2 changes: 1 addition & 1 deletion 12-barcode-recognition.org
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ arrays.
should return the leftmost element of the tuple. With an
argument of one, it should return the next element. And so on.
What restrictions do you have to put on the types of the
arguments in order to write a function that typechecks
arguments in order to write a function that type-checks
correctly?
2. Write a similar function that takes a six-tuple as its first
argument.
Expand Down
2 changes: 1 addition & 1 deletion 26-building-a-bloom-filter.org
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,7 @@ The value of ~-fvia-C~ with the FFI
Compiling with ~-fvia-C~ has a useful safety benefit when we write
FFI bindings. If we mention a header file in an FFI declaration
(e.g. ~foreign import "string.h memcpy")~, the C compiler will
typecheck the generated Haskell code and ensure that its
type-check the generated Haskell code and ensure that its
invocation of the C function is consistent with the C function's
prototype in the header file.

Expand Down
2 changes: 1 addition & 1 deletion 4-functional-programming.org
Original file line number Diff line number Diff line change
Expand Up @@ -1910,7 +1910,7 @@ ghci> unsafeHead []
*** Exception: Lambda.hs:7:13-23: Non-exhaustive patterns in lambda
#+END_SRC

The definition typechecks, so it will compile, so the error will
The definition type-checks, so it will compile, so the error will
occur at runtime. The moral of this story is to be careful in how
you use patterns when defining an anonymous function: make sure
your patterns can't fail!
Expand Down
4 changes: 2 additions & 2 deletions 5-writing-a-library.org
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ works becomes more accurate.
#+BEGIN_TIP
Explicit types, undefined values, and error

The special value ~undefined~ will happily typecheck no matter
The special value ~undefined~ will happily type-check no matter
where we use it, as will an expression like ~error "argh!"~. It is
especially important that we write type signatures when we use
these. Suppose we use ~undefined~ or ~error "write me"~ to act as
Expand Down Expand Up @@ -536,7 +536,7 @@ double num = undefined
#+END_SRC

The special value ~undefined~ has the type ~a~, so it always
typechecks, no matter where we use it. If we attempt to evaluate
type-checks, no matter where we use it. If we attempt to evaluate
it, it will cause our program to crash.

#+BEGIN_SRC screen
Expand Down
2 changes: 1 addition & 1 deletion 9-a-library-for-searching-the-file-system.org
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ betterFind (sizeP `equalP` 1024) :: FilePath -> IO [FilePath]
#+END_SRC

Notice that we're not actually calling ~betterFind~, we're merely
making sure that our expression typechecks. We now have a more
making sure that our expression type-checks. We now have a more
expressive way to list all files that are exactly some size. Our
success gives us enough confidence to continue.

Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ typeclass:
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

typecheck:
# No instances of "Typecheck"
sed -i 's/typecheck/type-check/g' *.org

0 comments on commit 897aa30

Please sign in to comment.