# Effective Haskell: Chapter 12 - missing some code on p.438 (B9 - PDF version)

**URL:** <https://forum.devtalk.com/t/effective-haskell-chapter-12-missing-some-code-on-p-438-b9-pdf-version/118287>\
**Category:** PragProg Customers\
**Tags:** book-effective-haskell, errata\
**Created:** [28 July 2023 23:55 UTC](https://forum.devtalk.com/t/effective-haskell-chapter-12-missing-some-code-on-p-438-b9-pdf-version/118287 "2023-07-28T23:55:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![andre](https://forum.devtalk.com/letter_avatar_proxy/v4/letter/a/6de8d8/32.png) [@andre](https://forum.devtalk.com/u/andre)\
**Post date:** [28 July 2023 23:55 UTC](https://forum.devtalk.com/t/effective-haskell-chapter-12-missing-some-code-on-p-438-b9-pdf-version/118287/1 "2023-07-28T23:55:02Z")

</div>

@RebeccaSkinner

Chapter 12 starts with the code for the File Archive builder from the bottom of p.438 to p.440.

If the intention was to provide the complete version built during Chapter 11, the definition of the Encode typeclass is missing.

We can find it on p.418-419, which is

```auto
class Encode a where
  encode :: a -> ByteString
  encode = BS.drop 4 .encodeWithSize
  
  encodeWithSize :: a -> ByteString
  encodeWithSize a = 
    let s = encode a
        l = fromIntegral $ BS.length s
    in word32ToByteString l <> s
    
  {-# MINIMAL encode | encodeWithSize #-}

```
