Skip to content

Commit

Permalink
Add Data & Typeable instance support for Entities
Browse files Browse the repository at this point in the history
  • Loading branch information
iand675 committed Mar 31, 2021
1 parent 0926409 commit 9cb00b9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions persistent/Database/Persist/Class/PersistEntity.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE ScopedTypeVariables #-}
Expand Down Expand Up @@ -37,10 +38,12 @@ import qualified Data.Aeson.Parser as AP
import Data.Aeson.Types (Parser,Result(Error,Success))
import Data.Aeson.Text (encodeToTextBuilder)
import Data.Attoparsec.ByteString (parseOnly)
import Data.Data (Data)
import qualified Data.HashMap.Strict as HM
import Data.Maybe (isJust)
import Data.Monoid (mappend)
import Data.Text (Text)
import Data.Typeable (Typeable)
import qualified Data.Text as T
import qualified Data.Text.Encoding as TE
import qualified Data.Text.Lazy as LT
Expand Down Expand Up @@ -221,6 +224,8 @@ deriving instance (Eq (Key record), Eq record) => Eq (Entity record)
deriving instance (Ord (Key record), Ord record) => Ord (Entity record)
deriving instance (Show (Key record), Show record) => Show (Entity record)
deriving instance (Read (Key record), Read record) => Read (Entity record)
deriving instance (Data (Key record), Data record) => Data (Entity record)
deriving instance (Typeable (Key record), Typeable record) => Typeable (Entity record)

-- | Get list of values corresponding to given entity.
entityValues :: PersistEntity record => Entity record -> [PersistValue]
Expand Down

0 comments on commit 9cb00b9

Please sign in to comment.