yesodweb / yesodweb/persistent

Typos in Documentation for Database.Persist.Quasi

Open Beginner friendly
#1,634 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Haskell
Stars
486
Forks
306
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Search the Database.Persist.Quasi documentation for the “Sum types” section and its “Field level” subsection, using the Employment snippet as the entry point. Correct the derivePersistField example and change “strins” to “strings”; done means both typos are fixed in the rendered documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
82/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.