2017-09-16 17:30:28 +00:00
|
|
|
-- This module only exists because of the GHC stage restriction.
|
|
|
|
|
|
|
|
{-# LANGUAGE TemplateHaskell #-}
|
|
|
|
{-# LANGUAGE DeriveGeneric #-}
|
2017-09-22 21:25:13 +00:00
|
|
|
{-# LANGUAGE OverloadedStrings #-}
|
2017-09-16 17:30:28 +00:00
|
|
|
|
|
|
|
module PasteType where
|
|
|
|
|
|
|
|
import Database.Persist.TH
|
|
|
|
import GHC.Generics
|
|
|
|
import Data.Aeson
|
|
|
|
|
|
|
|
data PasteType = PlainText deriving (Show, Read, Eq, Generic)
|
|
|
|
|
2017-09-22 21:25:13 +00:00
|
|
|
instance FromJSON PasteType where
|
|
|
|
parseJSON (String "plain") = return PlainText
|
|
|
|
|
|
|
|
instance ToJSON PasteType where
|
|
|
|
toJSON PlainText = "plain"
|
2017-09-16 17:30:28 +00:00
|
|
|
|
|
|
|
derivePersistField "PasteType"
|