{-# LANGUAGE TemplateHaskell #-}
module Persistence.Schema.OMSOrigin where

import Data.List (isPrefixOf)
import Database.Persist.TH

data OMSOrigin = DGEmpty
               | DGBasic
               | DGBasicSpec
               | DGExtension
               | DGLogicCoercion
               | DGTranslation
               | DGUnion
               | DGIntersect
               | DGExtract
               | DGRestriction
               | DGRevealTranslation
               | Free -- From DGFreeOrCofree
               | Cofree -- From DGFreeOrCofree
               | NPFree -- From DGFreeOrCofree
               | Minimize -- From DGFreeOrCofree
               | DGLocal
               | DGClosed
               | DGLogicQual
               | DGData
               | DGFormalParams
               | DGVerificationGeneric
               | DGImports
               | DGInst
               | DGFitSpec
               | DGFitView
               | DGProof
               | DGNormalForm
               | DGintegratedSCC
               | DGFlattening
               | DGAlignment
               | DGTest
                 deriving OMSOrigin -> OMSOrigin -> Bool
(OMSOrigin -> OMSOrigin -> Bool)
-> (OMSOrigin -> OMSOrigin -> Bool) -> Eq OMSOrigin
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OMSOrigin -> OMSOrigin -> Bool
$c/= :: OMSOrigin -> OMSOrigin -> Bool
== :: OMSOrigin -> OMSOrigin -> Bool
$c== :: OMSOrigin -> OMSOrigin -> Bool
Eq

instance Show OMSOrigin where
  show :: OMSOrigin -> String
show DGEmpty = "dg_empty"
  show DGBasic = "dg_basic"
  show DGBasicSpec = "dg_basic_spec"
  show DGExtension = "dg_extension"
  show DGLogicCoercion = "dg_logic_coercion"
  show DGTranslation = "dg_translation"
  show DGUnion = "dg_union"
  show DGIntersect = "dg_intersect"
  show DGExtract = "dg_extract"
  show DGRestriction = "dg_restriction"
  show DGRevealTranslation = "dg_reveal_translation"
  show Free = "free"
  show Cofree = "cofree"
  show NPFree = "np_free"
  show Minimize = "minimize"
  show DGLocal = "dg_local"
  show DGClosed = "dg_closed"
  show DGLogicQual = "dg_logic_qual"
  show DGData = "dg_data"
  show DGFormalParams = "dg_formal_params"
  show DGVerificationGeneric = "dg_verification_generic"
  show DGImports = "dg_imports"
  show DGInst = "dg_inst"
  show DGFitSpec = "dg_fit_spec"
  show DGFitView = "dg_fit_view"
  show DGProof = "dg_proof"
  show DGNormalForm = "dg_normal_form"
  show DGintegratedSCC = "dg_integrated_scc"
  show DGFlattening = "dg_flattening"
  show DGAlignment = "dg_alignment"
  show DGTest = "dg_test"

instance Read OMSOrigin where
  readsPrec :: Int -> ReadS OMSOrigin
readsPrec _ input :: String
input
    | OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGEmpty String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(OMSOrigin
DGEmpty, Int -> ShowS
forall a. Int -> [a] -> [a]
drop (String -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length (String -> Int) -> String -> Int
forall a b. (a -> b) -> a -> b
$ OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGEmpty) String
input)]
    | OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGBasic String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(OMSOrigin
DGBasic, Int -> ShowS
forall a. Int -> [a] -> [a]
drop (String -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length (String -> Int) -> String -> Int
forall a b. (a -> b) -> a -> b
$ OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGBasic) String
input)]
    | OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGBasicSpec String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(OMSOrigin
DGBasicSpec, Int -> ShowS
forall a. Int -> [a] -> [a]
drop (String -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length (String -> Int) -> String -> Int
forall a b. (a -> b) -> a -> b
$ OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGBasicSpec) String
input)]
    | OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGExtension String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(OMSOrigin
DGExtension, Int -> ShowS
forall a. Int -> [a] -> [a]
drop (String -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length (String -> Int) -> String -> Int
forall a b. (a -> b) -> a -> b
$ OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGExtension) String
input)]
    | OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGLogicCoercion String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(OMSOrigin
DGLogicCoercion, Int -> ShowS
forall a. Int -> [a] -> [a]
drop (String -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length (String -> Int) -> String -> Int
forall a b. (a -> b) -> a -> b
$ OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGLogicCoercion) String
input)]
    | OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGTranslation String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(OMSOrigin
DGTranslation, Int -> ShowS
forall a. Int -> [a] -> [a]
drop (String -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length (String -> Int) -> String -> Int
forall a b. (a -> b) -> a -> b
$ OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGTranslation) String
input)]
    | OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGUnion String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(OMSOrigin
DGUnion, Int -> ShowS
forall a. Int -> [a] -> [a]
drop (String -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length (String -> Int) -> String -> Int
forall a b. (a -> b) -> a -> b
$ OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGUnion) String
input)]
    | OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGIntersect String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(OMSOrigin
DGIntersect, Int -> ShowS
forall a. Int -> [a] -> [a]
drop (String -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length (String -> Int) -> String -> Int
forall a b. (a -> b) -> a -> b
$ OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGIntersect) String
input)]
    | OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGExtract String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(OMSOrigin
DGExtract, Int -> ShowS
forall a. Int -> [a] -> [a]
drop (String -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length (String -> Int) -> String -> Int
forall a b. (a -> b) -> a -> b
$ OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGExtract) String
input)]
    | OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGRestriction String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(OMSOrigin
DGRestriction, Int -> ShowS
forall a. Int -> [a] -> [a]
drop (String -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length (String -> Int) -> String -> Int
forall a b. (a -> b) -> a -> b
$ OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGRestriction) String
input)]
    | OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGRevealTranslation String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(OMSOrigin
DGRevealTranslation, Int -> ShowS
forall a. Int -> [a] -> [a]
drop (String -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length (String -> Int) -> String -> Int
forall a b. (a -> b) -> a -> b
$ OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGRevealTranslation) String
input)]
    | OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
