Typos in Documentation for Database.Persist.Quasi

Đang mở Phù hợp với người mới
#1,634 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

@000wahab000 đang làm issue này rồi.

Từ ngày 5/9/2026.

  • #1640 của @000wahab000 — đang mở

Đánh giá

Độ khó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
82/100
Loại issue
Tài liệu
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
haskell
Lĩnh vực
documentation

Hướng nghiên cứu

Tìm trong tài liệu Database.Persist.Quasi phần “Sum types” và tiểu mục “Field level” của phần đó, sử dụng đoạn trích Employment làm điểm bắt đầu. Sửa ví dụ derivePersistField và đổi “strins” thành “strings”; công việc được hoàn tất khi cả hai lỗi chính tả đều được sửa trong tài liệu đã kết xuất.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Haskell
Star
486
Fork
307
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của yesodweb/persistent

Tất cả issue của yesodweb/persistent

Issue tương tự

Thêm issue về Haskell

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.