Skip to content

Latest commit

 

History

History
23 lines (15 loc) · 464 Bytes

README.md

File metadata and controls

23 lines (15 loc) · 464 Bytes

persistent-generic

Generic facilities for working with Persistent classes.

{-# language DeriveGeneric #-}

module Main where

import Database.Persist.Generic

data StopLight = Red | Yellow | Green
  deriving (Show, Eq, Generic)

instance PersistField StopLight where
  toPersistValue = genericToPersistValue
  fromPersistValue = genericFromPersistValue

Limitations

  • Only PersistField is currently supported.