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

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

data MappingOrigin = SeeTarget
                   | SeeSource
                   | TEST
                   | DGLinkVerif
                   | DGImpliesLink
                   | DGLinkExtension
                   | DGLinkTranslation
                   | DGLinkClosedLenv
                   | DGLinkImports
                   | DGLinkIntersect
                   | DGLinkMorph
                   | DGLinkInst
                   | DGLinkInstArg
                   | DGLinkView
                   | DGLinkAlign
                   | DGLinkFitView
                   | DGLinkFitViewImp
                   | DGLinkProof
                   | DGLinkFlatteningUnion
                   | DGLinkFlatteningRename
                   | DGLinkRefinement
                     deriving MappingOrigin -> MappingOrigin -> Bool
(MappingOrigin -> MappingOrigin -> Bool)
-> (MappingOrigin -> MappingOrigin -> Bool) -> Eq MappingOrigin
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MappingOrigin -> MappingOrigin -> Bool
$c/= :: MappingOrigin -> MappingOrigin -> Bool
== :: MappingOrigin -> MappingOrigin -> Bool
$c== :: MappingOrigin -> MappingOrigin -> Bool
Eq

instance Show MappingOrigin where
  show :: MappingOrigin -> String
show SeeTarget = "see_target"
  show SeeSource = "see_source"
  show TEST = "test"
  show DGLinkVerif = "dg_link_verif"
  show DGImpliesLink = "dg_implies_link"
  show DGLinkExtension = "dg_link_extension"
  show DGLinkTranslation = "dg_link_translation"
  show DGLinkClosedLenv = "dg_link_closed_lenv"
  show DGLinkImports = "dg_link_imports"
  show DGLinkIntersect = "dg_link_intersect"
  show DGLinkMorph = "dg_link_morph"
  show DGLinkInst = "dg_link_inst"
  show DGLinkInstArg = "dg_link_inst_arg"
  show DGLinkView = "dg_link_view"
  show DGLinkAlign = "dg_link_align"
  show DGLinkFitView = "dg_link_fit_view"
  show DGLinkFitViewImp = "dg_link_fit_view_imp"
  show DGLinkProof = "dg_link_proof"
  show DGLinkFlatteningUnion = "dg_link_flattening_union"
  show DGLinkFlatteningRename = "dg_link_flattening_rename"
  show DGLinkRefinement = "dg_link_refinement"

instance Read MappingOrigin where
  readsPrec :: Int -> ReadS MappingOrigin
readsPrec _ input :: String
input
    | MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
SeeTarget String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(MappingOrigin
SeeTarget, 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
$ MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
SeeTarget) String
input)]
    | MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
SeeSource String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(MappingOrigin
SeeSource, 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
$ MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
SeeSource) String
input)]
    | MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
TEST String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(MappingOrigin
TEST, 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
$ MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
TEST) String
input)]
    | MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
DGLinkVerif String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(MappingOrigin
DGLinkVerif, 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
$ MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
DGLinkVerif) String
input)]
    | MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
DGImpliesLink String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(MappingOrigin
DGImpliesLink, 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
$ MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
DGImpliesLink) String
input)]
    | MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
DGLinkExtension String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(MappingOrigin
DGLinkExtension, 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
$ MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
DGLinkExtension) String
input)]
    | MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
DGLinkTranslation String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(MappingOrigin
DGLinkTranslation, 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
$ MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
DGLinkTranslation) String
input)]
    | MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
DGLinkClosedLenv String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(MappingOrigin
DGLinkClosedLenv, 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
$ MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
DGLinkClosedLenv) String
input)]
    | MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
DGLinkImports String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(MappingOrigin
DGLinkImports, 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
$ MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
DGLinkImports) String
input)]
    | MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
DGLinkIntersect String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(MappingOrigin
DGLinkIntersect, 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
$ MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
DGLinkIntersect) String
input)]
    | MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
DGLinkMorph String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(MappingOrigin
DGLinkMorph, 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
$ MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
DGLinkMorph) String
input)]
    | MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
DGLinkInst String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(MappingOrigin
DGLinkInst, 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
$ MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
DGLinkInst) String
input)]
    | MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
DGLinkInstArg String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(MappingOrigin
DGLinkInstArg, 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
$ MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
DGLinkInstArg) String
input)]
    | MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
DGLinkView String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(MappingOrigin
DGLinkView, 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
$ MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
DGLinkView) String
input)]
    | MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
DGLinkAlign String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(MappingOrigin
DGLinkAlign, 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
$ MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
DGLinkAlign) String
input)]
    | MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
DGLinkFitView String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(MappingOrigin
DGLinkFitView, 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
$ MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
DGLinkFitView) String
input)]
    | MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
DGLinkFitViewImp String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(MappingOrigin
DGLinkFitViewImp, 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
$ MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
DGLinkFitViewImp) String
input)]
    | MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
DGLinkProof String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(MappingOrigin
DGLinkProof, 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
$ MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
DGLinkProof) String
input)]
    | MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
DGLinkFlatteningUnion String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(MappingOrigin
DGLinkFlatteningUnion, 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
$ MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
DGLinkFlatteningUnion) String
input)]
    | MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
DGLinkFlatteningRename String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(MappingOrigin
DGLinkFlatteningRename, 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
$ MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
DGLinkFlatteningRename) String
input)]
    | MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
DGLinkRefinement String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
input = [(MappingOrigin
DGLinkRefinement, 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
$ MappingOrigin -> String
forall a. Show a => a -> String
show MappingOrigin
DGLinkRefinement) String
input)]
    | Bool
otherwise = []

derivePersistField "MappingOrigin"