Skip to content

Typos in Documentation for Database.Persist.Quasi #1634

Description

@YZmarkS

Typo 1: Database.Persist.Quasi, section "Sum types", subsection "Field level"

In the subsection, one can find the following code snippet:

-- @Employment.hs
{-# LANGUAGE TemplateHaskell #-}
module Employment where

import Database.Persist.TH
import Prelude

data Employment = Employed | Unemployed | Retired
    deriving (Show, Read, Eq)
derivePersistField Employment       <-------

However, copying this code directly will result in the following error:

Illegal term-level use of the type constructor or class 'Employment'
...
In the first argument of 'derivedPersistField', namely
  'Employment'
In the expression: derivePersistField Employment [GHC-31891]

This was likely a typo; changing Employment to "Employment" as a string seems to solve the issue.

Typo 2:

Right under the code snippet of the previous typo, there was the following passage:

derivePersistField stores sum type values as strins in the database. While not as efficient as using integers, this approach simplifies adding and removing values from your enumeration.

The strins likely should have been strings.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions