diff --git a/10-parsing-a-binary-data-format.org b/10-parsing-a-binary-data-format.org index 951ab4c..1cb5bec 100644 --- a/10-parsing-a-binary-data-format.org +++ b/10-parsing-a-binary-data-format.org @@ -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 diff --git a/12-barcode-recognition.org b/12-barcode-recognition.org index 58ca519..cfd3f7a 100644 --- a/12-barcode-recognition.org +++ b/12-barcode-recognition.org @@ -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. diff --git a/26-building-a-bloom-filter.org b/26-building-a-bloom-filter.org index 388f53f..03934e9 100644 --- a/26-building-a-bloom-filter.org +++ b/26-building-a-bloom-filter.org @@ -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. diff --git a/4-functional-programming.org b/4-functional-programming.org index 0cf515f..67da285 100644 --- a/4-functional-programming.org +++ b/4-functional-programming.org @@ -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! diff --git a/5-writing-a-library.org b/5-writing-a-library.org index 5088b30..701ff0e 100644 --- a/5-writing-a-library.org +++ b/5-writing-a-library.org @@ -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 @@ -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 diff --git a/9-a-library-for-searching-the-file-system.org b/9-a-library-for-searching-the-file-system.org index ae8d02c..d85aec4 100644 --- a/9-a-library-for-searching-the-file-system.org +++ b/9-a-library-for-searching-the-file-system.org @@ -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. diff --git a/Makefile b/Makefile index 17a11e3..3994315 100644 --- a/Makefile +++ b/Makefile @@ -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