yesodweb/persistent

derivePersistField phantom type support

Open

#1,137 opened on Oct 23, 2020

View on GitHub
 (8 comments) (0 reactions) (1 assignee)Haskell (302 forks)auto 404
Feature Requestgood first issue

Repository metrics

Stars
 (484 stars)
PR merge metrics
 (PR metrics pending)

Description

Phantom types are very useful for tagging things on type level, but at the moment this code will not compile

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

import Database.Persist.TH
import Prelude

data Employment a = Employed | Unemployed | Retired
    deriving (Show, Read, Eq)
derivePersistField "Employment a"

Contributor guide