Free String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(OMSOrigin
Free, Int -> ShowS
forall a. Int -> [a] -> [a]
drop (String -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length (String -> Int) -> String -> Int
forall a b. (a -> b) -> a -> b
$ OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
Free) String
input)]
    | OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
Cofree String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(OMSOrigin
Cofree, Int -> ShowS
forall a. Int -> [a] -> [a]
drop (String -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length (String -> Int) -> String -> Int
forall a b. (a -> b) -> a -> b
$ OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
Cofree) String
input)]
    | OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
NPFree String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(OMSOrigin
NPFree, Int -> ShowS
forall a. Int -> [a] -> [a]
drop (String -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length (String -> Int) -> String -> Int
forall a b. (a -> b) -> a -> b
$ OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
NPFree) String
input)]
    | OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
Minimize String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(OMSOrigin
Minimize, Int -> ShowS
forall a. Int -> [a] -> [a]
drop (String -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length (String -> Int) -> String -> Int
forall a b. (a -> b) -> a -> b
$ OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
Minimize) String
input)]
    | OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGLocal String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(OMSOrigin
DGLocal, Int -> ShowS
forall a. Int -> [a] -> [a]
drop (String -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length (String -> Int) -> String -> Int
forall a b. (a -> b) -> a -> b
$ OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGLocal) String
input)]
    | OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGClosed String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(OMSOrigin
DGClosed, Int -> ShowS
forall a. Int -> [a] -> [a]
drop (String -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length (String -> Int) -> String -> Int
forall a b. (a -> b) -> a -> b
$ OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGClosed) String
input)]
    | OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGLogicQual String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(OMSOrigin
DGLogicQual, Int -> ShowS
forall a. Int -> [a] -> [a]
drop (String -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length (String -> Int) -> String -> Int
forall a b. (a -> b) -> a -> b
$ OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGLogicQual) String
input)]
    | OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGData String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(OMSOrigin
DGData, Int -> ShowS
forall a. Int -> [a] -> [a]
drop (String -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length (String -> Int) -> String -> Int
forall a b. (a -> b) -> a -> b
$ OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGData) String
input)]
    | OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGFormalParams String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(OMSOrigin
DGFormalParams, Int -> ShowS
forall a. Int -> [a] -> [a]
drop (String -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length (String -> Int) -> String -> Int
forall a b. (a -> b) -> a -> b
$ OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGFormalParams) String
input)]
    | OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGVerificationGeneric String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(OMSOrigin
DGVerificationGeneric, Int -> ShowS
forall a. Int -> [a] -> [a]
drop (String -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length (String -> Int) -> String -> Int
forall a b. (a -> b) -> a -> b
$ OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGVerificationGeneric) String
input)]
    | OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGImports String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(OMSOrigin
DGImports, Int -> ShowS
forall a. Int -> [a] -> [a]
drop (String -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length (String -> Int) -> String -> Int
forall a b. (a -> b) -> a -> b
$ OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGImports) String
input)]
    | OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGInst String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(OMSOrigin
DGInst, Int -> ShowS
forall a. Int -> [a] -> [a]
drop (String -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length (String -> Int) -> String -> Int
forall a b. (a -> b) -> a -> b
$ OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGInst) String
input)]
    | OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGFitSpec String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(OMSOrigin
DGFitSpec, Int -> ShowS
forall a. Int -> [a] -> [a]
drop (String -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length (String -> Int) -> String -> Int
forall a b. (a -> b) -> a -> b
$ OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGFitSpec) String
input)]
    | OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGFitView String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(OMSOrigin
DGFitView, Int -> ShowS
forall a. Int -> [a] -> [a]
drop (String -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length (String -> Int) -> String -> Int
forall a b. (a -> b) -> a -> b
$ OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGFitView) String
input)]
    | OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGProof String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(OMSOrigin
DGProof, Int -> ShowS
forall a. Int -> [a] -> [a]
drop (String -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length (String -> Int) -> String -> Int
forall a b. (a -> b) -> a -> b
$ OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGProof) String
input)]
    | OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGNormalForm String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(OMSOrigin
DGNormalForm, Int -> ShowS
forall a. Int -> [a] -> [a]
drop (String -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length (String -> Int) -> String -> Int
forall a b. (a -> b) -> a -> b
$ OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGNormalForm) String
input)]
    | OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGintegratedSCC String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(OMSOrigin
DGintegratedSCC, Int -> ShowS
forall a. Int -> [a] -> [a]
drop (String -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length (String -> Int) -> String -> Int
forall a b. (a -> b) -> a -> b
$ OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGintegratedSCC) String
input)]
    | OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGFlattening String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(OMSOrigin
DGFlattening, Int -> ShowS
forall a. Int -> [a] -> [a]
drop (String -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length (String -> Int) -> String -> Int
forall a b. (a -> b) -> a -> b
$ OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGFlattening) String
input)]
    | OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGAlignment String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(OMSOrigin
DGAlignment, Int -> ShowS
forall a. Int -> [a] -> [a]
drop (String -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length (String -> Int) -> String -> Int
forall a b. (a -> b) -> a -> b
$ OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGAlignment) String
input)]
    | OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGTest String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(OMSOrigin
DGTest, Int -> ShowS
forall a. Int -> [a] -> [a]
drop (String -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length (String -> Int) -> String -> Int
forall a b. (a -> b) -> a -> b
$ OMSOrigin -> String
forall a. Show a => a -> String
show OMSOrigin
DGTest) String
input)]
    | Bool
otherwise = []

derivePersistField "OMSOrigin"