{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
module Poseidon.ColumnTypes where
import Poseidon.ColumnTypesUtils
import Country (Country, alphaTwoUpper,
decodeAlphaTwo)
import qualified Data.Csv as Csv
import qualified Data.Text as T
import qualified Data.Text.Read as T
import GHC.Generics (Generic)
import Network.URI (isURIReference)
import SequenceFormats.Eigenstrat (Sex (..))
import qualified Text.Regex.TDFA as Reg
newtype GeneticSex = GeneticSex { GeneticSex -> Sex
sfSex :: Sex } deriving (GeneticSex -> GeneticSex -> Bool
(GeneticSex -> GeneticSex -> Bool)
-> (GeneticSex -> GeneticSex -> Bool) -> Eq GeneticSex
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GeneticSex -> GeneticSex -> Bool
== :: GeneticSex -> GeneticSex -> Bool
$c/= :: GeneticSex -> GeneticSex -> Bool
/= :: GeneticSex -> GeneticSex -> Bool
Eq)
instance Makeable GeneticSex where
make :: forall (m :: * -> *). MonadFail m => Text -> m GeneticSex
make Text
x
| Text
x Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
"F" = GeneticSex -> m GeneticSex
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Sex -> GeneticSex
GeneticSex Sex
Female)
| Text
x Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
"M" = GeneticSex -> m GeneticSex
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Sex -> GeneticSex
GeneticSex Sex
Male)
| Text
x Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
"U" = GeneticSex -> m GeneticSex
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Sex -> GeneticSex
GeneticSex Sex
Unknown)
| Bool
otherwise = [Char] -> m GeneticSex
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m GeneticSex) -> [Char] -> m GeneticSex
forall a b. (a -> b) -> a -> b
$ [Char]
"Genetic_Sex is set to " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Text -> [Char]
forall a. Show a => a -> [Char]
show Text
x [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
". " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++
[Char]
"That is not in the allowed set [F, M, U]."
instance Show GeneticSex where
show :: GeneticSex -> [Char]
show (GeneticSex Sex
Female) = [Char]
"F"
show (GeneticSex Sex
Male) = [Char]
"M"
show (GeneticSex Sex
Unknown) = [Char]
"U"
instance Ord GeneticSex where
compare :: GeneticSex -> GeneticSex -> Ordering
compare (GeneticSex Sex
Female) (GeneticSex Sex
Male) = Ordering
GT
compare (GeneticSex Sex
Male) (GeneticSex Sex
Female) = Ordering
LT
compare (GeneticSex Sex
Male) (GeneticSex Sex
Unknown) = Ordering
GT
compare (GeneticSex Sex
Unknown) (GeneticSex Sex
Male) = Ordering
LT
compare (GeneticSex Sex
Female) (GeneticSex Sex
Unknown) = Ordering
GT
compare (GeneticSex Sex
Unknown) (GeneticSex Sex
Female) = Ordering
LT
compare GeneticSex
_ GeneticSex
_ = Ordering
EQ
instance Csv.ToField GeneticSex where toField :: GeneticSex -> Field
toField GeneticSex
x = [Char] -> Field
forall a. ToField a => a -> Field
Csv.toField ([Char] -> Field) -> [Char] -> Field
forall a b. (a -> b) -> a -> b
$ GeneticSex -> [Char]
forall a. Show a => a -> [Char]
show GeneticSex
x
instance Csv.FromField GeneticSex where parseField :: Field -> Parser GeneticSex
parseField = [Char] -> Field -> Parser GeneticSex
forall a (m :: * -> *).
(MonadFail m, Makeable a, Typeable a) =>
[Char] -> Field -> m a
parseTypeCSV [Char]
"Genetic_Sex"
newtype GroupName = GroupName T.Text deriving (GroupName -> GroupName -> Bool
(GroupName -> GroupName -> Bool)
-> (GroupName -> GroupName -> Bool) -> Eq GroupName
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GroupName -> GroupName -> Bool
== :: GroupName -> GroupName -> Bool
$c/= :: GroupName -> GroupName -> Bool
/= :: GroupName -> GroupName -> Bool
Eq, Eq GroupName
Eq GroupName
-> (GroupName -> GroupName -> Ordering)
-> (GroupName -> GroupName -> Bool)
-> (GroupName -> GroupName -> Bool)
-> (GroupName -> GroupName -> Bool)
-> (GroupName -> GroupName -> Bool)
-> (GroupName -> GroupName -> GroupName)
-> (GroupName -> GroupName -> GroupName)
-> Ord GroupName
GroupName -> GroupName -> Bool
GroupName -> GroupName -> Ordering
GroupName -> GroupName -> GroupName
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: GroupName -> GroupName -> Ordering
compare :: GroupName -> GroupName -> Ordering
$c< :: GroupName -> GroupName -> Bool
< :: GroupName -> GroupName -> Bool
$c<= :: GroupName -> GroupName -> Bool
<= :: GroupName -> GroupName -> Bool
$c> :: GroupName -> GroupName -> Bool
> :: GroupName -> GroupName -> Bool
$c>= :: GroupName -> GroupName -> Bool
>= :: GroupName -> GroupName -> Bool
$cmax :: GroupName -> GroupName -> GroupName
max :: GroupName -> GroupName -> GroupName
$cmin :: GroupName -> GroupName -> GroupName
min :: GroupName -> GroupName -> GroupName
Ord)
$(makeInstances ''GroupName "Group_Name")
newtype JannoAlternativeID = JannoAlternativeID T.Text deriving (JannoAlternativeID -> JannoAlternativeID -> Bool
(JannoAlternativeID -> JannoAlternativeID -> Bool)
-> (JannoAlternativeID -> JannoAlternativeID -> Bool)
-> Eq JannoAlternativeID
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoAlternativeID -> JannoAlternativeID -> Bool
== :: JannoAlternativeID -> JannoAlternativeID -> Bool
$c/= :: JannoAlternativeID -> JannoAlternativeID -> Bool
/= :: JannoAlternativeID -> JannoAlternativeID -> Bool
Eq)
$(makeInstances ''JannoAlternativeID "Alternative_IDs")
newtype JannoRelationTo = JannoRelationTo T.Text deriving (JannoRelationTo -> JannoRelationTo -> Bool
(JannoRelationTo -> JannoRelationTo -> Bool)
-> (JannoRelationTo -> JannoRelationTo -> Bool)
-> Eq JannoRelationTo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoRelationTo -> JannoRelationTo -> Bool
== :: JannoRelationTo -> JannoRelationTo -> Bool
$c/= :: JannoRelationTo -> JannoRelationTo -> Bool
/= :: JannoRelationTo -> JannoRelationTo -> Bool
Eq)
$(makeInstances ''JannoRelationTo "Relation_To")
data JannoRelationDegree =
Identical
| First
| Second
| ThirdToFifth
| SixthToTenth
| Unrelated
| OtherDegree
deriving (JannoRelationDegree -> JannoRelationDegree -> Bool
(JannoRelationDegree -> JannoRelationDegree -> Bool)
-> (JannoRelationDegree -> JannoRelationDegree -> Bool)
-> Eq JannoRelationDegree
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoRelationDegree -> JannoRelationDegree -> Bool
== :: JannoRelationDegree -> JannoRelationDegree -> Bool
$c/= :: JannoRelationDegree -> JannoRelationDegree -> Bool
/= :: JannoRelationDegree -> JannoRelationDegree -> Bool
Eq, Eq JannoRelationDegree
Eq JannoRelationDegree
-> (JannoRelationDegree -> JannoRelationDegree -> Ordering)
-> (JannoRelationDegree -> JannoRelationDegree -> Bool)
-> (JannoRelationDegree -> JannoRelationDegree -> Bool)
-> (JannoRelationDegree -> JannoRelationDegree -> Bool)
-> (JannoRelationDegree -> JannoRelationDegree -> Bool)
-> (JannoRelationDegree
-> JannoRelationDegree -> JannoRelationDegree)
-> (JannoRelationDegree
-> JannoRelationDegree -> JannoRelationDegree)
-> Ord JannoRelationDegree
JannoRelationDegree -> JannoRelationDegree -> Bool
JannoRelationDegree -> JannoRelationDegree -> Ordering
JannoRelationDegree -> JannoRelationDegree -> JannoRelationDegree
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: JannoRelationDegree -> JannoRelationDegree -> Ordering
compare :: JannoRelationDegree -> JannoRelationDegree -> Ordering
$c< :: JannoRelationDegree -> JannoRelationDegree -> Bool
< :: JannoRelationDegree -> JannoRelationDegree -> Bool
$c<= :: JannoRelationDegree -> JannoRelationDegree -> Bool
<= :: JannoRelationDegree -> JannoRelationDegree -> Bool
$c> :: JannoRelationDegree -> JannoRelationDegree -> Bool
> :: JannoRelationDegree -> JannoRelationDegree -> Bool
$c>= :: JannoRelationDegree -> JannoRelationDegree -> Bool
>= :: JannoRelationDegree -> JannoRelationDegree -> Bool
$cmax :: JannoRelationDegree -> JannoRelationDegree -> JannoRelationDegree
max :: JannoRelationDegree -> JannoRelationDegree -> JannoRelationDegree
$cmin :: JannoRelationDegree -> JannoRelationDegree -> JannoRelationDegree
min :: JannoRelationDegree -> JannoRelationDegree -> JannoRelationDegree
Ord, (forall x. JannoRelationDegree -> Rep JannoRelationDegree x)
-> (forall x. Rep JannoRelationDegree x -> JannoRelationDegree)
-> Generic JannoRelationDegree
forall x. Rep JannoRelationDegree x -> JannoRelationDegree
forall x. JannoRelationDegree -> Rep JannoRelationDegree x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. JannoRelationDegree -> Rep JannoRelationDegree x
from :: forall x. JannoRelationDegree -> Rep JannoRelationDegree x
$cto :: forall x. Rep JannoRelationDegree x -> JannoRelationDegree
to :: forall x. Rep JannoRelationDegree x -> JannoRelationDegree
Generic, Int -> JannoRelationDegree
JannoRelationDegree -> Int
JannoRelationDegree -> [JannoRelationDegree]
JannoRelationDegree -> JannoRelationDegree
JannoRelationDegree -> JannoRelationDegree -> [JannoRelationDegree]
JannoRelationDegree
-> JannoRelationDegree
-> JannoRelationDegree
-> [JannoRelationDegree]
(JannoRelationDegree -> JannoRelationDegree)
-> (JannoRelationDegree -> JannoRelationDegree)
-> (Int -> JannoRelationDegree)
-> (JannoRelationDegree -> Int)
-> (JannoRelationDegree -> [JannoRelationDegree])
-> (JannoRelationDegree
-> JannoRelationDegree -> [JannoRelationDegree])
-> (JannoRelationDegree
-> JannoRelationDegree -> [JannoRelationDegree])
-> (JannoRelationDegree
-> JannoRelationDegree
-> JannoRelationDegree
-> [JannoRelationDegree])
-> Enum JannoRelationDegree
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: JannoRelationDegree -> JannoRelationDegree
succ :: JannoRelationDegree -> JannoRelationDegree
$cpred :: JannoRelationDegree -> JannoRelationDegree
pred :: JannoRelationDegree -> JannoRelationDegree
$ctoEnum :: Int -> JannoRelationDegree
toEnum :: Int -> JannoRelationDegree
$cfromEnum :: JannoRelationDegree -> Int
fromEnum :: JannoRelationDegree -> Int
$cenumFrom :: JannoRelationDegree -> [JannoRelationDegree]
enumFrom :: JannoRelationDegree -> [JannoRelationDegree]
$cenumFromThen :: JannoRelationDegree -> JannoRelationDegree -> [JannoRelationDegree]
enumFromThen :: JannoRelationDegree -> JannoRelationDegree -> [JannoRelationDegree]
$cenumFromTo :: JannoRelationDegree -> JannoRelationDegree -> [JannoRelationDegree]
enumFromTo :: JannoRelationDegree -> JannoRelationDegree -> [JannoRelationDegree]
$cenumFromThenTo :: JannoRelationDegree
-> JannoRelationDegree
-> JannoRelationDegree
-> [JannoRelationDegree]
enumFromThenTo :: JannoRelationDegree
-> JannoRelationDegree
-> JannoRelationDegree
-> [JannoRelationDegree]
Enum, JannoRelationDegree
JannoRelationDegree
-> JannoRelationDegree -> Bounded JannoRelationDegree
forall a. a -> a -> Bounded a
$cminBound :: JannoRelationDegree
minBound :: JannoRelationDegree
$cmaxBound :: JannoRelationDegree
maxBound :: JannoRelationDegree
Bounded)
instance Makeable JannoRelationDegree where
make :: forall (m :: * -> *). MonadFail m => Text -> m JannoRelationDegree
make Text
x
| Text
x Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
"identical" = JannoRelationDegree -> m JannoRelationDegree
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure JannoRelationDegree
Identical
| Text
x Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
"first" = JannoRelationDegree -> m JannoRelationDegree
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure JannoRelationDegree
First
| Text
x Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
"second" = JannoRelationDegree -> m JannoRelationDegree
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure JannoRelationDegree
Second
| Text
x Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
"thirdToFifth" = JannoRelationDegree -> m JannoRelationDegree
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure JannoRelationDegree
ThirdToFifth
| Text
x Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
"sixthToTenth" = JannoRelationDegree -> m JannoRelationDegree
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure JannoRelationDegree
SixthToTenth
| Text
x Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
"unrelated" = JannoRelationDegree -> m JannoRelationDegree
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure JannoRelationDegree
Unrelated
| Text
x Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
"other" = JannoRelationDegree -> m JannoRelationDegree
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure JannoRelationDegree
OtherDegree
| Bool
otherwise = [Char] -> m JannoRelationDegree
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoRelationDegree)
-> [Char] -> m JannoRelationDegree
forall a b. (a -> b) -> a -> b
$ [Char]
"Relation_Degree is set to " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Text -> [Char]
forall a. Show a => a -> [Char]
show Text
x [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
". " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++
[Char]
"That is not in the allowed set [identical, first, second, thirdToFifth, sixthToTenth, other]."
instance Show JannoRelationDegree where
show :: JannoRelationDegree -> [Char]
show JannoRelationDegree
Identical = [Char]
"identical"
show JannoRelationDegree
First = [Char]
"first"
show JannoRelationDegree
Second = [Char]
"second"
show JannoRelationDegree
ThirdToFifth = [Char]
"thirdToFifth"
show JannoRelationDegree
SixthToTenth = [Char]
"sixthToTenth"
show JannoRelationDegree
Unrelated = [Char]
"unrelated"
show JannoRelationDegree
OtherDegree = [Char]
"other"
instance Csv.ToField JannoRelationDegree where toField :: JannoRelationDegree -> Field
toField JannoRelationDegree
x = [Char] -> Field
forall a. ToField a => a -> Field
Csv.toField ([Char] -> Field) -> [Char] -> Field
forall a b. (a -> b) -> a -> b
$ JannoRelationDegree -> [Char]
forall a. Show a => a -> [Char]
show JannoRelationDegree
x
instance Csv.FromField JannoRelationDegree where parseField :: Field -> Parser JannoRelationDegree
parseField = [Char] -> Field -> Parser JannoRelationDegree
forall a (m :: * -> *).
(MonadFail m, Makeable a, Typeable a) =>
[Char] -> Field -> m a
parseTypeCSV [Char]
"Relation_Degree"
newtype JannoRelationType = JannoRelationType T.Text deriving (JannoRelationType -> JannoRelationType -> Bool
(JannoRelationType -> JannoRelationType -> Bool)
-> (JannoRelationType -> JannoRelationType -> Bool)
-> Eq JannoRelationType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoRelationType -> JannoRelationType -> Bool
== :: JannoRelationType -> JannoRelationType -> Bool
$c/= :: JannoRelationType -> JannoRelationType -> Bool
/= :: JannoRelationType -> JannoRelationType -> Bool
Eq)
$(makeInstances ''JannoRelationType "Relation_Type")
newtype JannoRelationNote = JannoRelationNote T.Text deriving (JannoRelationNote -> JannoRelationNote -> Bool
(JannoRelationNote -> JannoRelationNote -> Bool)
-> (JannoRelationNote -> JannoRelationNote -> Bool)
-> Eq JannoRelationNote
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoRelationNote -> JannoRelationNote -> Bool
== :: JannoRelationNote -> JannoRelationNote -> Bool
$c/= :: JannoRelationNote -> JannoRelationNote -> Bool
/= :: JannoRelationNote -> JannoRelationNote -> Bool
Eq)
$(makeInstances ''JannoRelationNote "Relation_Note")
newtype JannoCollectionID = JannoCollectionID T.Text deriving (JannoCollectionID -> JannoCollectionID -> Bool
(JannoCollectionID -> JannoCollectionID -> Bool)
-> (JannoCollectionID -> JannoCollectionID -> Bool)
-> Eq JannoCollectionID
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoCollectionID -> JannoCollectionID -> Bool
== :: JannoCollectionID -> JannoCollectionID -> Bool
$c/= :: JannoCollectionID -> JannoCollectionID -> Bool
/= :: JannoCollectionID -> JannoCollectionID -> Bool
Eq)
$(makeInstances ''JannoCollectionID "Collection_ID")
newtype JannoCountry = JannoCountry T.Text deriving (JannoCountry -> JannoCountry -> Bool
(JannoCountry -> JannoCountry -> Bool)
-> (JannoCountry -> JannoCountry -> Bool) -> Eq JannoCountry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoCountry -> JannoCountry -> Bool
== :: JannoCountry -> JannoCountry -> Bool
$c/= :: JannoCountry -> JannoCountry -> Bool
/= :: JannoCountry -> JannoCountry -> Bool
Eq, Eq JannoCountry
Eq JannoCountry
-> (JannoCountry -> JannoCountry -> Ordering)
-> (JannoCountry -> JannoCountry -> Bool)
-> (JannoCountry -> JannoCountry -> Bool)
-> (JannoCountry -> JannoCountry -> Bool)
-> (JannoCountry -> JannoCountry -> Bool)
-> (JannoCountry -> JannoCountry -> JannoCountry)
-> (JannoCountry -> JannoCountry -> JannoCountry)
-> Ord JannoCountry
JannoCountry -> JannoCountry -> Bool
JannoCountry -> JannoCountry -> Ordering
JannoCountry -> JannoCountry -> JannoCountry
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: JannoCountry -> JannoCountry -> Ordering
compare :: JannoCountry -> JannoCountry -> Ordering
$c< :: JannoCountry -> JannoCountry -> Bool
< :: JannoCountry -> JannoCountry -> Bool
$c<= :: JannoCountry -> JannoCountry -> Bool
<= :: JannoCountry -> JannoCountry -> Bool
$c> :: JannoCountry -> JannoCountry -> Bool
> :: JannoCountry -> JannoCountry -> Bool
$c>= :: JannoCountry -> JannoCountry -> Bool
>= :: JannoCountry -> JannoCountry -> Bool
$cmax :: JannoCountry -> JannoCountry -> JannoCountry
max :: JannoCountry -> JannoCountry -> JannoCountry
$cmin :: JannoCountry -> JannoCountry -> JannoCountry
min :: JannoCountry -> JannoCountry -> JannoCountry
Ord)
$(makeInstances ''JannoCountry "Country")
newtype JannoCountryISO = JannoCountryISO Country deriving (JannoCountryISO -> JannoCountryISO -> Bool
(JannoCountryISO -> JannoCountryISO -> Bool)
-> (JannoCountryISO -> JannoCountryISO -> Bool)
-> Eq JannoCountryISO
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoCountryISO -> JannoCountryISO -> Bool
== :: JannoCountryISO -> JannoCountryISO -> Bool
$c/= :: JannoCountryISO -> JannoCountryISO -> Bool
/= :: JannoCountryISO -> JannoCountryISO -> Bool
Eq, Eq JannoCountryISO
Eq JannoCountryISO
-> (JannoCountryISO -> JannoCountryISO -> Ordering)
-> (JannoCountryISO -> JannoCountryISO -> Bool)
-> (JannoCountryISO -> JannoCountryISO -> Bool)
-> (JannoCountryISO -> JannoCountryISO -> Bool)
-> (JannoCountryISO -> JannoCountryISO -> Bool)
-> (JannoCountryISO -> JannoCountryISO -> JannoCountryISO)
-> (JannoCountryISO -> JannoCountryISO -> JannoCountryISO)
-> Ord JannoCountryISO
JannoCountryISO -> JannoCountryISO -> Bool
JannoCountryISO -> JannoCountryISO -> Ordering
JannoCountryISO -> JannoCountryISO -> JannoCountryISO
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: JannoCountryISO -> JannoCountryISO -> Ordering
compare :: JannoCountryISO -> JannoCountryISO -> Ordering
$c< :: JannoCountryISO -> JannoCountryISO -> Bool
< :: JannoCountryISO -> JannoCountryISO -> Bool
$c<= :: JannoCountryISO -> JannoCountryISO -> Bool
<= :: JannoCountryISO -> JannoCountryISO -> Bool
$c> :: JannoCountryISO -> JannoCountryISO -> Bool
> :: JannoCountryISO -> JannoCountryISO -> Bool
$c>= :: JannoCountryISO -> JannoCountryISO -> Bool
>= :: JannoCountryISO -> JannoCountryISO -> Bool
$cmax :: JannoCountryISO -> JannoCountryISO -> JannoCountryISO
max :: JannoCountryISO -> JannoCountryISO -> JannoCountryISO
$cmin :: JannoCountryISO -> JannoCountryISO -> JannoCountryISO
min :: JannoCountryISO -> JannoCountryISO -> JannoCountryISO
Ord)
instance Show JannoCountryISO where
show :: JannoCountryISO -> [Char]
show (JannoCountryISO Country
x) = Text -> [Char]
T.unpack (Text -> [Char]) -> Text -> [Char]
forall a b. (a -> b) -> a -> b
$ Country -> Text
alphaTwoUpper Country
x
instance Makeable JannoCountryISO where
make :: forall (m :: * -> *). MonadFail m => Text -> m JannoCountryISO
make Text
x = case Text -> Maybe Country
decodeAlphaTwo Text
x of
Maybe Country
Nothing -> [Char] -> m JannoCountryISO
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoCountryISO) -> [Char] -> m JannoCountryISO
forall a b. (a -> b) -> a -> b
$
[Char]
"Country_ISO is set to " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Text -> [Char]
forall a. Show a => a -> [Char]
show Text
x [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
". " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++
[Char]
"That is not a valid ISO-alpha2 code describing an existing country."
Just Country
c -> JannoCountryISO -> m JannoCountryISO
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (JannoCountryISO -> m JannoCountryISO)
-> JannoCountryISO -> m JannoCountryISO
forall a b. (a -> b) -> a -> b
$ Country -> JannoCountryISO
JannoCountryISO Country
c
instance Csv.ToField JannoCountryISO where toField :: JannoCountryISO -> Field
toField JannoCountryISO
x = [Char] -> Field
forall a. ToField a => a -> Field
Csv.toField ([Char] -> Field) -> [Char] -> Field
forall a b. (a -> b) -> a -> b
$ JannoCountryISO -> [Char]
forall a. Show a => a -> [Char]
show JannoCountryISO
x
instance Csv.FromField JannoCountryISO where parseField :: Field -> Parser JannoCountryISO
parseField = [Char] -> Field -> Parser JannoCountryISO
forall a (m :: * -> *).
(MonadFail m, Makeable a, Typeable a) =>
[Char] -> Field -> m a
parseTypeCSV [Char]
"Country_ISO"
newtype JannoLocation = JannoLocation T.Text deriving (JannoLocation -> JannoLocation -> Bool
(JannoLocation -> JannoLocation -> Bool)
-> (JannoLocation -> JannoLocation -> Bool) -> Eq JannoLocation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoLocation -> JannoLocation -> Bool
== :: JannoLocation -> JannoLocation -> Bool
$c/= :: JannoLocation -> JannoLocation -> Bool
/= :: JannoLocation -> JannoLocation -> Bool
Eq)
$(makeInstances ''JannoLocation "Location")
newtype JannoSite = JannoSite T.Text deriving (JannoSite -> JannoSite -> Bool
(JannoSite -> JannoSite -> Bool)
-> (JannoSite -> JannoSite -> Bool) -> Eq JannoSite
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoSite -> JannoSite -> Bool
== :: JannoSite -> JannoSite -> Bool
$c/= :: JannoSite -> JannoSite -> Bool
/= :: JannoSite -> JannoSite -> Bool
Eq, Eq JannoSite
Eq JannoSite
-> (JannoSite -> JannoSite -> Ordering)
-> (JannoSite -> JannoSite -> Bool)
-> (JannoSite -> JannoSite -> Bool)
-> (JannoSite -> JannoSite -> Bool)
-> (JannoSite -> JannoSite -> Bool)
-> (JannoSite -> JannoSite -> JannoSite)
-> (JannoSite -> JannoSite -> JannoSite)
-> Ord JannoSite
JannoSite -> JannoSite -> Bool
JannoSite -> JannoSite -> Ordering
JannoSite -> JannoSite -> JannoSite
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: JannoSite -> JannoSite -> Ordering
compare :: JannoSite -> JannoSite -> Ordering
$c< :: JannoSite -> JannoSite -> Bool
< :: JannoSite -> JannoSite -> Bool
$c<= :: JannoSite -> JannoSite -> Bool
<= :: JannoSite -> JannoSite -> Bool
$c> :: JannoSite -> JannoSite -> Bool
> :: JannoSite -> JannoSite -> Bool
$c>= :: JannoSite -> JannoSite -> Bool
>= :: JannoSite -> JannoSite -> Bool
$cmax :: JannoSite -> JannoSite -> JannoSite
max :: JannoSite -> JannoSite -> JannoSite
$cmin :: JannoSite -> JannoSite -> JannoSite
min :: JannoSite -> JannoSite -> JannoSite
Ord)
$(makeInstances ''JannoSite "Site")
newtype JannoLatitude = JannoLatitude Double deriving (JannoLatitude -> JannoLatitude -> Bool
(JannoLatitude -> JannoLatitude -> Bool)
-> (JannoLatitude -> JannoLatitude -> Bool) -> Eq JannoLatitude
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoLatitude -> JannoLatitude -> Bool
== :: JannoLatitude -> JannoLatitude -> Bool
$c/= :: JannoLatitude -> JannoLatitude -> Bool
/= :: JannoLatitude -> JannoLatitude -> Bool
Eq, Eq JannoLatitude
Eq JannoLatitude
-> (JannoLatitude -> JannoLatitude -> Ordering)
-> (JannoLatitude -> JannoLatitude -> Bool)
-> (JannoLatitude -> JannoLatitude -> Bool)
-> (JannoLatitude -> JannoLatitude -> Bool)
-> (JannoLatitude -> JannoLatitude -> Bool)
-> (JannoLatitude -> JannoLatitude -> JannoLatitude)
-> (JannoLatitude -> JannoLatitude -> JannoLatitude)
-> Ord JannoLatitude
JannoLatitude -> JannoLatitude -> Bool
JannoLatitude -> JannoLatitude -> Ordering
JannoLatitude -> JannoLatitude -> JannoLatitude
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: JannoLatitude -> JannoLatitude -> Ordering
compare :: JannoLatitude -> JannoLatitude -> Ordering
$c< :: JannoLatitude -> JannoLatitude -> Bool
< :: JannoLatitude -> JannoLatitude -> Bool
$c<= :: JannoLatitude -> JannoLatitude -> Bool
<= :: JannoLatitude -> JannoLatitude -> Bool
$c> :: JannoLatitude -> JannoLatitude -> Bool
> :: JannoLatitude -> JannoLatitude -> Bool
$c>= :: JannoLatitude -> JannoLatitude -> Bool
>= :: JannoLatitude -> JannoLatitude -> Bool
$cmax :: JannoLatitude -> JannoLatitude -> JannoLatitude
max :: JannoLatitude -> JannoLatitude -> JannoLatitude
$cmin :: JannoLatitude -> JannoLatitude -> JannoLatitude
min :: JannoLatitude -> JannoLatitude -> JannoLatitude
Ord, (forall x. JannoLatitude -> Rep JannoLatitude x)
-> (forall x. Rep JannoLatitude x -> JannoLatitude)
-> Generic JannoLatitude
forall x. Rep JannoLatitude x -> JannoLatitude
forall x. JannoLatitude -> Rep JannoLatitude x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. JannoLatitude -> Rep JannoLatitude x
from :: forall x. JannoLatitude -> Rep JannoLatitude x
$cto :: forall x. Rep JannoLatitude x -> JannoLatitude
to :: forall x. Rep JannoLatitude x -> JannoLatitude
Generic)
instance Makeable JannoLatitude where
make :: forall (m :: * -> *). MonadFail m => Text -> m JannoLatitude
make Text
x =
case Reader Double
T.double Text
x of
Left [Char]
e -> [Char] -> m JannoLatitude
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoLatitude) -> [Char] -> m JannoLatitude
forall a b. (a -> b) -> a -> b
$ [Char]
"Latitude can not be converted to Double because " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
e
Right (Double
num, Text
"") ->
if Double
num Double -> Double -> Bool
forall a. Ord a => a -> a -> Bool
>= -Double
90 Bool -> Bool -> Bool
&& Double
num Double -> Double -> Bool
forall a. Ord a => a -> a -> Bool
<= Double
90
then JannoLatitude -> m JannoLatitude
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Double -> JannoLatitude
JannoLatitude Double
num)
else [Char] -> m JannoLatitude
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoLatitude) -> [Char] -> m JannoLatitude
forall a b. (a -> b) -> a -> b
$ [Char]
"Latitude " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Text -> [Char]
forall a. Show a => a -> [Char]
show Text
x [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
" not between -90 and 90"
Right (Double
_, Text
rest) -> [Char] -> m JannoLatitude
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoLatitude) -> [Char] -> m JannoLatitude
forall a b. (a -> b) -> a -> b
$ [Char]
"Latitude can not be converted to Double, because of a trailing " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Text -> [Char]
forall a. Show a => a -> [Char]
show Text
rest
instance Show JannoLatitude where show :: JannoLatitude -> [Char]
show (JannoLatitude Double
x) = Double -> [Char]
forall a. Show a => a -> [Char]
show Double
x
instance Csv.ToField JannoLatitude where toField :: JannoLatitude -> Field
toField (JannoLatitude Double
x) = Double -> Field
forall a. ToField a => a -> Field
Csv.toField Double
x
instance Csv.FromField JannoLatitude where parseField :: Field -> Parser JannoLatitude
parseField = [Char] -> Field -> Parser JannoLatitude
forall a (m :: * -> *).
(MonadFail m, Makeable a, Typeable a) =>
[Char] -> Field -> m a
parseTypeCSV [Char]
"Latitude"
newtype JannoLongitude = JannoLongitude Double deriving (JannoLongitude -> JannoLongitude -> Bool
(JannoLongitude -> JannoLongitude -> Bool)
-> (JannoLongitude -> JannoLongitude -> Bool) -> Eq JannoLongitude
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoLongitude -> JannoLongitude -> Bool
== :: JannoLongitude -> JannoLongitude -> Bool
$c/= :: JannoLongitude -> JannoLongitude -> Bool
/= :: JannoLongitude -> JannoLongitude -> Bool
Eq, Eq JannoLongitude
Eq JannoLongitude
-> (JannoLongitude -> JannoLongitude -> Ordering)
-> (JannoLongitude -> JannoLongitude -> Bool)
-> (JannoLongitude -> JannoLongitude -> Bool)
-> (JannoLongitude -> JannoLongitude -> Bool)
-> (JannoLongitude -> JannoLongitude -> Bool)
-> (JannoLongitude -> JannoLongitude -> JannoLongitude)
-> (JannoLongitude -> JannoLongitude -> JannoLongitude)
-> Ord JannoLongitude
JannoLongitude -> JannoLongitude -> Bool
JannoLongitude -> JannoLongitude -> Ordering
JannoLongitude -> JannoLongitude -> JannoLongitude
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: JannoLongitude -> JannoLongitude -> Ordering
compare :: JannoLongitude -> JannoLongitude -> Ordering
$c< :: JannoLongitude -> JannoLongitude -> Bool
< :: JannoLongitude -> JannoLongitude -> Bool
$c<= :: JannoLongitude -> JannoLongitude -> Bool
<= :: JannoLongitude -> JannoLongitude -> Bool
$c> :: JannoLongitude -> JannoLongitude -> Bool
> :: JannoLongitude -> JannoLongitude -> Bool
$c>= :: JannoLongitude -> JannoLongitude -> Bool
>= :: JannoLongitude -> JannoLongitude -> Bool
$cmax :: JannoLongitude -> JannoLongitude -> JannoLongitude
max :: JannoLongitude -> JannoLongitude -> JannoLongitude
$cmin :: JannoLongitude -> JannoLongitude -> JannoLongitude
min :: JannoLongitude -> JannoLongitude -> JannoLongitude
Ord, (forall x. JannoLongitude -> Rep JannoLongitude x)
-> (forall x. Rep JannoLongitude x -> JannoLongitude)
-> Generic JannoLongitude
forall x. Rep JannoLongitude x -> JannoLongitude
forall x. JannoLongitude -> Rep JannoLongitude x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. JannoLongitude -> Rep JannoLongitude x
from :: forall x. JannoLongitude -> Rep JannoLongitude x
$cto :: forall x. Rep JannoLongitude x -> JannoLongitude
to :: forall x. Rep JannoLongitude x -> JannoLongitude
Generic)
instance Makeable JannoLongitude where
make :: forall (m :: * -> *). MonadFail m => Text -> m JannoLongitude
make Text
x =
case Reader Double
T.double Text
x of
Left [Char]
e -> [Char] -> m JannoLongitude
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoLongitude) -> [Char] -> m JannoLongitude
forall a b. (a -> b) -> a -> b
$ [Char]
"Longitude can not be converted to Double because " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
e
Right (Double
num, Text
"") ->
if Double
num Double -> Double -> Bool
forall a. Ord a => a -> a -> Bool
>= -Double
180 Bool -> Bool -> Bool
&& Double
num Double -> Double -> Bool
forall a. Ord a => a -> a -> Bool
<= Double
180
then JannoLongitude -> m JannoLongitude
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Double -> JannoLongitude
JannoLongitude Double
num)
else [Char] -> m JannoLongitude
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoLongitude) -> [Char] -> m JannoLongitude
forall a b. (a -> b) -> a -> b
$ [Char]
"Longitude " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Text -> [Char]
forall a. Show a => a -> [Char]
show Text
x [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
" not between -180 and 180"
Right (Double
_, Text
rest) -> [Char] -> m JannoLongitude
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoLongitude) -> [Char] -> m JannoLongitude
forall a b. (a -> b) -> a -> b
$ [Char]
"Longitude can not be converted to Double, because of a trailing " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Text -> [Char]
forall a. Show a => a -> [Char]
show Text
rest
instance Show JannoLongitude where show :: JannoLongitude -> [Char]
show (JannoLongitude Double
x) = Double -> [Char]
forall a. Show a => a -> [Char]
show Double
x
instance Csv.ToField JannoLongitude where toField :: JannoLongitude -> Field
toField (JannoLongitude Double
x) = Double -> Field
forall a. ToField a => a -> Field
Csv.toField Double
x
instance Csv.FromField JannoLongitude where parseField :: Field -> Parser JannoLongitude
parseField = [Char] -> Field -> Parser JannoLongitude
forall a (m :: * -> *).
(MonadFail m, Makeable a, Typeable a) =>
[Char] -> Field -> m a
parseTypeCSV [Char]
"Longitude"
data JannoDateType =
C14
| Contextual
| Modern
deriving (JannoDateType -> JannoDateType -> Bool
(JannoDateType -> JannoDateType -> Bool)
-> (JannoDateType -> JannoDateType -> Bool) -> Eq JannoDateType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoDateType -> JannoDateType -> Bool
== :: JannoDateType -> JannoDateType -> Bool
$c/= :: JannoDateType -> JannoDateType -> Bool
/= :: JannoDateType -> JannoDateType -> Bool
Eq, Eq JannoDateType
Eq JannoDateType
-> (JannoDateType -> JannoDateType -> Ordering)
-> (JannoDateType -> JannoDateType -> Bool)
-> (JannoDateType -> JannoDateType -> Bool)
-> (JannoDateType -> JannoDateType -> Bool)
-> (JannoDateType -> JannoDateType -> Bool)
-> (JannoDateType -> JannoDateType -> JannoDateType)
-> (JannoDateType -> JannoDateType -> JannoDateType)
-> Ord JannoDateType
JannoDateType -> JannoDateType -> Bool
JannoDateType -> JannoDateType -> Ordering
JannoDateType -> JannoDateType -> JannoDateType
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: JannoDateType -> JannoDateType -> Ordering
compare :: JannoDateType -> JannoDateType -> Ordering
$c< :: JannoDateType -> JannoDateType -> Bool
< :: JannoDateType -> JannoDateType -> Bool
$c<= :: JannoDateType -> JannoDateType -> Bool
<= :: JannoDateType -> JannoDateType -> Bool
$c> :: JannoDateType -> JannoDateType -> Bool
> :: JannoDateType -> JannoDateType -> Bool
$c>= :: JannoDateType -> JannoDateType -> Bool
>= :: JannoDateType -> JannoDateType -> Bool
$cmax :: JannoDateType -> JannoDateType -> JannoDateType
max :: JannoDateType -> JannoDateType -> JannoDateType
$cmin :: JannoDateType -> JannoDateType -> JannoDateType
min :: JannoDateType -> JannoDateType -> JannoDateType
Ord, (forall x. JannoDateType -> Rep JannoDateType x)
-> (forall x. Rep JannoDateType x -> JannoDateType)
-> Generic JannoDateType
forall x. Rep JannoDateType x -> JannoDateType
forall x. JannoDateType -> Rep JannoDateType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. JannoDateType -> Rep JannoDateType x
from :: forall x. JannoDateType -> Rep JannoDateType x
$cto :: forall x. Rep JannoDateType x -> JannoDateType
to :: forall x. Rep JannoDateType x -> JannoDateType
Generic, Int -> JannoDateType
JannoDateType -> Int
JannoDateType -> [JannoDateType]
JannoDateType -> JannoDateType
JannoDateType -> JannoDateType -> [JannoDateType]
JannoDateType -> JannoDateType -> JannoDateType -> [JannoDateType]
(JannoDateType -> JannoDateType)
-> (JannoDateType -> JannoDateType)
-> (Int -> JannoDateType)
-> (JannoDateType -> Int)
-> (JannoDateType -> [JannoDateType])
-> (JannoDateType -> JannoDateType -> [JannoDateType])
-> (JannoDateType -> JannoDateType -> [JannoDateType])
-> (JannoDateType
-> JannoDateType -> JannoDateType -> [JannoDateType])
-> Enum JannoDateType
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: JannoDateType -> JannoDateType
succ :: JannoDateType -> JannoDateType
$cpred :: JannoDateType -> JannoDateType
pred :: JannoDateType -> JannoDateType
$ctoEnum :: Int -> JannoDateType
toEnum :: Int -> JannoDateType
$cfromEnum :: JannoDateType -> Int
fromEnum :: JannoDateType -> Int
$cenumFrom :: JannoDateType -> [JannoDateType]
enumFrom :: JannoDateType -> [JannoDateType]
$cenumFromThen :: JannoDateType -> JannoDateType -> [JannoDateType]
enumFromThen :: JannoDateType -> JannoDateType -> [JannoDateType]
$cenumFromTo :: JannoDateType -> JannoDateType -> [JannoDateType]
enumFromTo :: JannoDateType -> JannoDateType -> [JannoDateType]
$cenumFromThenTo :: JannoDateType -> JannoDateType -> JannoDateType -> [JannoDateType]
enumFromThenTo :: JannoDateType -> JannoDateType -> JannoDateType -> [JannoDateType]
Enum, JannoDateType
JannoDateType -> JannoDateType -> Bounded JannoDateType
forall a. a -> a -> Bounded a
$cminBound :: JannoDateType
minBound :: JannoDateType
$cmaxBound :: JannoDateType
maxBound :: JannoDateType
Bounded)
instance Makeable JannoDateType where
make :: forall (m :: * -> *). MonadFail m => Text -> m JannoDateType
make Text
x
| Text
x Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
"C14" = JannoDateType -> m JannoDateType
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure JannoDateType
C14
| Text
x Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
"contextual" = JannoDateType -> m JannoDateType
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure JannoDateType
Contextual
| Text
x Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
"modern" = JannoDateType -> m JannoDateType
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure JannoDateType
Modern
| Bool
otherwise = [Char] -> m JannoDateType
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoDateType) -> [Char] -> m JannoDateType
forall a b. (a -> b) -> a -> b
$ [Char]
"Date_Type is set to " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Text -> [Char]
forall a. Show a => a -> [Char]
show Text
x [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
". " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++
[Char]
"That is not in the allowed set [C14, contextual, modern]."
instance Show JannoDateType where
show :: JannoDateType -> [Char]
show JannoDateType
C14 = [Char]
"C14"
show JannoDateType
Contextual = [Char]
"contextual"
show JannoDateType
Modern = [Char]
"modern"
instance Csv.ToField JannoDateType where toField :: JannoDateType -> Field
toField JannoDateType
x = [Char] -> Field
forall a. ToField a => a -> Field
Csv.toField ([Char] -> Field) -> [Char] -> Field
forall a b. (a -> b) -> a -> b
$ JannoDateType -> [Char]
forall a. Show a => a -> [Char]
show JannoDateType
x
instance Csv.FromField JannoDateType where parseField :: Field -> Parser JannoDateType
parseField = [Char] -> Field -> Parser JannoDateType
forall a (m :: * -> *).
(MonadFail m, Makeable a, Typeable a) =>
[Char] -> Field -> m a
parseTypeCSV [Char]
"Date_Type"
newtype JannoDateC14Labnr = JannoDateC14Labnr T.Text deriving (JannoDateC14Labnr -> JannoDateC14Labnr -> Bool
(JannoDateC14Labnr -> JannoDateC14Labnr -> Bool)
-> (JannoDateC14Labnr -> JannoDateC14Labnr -> Bool)
-> Eq JannoDateC14Labnr
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoDateC14Labnr -> JannoDateC14Labnr -> Bool
== :: JannoDateC14Labnr -> JannoDateC14Labnr -> Bool
$c/= :: JannoDateC14Labnr -> JannoDateC14Labnr -> Bool
/= :: JannoDateC14Labnr -> JannoDateC14Labnr -> Bool
Eq)
$(makeInstances ''JannoDateC14Labnr "Date_C14_Labnr")
newtype JannoDateC14UncalBP = JannoDateC14UncalBP Int deriving (JannoDateC14UncalBP -> JannoDateC14UncalBP -> Bool
(JannoDateC14UncalBP -> JannoDateC14UncalBP -> Bool)
-> (JannoDateC14UncalBP -> JannoDateC14UncalBP -> Bool)
-> Eq JannoDateC14UncalBP
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoDateC14UncalBP -> JannoDateC14UncalBP -> Bool
== :: JannoDateC14UncalBP -> JannoDateC14UncalBP -> Bool
$c/= :: JannoDateC14UncalBP -> JannoDateC14UncalBP -> Bool
/= :: JannoDateC14UncalBP -> JannoDateC14UncalBP -> Bool
Eq, Eq JannoDateC14UncalBP
Eq JannoDateC14UncalBP
-> (JannoDateC14UncalBP -> JannoDateC14UncalBP -> Ordering)
-> (JannoDateC14UncalBP -> JannoDateC14UncalBP -> Bool)
-> (JannoDateC14UncalBP -> JannoDateC14UncalBP -> Bool)
-> (JannoDateC14UncalBP -> JannoDateC14UncalBP -> Bool)
-> (JannoDateC14UncalBP -> JannoDateC14UncalBP -> Bool)
-> (JannoDateC14UncalBP
-> JannoDateC14UncalBP -> JannoDateC14UncalBP)
-> (JannoDateC14UncalBP
-> JannoDateC14UncalBP -> JannoDateC14UncalBP)
-> Ord JannoDateC14UncalBP
JannoDateC14UncalBP -> JannoDateC14UncalBP -> Bool
JannoDateC14UncalBP -> JannoDateC14UncalBP -> Ordering
JannoDateC14UncalBP -> JannoDateC14UncalBP -> JannoDateC14UncalBP
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: JannoDateC14UncalBP -> JannoDateC14UncalBP -> Ordering
compare :: JannoDateC14UncalBP -> JannoDateC14UncalBP -> Ordering
$c< :: JannoDateC14UncalBP -> JannoDateC14UncalBP -> Bool
< :: JannoDateC14UncalBP -> JannoDateC14UncalBP -> Bool
$c<= :: JannoDateC14UncalBP -> JannoDateC14UncalBP -> Bool
<= :: JannoDateC14UncalBP -> JannoDateC14UncalBP -> Bool
$c> :: JannoDateC14UncalBP -> JannoDateC14UncalBP -> Bool
> :: JannoDateC14UncalBP -> JannoDateC14UncalBP -> Bool
$c>= :: JannoDateC14UncalBP -> JannoDateC14UncalBP -> Bool
>= :: JannoDateC14UncalBP -> JannoDateC14UncalBP -> Bool
$cmax :: JannoDateC14UncalBP -> JannoDateC14UncalBP -> JannoDateC14UncalBP
max :: JannoDateC14UncalBP -> JannoDateC14UncalBP -> JannoDateC14UncalBP
$cmin :: JannoDateC14UncalBP -> JannoDateC14UncalBP -> JannoDateC14UncalBP
min :: JannoDateC14UncalBP -> JannoDateC14UncalBP -> JannoDateC14UncalBP
Ord, (forall x. JannoDateC14UncalBP -> Rep JannoDateC14UncalBP x)
-> (forall x. Rep JannoDateC14UncalBP x -> JannoDateC14UncalBP)
-> Generic JannoDateC14UncalBP
forall x. Rep JannoDateC14UncalBP x -> JannoDateC14UncalBP
forall x. JannoDateC14UncalBP -> Rep JannoDateC14UncalBP x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. JannoDateC14UncalBP -> Rep JannoDateC14UncalBP x
from :: forall x. JannoDateC14UncalBP -> Rep JannoDateC14UncalBP x
$cto :: forall x. Rep JannoDateC14UncalBP x -> JannoDateC14UncalBP
to :: forall x. Rep JannoDateC14UncalBP x -> JannoDateC14UncalBP
Generic)
instance Makeable JannoDateC14UncalBP where
make :: forall (m :: * -> *). MonadFail m => Text -> m JannoDateC14UncalBP
make Text
x =
case Reader Int
forall a. Integral a => Reader a
T.decimal Text
x of
Left [Char]
e -> [Char] -> m JannoDateC14UncalBP
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoDateC14UncalBP)
-> [Char] -> m JannoDateC14UncalBP
forall a b. (a -> b) -> a -> b
$ [Char]
"Date_C14_Uncal_BP can not be converted to Int because " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
e
Right (Int
num, Text
"") -> JannoDateC14UncalBP -> m JannoDateC14UncalBP
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (JannoDateC14UncalBP -> m JannoDateC14UncalBP)
-> JannoDateC14UncalBP -> m JannoDateC14UncalBP
forall a b. (a -> b) -> a -> b
$ Int -> JannoDateC14UncalBP
JannoDateC14UncalBP Int
num
Right (Int
_, Text
rest) -> [Char] -> m JannoDateC14UncalBP
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoDateC14UncalBP)
-> [Char] -> m JannoDateC14UncalBP
forall a b. (a -> b) -> a -> b
$ [Char]
"Date_C14_Uncal_BP can not be converted to Int, because of a trailing " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Text -> [Char]
forall a. Show a => a -> [Char]
show Text
rest
instance Show JannoDateC14UncalBP where show :: JannoDateC14UncalBP -> [Char]
show (JannoDateC14UncalBP Int
x) = Int -> [Char]
forall a. Show a => a -> [Char]
show Int
x
instance Csv.ToField JannoDateC14UncalBP where toField :: JannoDateC14UncalBP -> Field
toField (JannoDateC14UncalBP Int
x) = Int -> Field
forall a. ToField a => a -> Field
Csv.toField Int
x
instance Csv.FromField JannoDateC14UncalBP where parseField :: Field -> Parser JannoDateC14UncalBP
parseField = [Char] -> Field -> Parser JannoDateC14UncalBP
forall a (m :: * -> *).
(MonadFail m, Makeable a, Typeable a) =>
[Char] -> Field -> m a
parseTypeCSV [Char]
"Date_C14_Uncal_BP"
newtype JannoDateC14UncalBPErr = JannoDateC14UncalBPErr Int deriving (JannoDateC14UncalBPErr -> JannoDateC14UncalBPErr -> Bool
(JannoDateC14UncalBPErr -> JannoDateC14UncalBPErr -> Bool)
-> (JannoDateC14UncalBPErr -> JannoDateC14UncalBPErr -> Bool)
-> Eq JannoDateC14UncalBPErr
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoDateC14UncalBPErr -> JannoDateC14UncalBPErr -> Bool
== :: JannoDateC14UncalBPErr -> JannoDateC14UncalBPErr -> Bool
$c/= :: JannoDateC14UncalBPErr -> JannoDateC14UncalBPErr -> Bool
/= :: JannoDateC14UncalBPErr -> JannoDateC14UncalBPErr -> Bool
Eq, Eq JannoDateC14UncalBPErr
Eq JannoDateC14UncalBPErr
-> (JannoDateC14UncalBPErr -> JannoDateC14UncalBPErr -> Ordering)
-> (JannoDateC14UncalBPErr -> JannoDateC14UncalBPErr -> Bool)
-> (JannoDateC14UncalBPErr -> JannoDateC14UncalBPErr -> Bool)
-> (JannoDateC14UncalBPErr -> JannoDateC14UncalBPErr -> Bool)
-> (JannoDateC14UncalBPErr -> JannoDateC14UncalBPErr -> Bool)
-> (JannoDateC14UncalBPErr
-> JannoDateC14UncalBPErr -> JannoDateC14UncalBPErr)
-> (JannoDateC14UncalBPErr
-> JannoDateC14UncalBPErr -> JannoDateC14UncalBPErr)
-> Ord JannoDateC14UncalBPErr
JannoDateC14UncalBPErr -> JannoDateC14UncalBPErr -> Bool
JannoDateC14UncalBPErr -> JannoDateC14UncalBPErr -> Ordering
JannoDateC14UncalBPErr
-> JannoDateC14UncalBPErr -> JannoDateC14UncalBPErr
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: JannoDateC14UncalBPErr -> JannoDateC14UncalBPErr -> Ordering
compare :: JannoDateC14UncalBPErr -> JannoDateC14UncalBPErr -> Ordering
$c< :: JannoDateC14UncalBPErr -> JannoDateC14UncalBPErr -> Bool
< :: JannoDateC14UncalBPErr -> JannoDateC14UncalBPErr -> Bool
$c<= :: JannoDateC14UncalBPErr -> JannoDateC14UncalBPErr -> Bool
<= :: JannoDateC14UncalBPErr -> JannoDateC14UncalBPErr -> Bool
$c> :: JannoDateC14UncalBPErr -> JannoDateC14UncalBPErr -> Bool
> :: JannoDateC14UncalBPErr -> JannoDateC14UncalBPErr -> Bool
$c>= :: JannoDateC14UncalBPErr -> JannoDateC14UncalBPErr -> Bool
>= :: JannoDateC14UncalBPErr -> JannoDateC14UncalBPErr -> Bool
$cmax :: JannoDateC14UncalBPErr
-> JannoDateC14UncalBPErr -> JannoDateC14UncalBPErr
max :: JannoDateC14UncalBPErr
-> JannoDateC14UncalBPErr -> JannoDateC14UncalBPErr
$cmin :: JannoDateC14UncalBPErr
-> JannoDateC14UncalBPErr -> JannoDateC14UncalBPErr
min :: JannoDateC14UncalBPErr
-> JannoDateC14UncalBPErr -> JannoDateC14UncalBPErr
Ord, (forall x. JannoDateC14UncalBPErr -> Rep JannoDateC14UncalBPErr x)
-> (forall x.
Rep JannoDateC14UncalBPErr x -> JannoDateC14UncalBPErr)
-> Generic JannoDateC14UncalBPErr
forall x. Rep JannoDateC14UncalBPErr x -> JannoDateC14UncalBPErr
forall x. JannoDateC14UncalBPErr -> Rep JannoDateC14UncalBPErr x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. JannoDateC14UncalBPErr -> Rep JannoDateC14UncalBPErr x
from :: forall x. JannoDateC14UncalBPErr -> Rep JannoDateC14UncalBPErr x
$cto :: forall x. Rep JannoDateC14UncalBPErr x -> JannoDateC14UncalBPErr
to :: forall x. Rep JannoDateC14UncalBPErr x -> JannoDateC14UncalBPErr
Generic)
instance Makeable JannoDateC14UncalBPErr where
make :: forall (m :: * -> *).
MonadFail m =>
Text -> m JannoDateC14UncalBPErr
make Text
x =
case Reader Int
forall a. Integral a => Reader a
T.decimal Text
x of
Left [Char]
e -> [Char] -> m JannoDateC14UncalBPErr
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoDateC14UncalBPErr)
-> [Char] -> m JannoDateC14UncalBPErr
forall a b. (a -> b) -> a -> b
$ [Char]
"Date_C14_Uncal_BP_Err can not be converted to Int because " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
e
Right (Int
num, Text
"") -> JannoDateC14UncalBPErr -> m JannoDateC14UncalBPErr
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (JannoDateC14UncalBPErr -> m JannoDateC14UncalBPErr)
-> JannoDateC14UncalBPErr -> m JannoDateC14UncalBPErr
forall a b. (a -> b) -> a -> b
$ Int -> JannoDateC14UncalBPErr
JannoDateC14UncalBPErr Int
num
Right (Int
_, Text
rest) -> [Char] -> m JannoDateC14UncalBPErr
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoDateC14UncalBPErr)
-> [Char] -> m JannoDateC14UncalBPErr
forall a b. (a -> b) -> a -> b
$ [Char]
"Date_C14_Uncal_BP_Err can not be converted to Int, because of a trailing " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Text -> [Char]
forall a. Show a => a -> [Char]
show Text
rest
instance Show JannoDateC14UncalBPErr where show :: JannoDateC14UncalBPErr -> [Char]
show (JannoDateC14UncalBPErr Int
x) = Int -> [Char]
forall a. Show a => a -> [Char]
show Int
x
instance Csv.ToField JannoDateC14UncalBPErr where toField :: JannoDateC14UncalBPErr -> Field
toField (JannoDateC14UncalBPErr Int
x) = Int -> Field
forall a. ToField a => a -> Field
Csv.toField Int
x
instance Csv.FromField JannoDateC14UncalBPErr where parseField :: Field -> Parser JannoDateC14UncalBPErr
parseField = [Char] -> Field -> Parser JannoDateC14UncalBPErr
forall a (m :: * -> *).
(MonadFail m, Makeable a, Typeable a) =>
[Char] -> Field -> m a
parseTypeCSV [Char]
"Date_C14_Uncal_BP_Err"
newtype JannoDateBCADStart = JannoDateBCADStart Int deriving (JannoDateBCADStart -> JannoDateBCADStart -> Bool
(JannoDateBCADStart -> JannoDateBCADStart -> Bool)
-> (JannoDateBCADStart -> JannoDateBCADStart -> Bool)
-> Eq JannoDateBCADStart
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoDateBCADStart -> JannoDateBCADStart -> Bool
== :: JannoDateBCADStart -> JannoDateBCADStart -> Bool
$c/= :: JannoDateBCADStart -> JannoDateBCADStart -> Bool
/= :: JannoDateBCADStart -> JannoDateBCADStart -> Bool
Eq, Eq JannoDateBCADStart
Eq JannoDateBCADStart
-> (JannoDateBCADStart -> JannoDateBCADStart -> Ordering)
-> (JannoDateBCADStart -> JannoDateBCADStart -> Bool)
-> (JannoDateBCADStart -> JannoDateBCADStart -> Bool)
-> (JannoDateBCADStart -> JannoDateBCADStart -> Bool)
-> (JannoDateBCADStart -> JannoDateBCADStart -> Bool)
-> (JannoDateBCADStart -> JannoDateBCADStart -> JannoDateBCADStart)
-> (JannoDateBCADStart -> JannoDateBCADStart -> JannoDateBCADStart)
-> Ord JannoDateBCADStart
JannoDateBCADStart -> JannoDateBCADStart -> Bool
JannoDateBCADStart -> JannoDateBCADStart -> Ordering
JannoDateBCADStart -> JannoDateBCADStart -> JannoDateBCADStart
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: JannoDateBCADStart -> JannoDateBCADStart -> Ordering
compare :: JannoDateBCADStart -> JannoDateBCADStart -> Ordering
$c< :: JannoDateBCADStart -> JannoDateBCADStart -> Bool
< :: JannoDateBCADStart -> JannoDateBCADStart -> Bool
$c<= :: JannoDateBCADStart -> JannoDateBCADStart -> Bool
<= :: JannoDateBCADStart -> JannoDateBCADStart -> Bool
$c> :: JannoDateBCADStart -> JannoDateBCADStart -> Bool
> :: JannoDateBCADStart -> JannoDateBCADStart -> Bool
$c>= :: JannoDateBCADStart -> JannoDateBCADStart -> Bool
>= :: JannoDateBCADStart -> JannoDateBCADStart -> Bool
$cmax :: JannoDateBCADStart -> JannoDateBCADStart -> JannoDateBCADStart
max :: JannoDateBCADStart -> JannoDateBCADStart -> JannoDateBCADStart
$cmin :: JannoDateBCADStart -> JannoDateBCADStart -> JannoDateBCADStart
min :: JannoDateBCADStart -> JannoDateBCADStart -> JannoDateBCADStart
Ord, (forall x. JannoDateBCADStart -> Rep JannoDateBCADStart x)
-> (forall x. Rep JannoDateBCADStart x -> JannoDateBCADStart)
-> Generic JannoDateBCADStart
forall x. Rep JannoDateBCADStart x -> JannoDateBCADStart
forall x. JannoDateBCADStart -> Rep JannoDateBCADStart x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. JannoDateBCADStart -> Rep JannoDateBCADStart x
from :: forall x. JannoDateBCADStart -> Rep JannoDateBCADStart x
$cto :: forall x. Rep JannoDateBCADStart x -> JannoDateBCADStart
to :: forall x. Rep JannoDateBCADStart x -> JannoDateBCADStart
Generic)
instance Makeable JannoDateBCADStart where
make :: forall (m :: * -> *). MonadFail m => Text -> m JannoDateBCADStart
make Text
x =
let curYear :: Int
curYear = Int
2024
in case Reader Int -> Reader Int
forall a. Num a => Reader a -> Reader a
T.signed Reader Int
forall a. Integral a => Reader a
T.decimal Text
x of
Left [Char]
e -> [Char] -> m JannoDateBCADStart
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoDateBCADStart) -> [Char] -> m JannoDateBCADStart
forall a b. (a -> b) -> a -> b
$ [Char]
"Date_BC_AD_Start can not be converted to Int because " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
e
Right (Int
num, Text
"") ->
if Int
num Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>= Int
curYear
then [Char] -> m JannoDateBCADStart
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoDateBCADStart) -> [Char] -> m JannoDateBCADStart
forall a b. (a -> b) -> a -> b
$ [Char]
"Date_BC_AD_Start " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Text -> [Char]
forall a. Show a => a -> [Char]
show Text
x [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
" later than " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Int -> [Char]
forall a. Show a => a -> [Char]
show Int
curYear [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
", which is impossible. " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++
[Char]
"Did you accidentally enter a BP date?"
else JannoDateBCADStart -> m JannoDateBCADStart
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (JannoDateBCADStart -> m JannoDateBCADStart)
-> JannoDateBCADStart -> m JannoDateBCADStart
forall a b. (a -> b) -> a -> b
$ Int -> JannoDateBCADStart
JannoDateBCADStart Int
num
Right (Int
_, Text
rest) -> [Char] -> m JannoDateBCADStart
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoDateBCADStart) -> [Char] -> m JannoDateBCADStart
forall a b. (a -> b) -> a -> b
$ [Char]
"Date_BC_AD_Start can not be converted to Int, because of a trailing " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Text -> [Char]
forall a. Show a => a -> [Char]
show Text
rest
instance Show JannoDateBCADStart where show :: JannoDateBCADStart -> [Char]
show (JannoDateBCADStart Int
x) = Int -> [Char]
forall a. Show a => a -> [Char]
show Int
x
instance Csv.ToField JannoDateBCADStart where toField :: JannoDateBCADStart -> Field
toField (JannoDateBCADStart Int
x) = Int -> Field
forall a. ToField a => a -> Field
Csv.toField Int
x
instance Csv.FromField JannoDateBCADStart where parseField :: Field -> Parser JannoDateBCADStart
parseField = [Char] -> Field -> Parser JannoDateBCADStart
forall a (m :: * -> *).
(MonadFail m, Makeable a, Typeable a) =>
[Char] -> Field -> m a
parseTypeCSV [Char]
"Date_BC_AD_Start"
newtype JannoDateBCADMedian = JannoDateBCADMedian Int deriving (JannoDateBCADMedian -> JannoDateBCADMedian -> Bool
(JannoDateBCADMedian -> JannoDateBCADMedian -> Bool)
-> (JannoDateBCADMedian -> JannoDateBCADMedian -> Bool)
-> Eq JannoDateBCADMedian
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoDateBCADMedian -> JannoDateBCADMedian -> Bool
== :: JannoDateBCADMedian -> JannoDateBCADMedian -> Bool
$c/= :: JannoDateBCADMedian -> JannoDateBCADMedian -> Bool
/= :: JannoDateBCADMedian -> JannoDateBCADMedian -> Bool
Eq, Eq JannoDateBCADMedian
Eq JannoDateBCADMedian
-> (JannoDateBCADMedian -> JannoDateBCADMedian -> Ordering)
-> (JannoDateBCADMedian -> JannoDateBCADMedian -> Bool)
-> (JannoDateBCADMedian -> JannoDateBCADMedian -> Bool)
-> (JannoDateBCADMedian -> JannoDateBCADMedian -> Bool)
-> (JannoDateBCADMedian -> JannoDateBCADMedian -> Bool)
-> (JannoDateBCADMedian
-> JannoDateBCADMedian -> JannoDateBCADMedian)
-> (JannoDateBCADMedian
-> JannoDateBCADMedian -> JannoDateBCADMedian)
-> Ord JannoDateBCADMedian
JannoDateBCADMedian -> JannoDateBCADMedian -> Bool
JannoDateBCADMedian -> JannoDateBCADMedian -> Ordering
JannoDateBCADMedian -> JannoDateBCADMedian -> JannoDateBCADMedian
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: JannoDateBCADMedian -> JannoDateBCADMedian -> Ordering
compare :: JannoDateBCADMedian -> JannoDateBCADMedian -> Ordering
$c< :: JannoDateBCADMedian -> JannoDateBCADMedian -> Bool
< :: JannoDateBCADMedian -> JannoDateBCADMedian -> Bool
$c<= :: JannoDateBCADMedian -> JannoDateBCADMedian -> Bool
<= :: JannoDateBCADMedian -> JannoDateBCADMedian -> Bool
$c> :: JannoDateBCADMedian -> JannoDateBCADMedian -> Bool
> :: JannoDateBCADMedian -> JannoDateBCADMedian -> Bool
$c>= :: JannoDateBCADMedian -> JannoDateBCADMedian -> Bool
>= :: JannoDateBCADMedian -> JannoDateBCADMedian -> Bool
$cmax :: JannoDateBCADMedian -> JannoDateBCADMedian -> JannoDateBCADMedian
max :: JannoDateBCADMedian -> JannoDateBCADMedian -> JannoDateBCADMedian
$cmin :: JannoDateBCADMedian -> JannoDateBCADMedian -> JannoDateBCADMedian
min :: JannoDateBCADMedian -> JannoDateBCADMedian -> JannoDateBCADMedian
Ord, (forall x. JannoDateBCADMedian -> Rep JannoDateBCADMedian x)
-> (forall x. Rep JannoDateBCADMedian x -> JannoDateBCADMedian)
-> Generic JannoDateBCADMedian
forall x. Rep JannoDateBCADMedian x -> JannoDateBCADMedian
forall x. JannoDateBCADMedian -> Rep JannoDateBCADMedian x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. JannoDateBCADMedian -> Rep JannoDateBCADMedian x
from :: forall x. JannoDateBCADMedian -> Rep JannoDateBCADMedian x
$cto :: forall x. Rep JannoDateBCADMedian x -> JannoDateBCADMedian
to :: forall x. Rep JannoDateBCADMedian x -> JannoDateBCADMedian
Generic)
instance Makeable JannoDateBCADMedian where
make :: forall (m :: * -> *). MonadFail m => Text -> m JannoDateBCADMedian
make Text
x =
let curYear :: Int
curYear = Int
2024
in case Reader Int -> Reader Int
forall a. Num a => Reader a -> Reader a
T.signed Reader Int
forall a. Integral a => Reader a
T.decimal Text
x of
Left [Char]
e -> [Char] -> m JannoDateBCADMedian
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoDateBCADMedian)
-> [Char] -> m JannoDateBCADMedian
forall a b. (a -> b) -> a -> b
$ [Char]
"Date_BC_AD_Median can not be converted to Int because " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
e
Right (Int
num, Text
"") ->
if Int
num Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>= Int
curYear
then [Char] -> m JannoDateBCADMedian
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoDateBCADMedian)
-> [Char] -> m JannoDateBCADMedian
forall a b. (a -> b) -> a -> b
$ [Char]
"Date_BC_AD_Median " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Text -> [Char]
forall a. Show a => a -> [Char]
show Text
x [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
" later than " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Int -> [Char]
forall a. Show a => a -> [Char]
show Int
curYear [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
", which is impossible. " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++
[Char]
"Did you accidentally enter a BP date?"
else JannoDateBCADMedian -> m JannoDateBCADMedian
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (JannoDateBCADMedian -> m JannoDateBCADMedian)
-> JannoDateBCADMedian -> m JannoDateBCADMedian
forall a b. (a -> b) -> a -> b
$ Int -> JannoDateBCADMedian
JannoDateBCADMedian Int
num
Right (Int
_, Text
rest) -> [Char] -> m JannoDateBCADMedian
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoDateBCADMedian)
-> [Char] -> m JannoDateBCADMedian
forall a b. (a -> b) -> a -> b
$ [Char]
"Date_BC_AD_Median can not be converted to Int, because of a trailing " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Text -> [Char]
forall a. Show a => a -> [Char]
show Text
rest
instance Show JannoDateBCADMedian where show :: JannoDateBCADMedian -> [Char]
show (JannoDateBCADMedian Int
x) = Int -> [Char]
forall a. Show a => a -> [Char]
show Int
x
instance Csv.ToField JannoDateBCADMedian where toField :: JannoDateBCADMedian -> Field
toField (JannoDateBCADMedian Int
x) = Int -> Field
forall a. ToField a => a -> Field
Csv.toField Int
x
instance Csv.FromField JannoDateBCADMedian where parseField :: Field -> Parser JannoDateBCADMedian
parseField = [Char] -> Field -> Parser JannoDateBCADMedian
forall a (m :: * -> *).
(MonadFail m, Makeable a, Typeable a) =>
[Char] -> Field -> m a
parseTypeCSV [Char]
"Date_BC_AD_Median"
newtype JannoDateBCADStop = JannoDateBCADStop Int deriving (JannoDateBCADStop -> JannoDateBCADStop -> Bool
(JannoDateBCADStop -> JannoDateBCADStop -> Bool)
-> (JannoDateBCADStop -> JannoDateBCADStop -> Bool)
-> Eq JannoDateBCADStop
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoDateBCADStop -> JannoDateBCADStop -> Bool
== :: JannoDateBCADStop -> JannoDateBCADStop -> Bool
$c/= :: JannoDateBCADStop -> JannoDateBCADStop -> Bool
/= :: JannoDateBCADStop -> JannoDateBCADStop -> Bool
Eq, Eq JannoDateBCADStop
Eq JannoDateBCADStop
-> (JannoDateBCADStop -> JannoDateBCADStop -> Ordering)
-> (JannoDateBCADStop -> JannoDateBCADStop -> Bool)
-> (JannoDateBCADStop -> JannoDateBCADStop -> Bool)
-> (JannoDateBCADStop -> JannoDateBCADStop -> Bool)
-> (JannoDateBCADStop -> JannoDateBCADStop -> Bool)
-> (JannoDateBCADStop -> JannoDateBCADStop -> JannoDateBCADStop)
-> (JannoDateBCADStop -> JannoDateBCADStop -> JannoDateBCADStop)
-> Ord JannoDateBCADStop
JannoDateBCADStop -> JannoDateBCADStop -> Bool
JannoDateBCADStop -> JannoDateBCADStop -> Ordering
JannoDateBCADStop -> JannoDateBCADStop -> JannoDateBCADStop
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: JannoDateBCADStop -> JannoDateBCADStop -> Ordering
compare :: JannoDateBCADStop -> JannoDateBCADStop -> Ordering
$c< :: JannoDateBCADStop -> JannoDateBCADStop -> Bool
< :: JannoDateBCADStop -> JannoDateBCADStop -> Bool
$c<= :: JannoDateBCADStop -> JannoDateBCADStop -> Bool
<= :: JannoDateBCADStop -> JannoDateBCADStop -> Bool
$c> :: JannoDateBCADStop -> JannoDateBCADStop -> Bool
> :: JannoDateBCADStop -> JannoDateBCADStop -> Bool
$c>= :: JannoDateBCADStop -> JannoDateBCADStop -> Bool
>= :: JannoDateBCADStop -> JannoDateBCADStop -> Bool
$cmax :: JannoDateBCADStop -> JannoDateBCADStop -> JannoDateBCADStop
max :: JannoDateBCADStop -> JannoDateBCADStop -> JannoDateBCADStop
$cmin :: JannoDateBCADStop -> JannoDateBCADStop -> JannoDateBCADStop
min :: JannoDateBCADStop -> JannoDateBCADStop -> JannoDateBCADStop
Ord, (forall x. JannoDateBCADStop -> Rep JannoDateBCADStop x)
-> (forall x. Rep JannoDateBCADStop x -> JannoDateBCADStop)
-> Generic JannoDateBCADStop
forall x. Rep JannoDateBCADStop x -> JannoDateBCADStop
forall x. JannoDateBCADStop -> Rep JannoDateBCADStop x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. JannoDateBCADStop -> Rep JannoDateBCADStop x
from :: forall x. JannoDateBCADStop -> Rep JannoDateBCADStop x
$cto :: forall x. Rep JannoDateBCADStop x -> JannoDateBCADStop
to :: forall x. Rep JannoDateBCADStop x -> JannoDateBCADStop
Generic)
instance Makeable JannoDateBCADStop where
make :: forall (m :: * -> *). MonadFail m => Text -> m JannoDateBCADStop
make Text
x =
let curYear :: Int
curYear = Int
2024
in case Reader Int -> Reader Int
forall a. Num a => Reader a -> Reader a
T.signed Reader Int
forall a. Integral a => Reader a
T.decimal Text
x of
Left [Char]
e -> [Char] -> m JannoDateBCADStop
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoDateBCADStop) -> [Char] -> m JannoDateBCADStop
forall a b. (a -> b) -> a -> b
$ [Char]
"Date_BC_AD_Stop can not be converted to Int because " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
e
Right (Int
num, Text
"") ->
if Int
num Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>= Int
curYear
then [Char] -> m JannoDateBCADStop
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoDateBCADStop) -> [Char] -> m JannoDateBCADStop
forall a b. (a -> b) -> a -> b
$ [Char]
"Date_BC_AD_Stop " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Text -> [Char]
forall a. Show a => a -> [Char]
show Text
x [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
" later than " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Int -> [Char]
forall a. Show a => a -> [Char]
show Int
curYear [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
", which is impossible. " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++
[Char]
"Did you accidentally enter a BP date?"
else JannoDateBCADStop -> m JannoDateBCADStop
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (JannoDateBCADStop -> m JannoDateBCADStop)
-> JannoDateBCADStop -> m JannoDateBCADStop
forall a b. (a -> b) -> a -> b
$ Int -> JannoDateBCADStop
JannoDateBCADStop Int
num
Right (Int
_, Text
rest) -> [Char] -> m JannoDateBCADStop
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoDateBCADStop) -> [Char] -> m JannoDateBCADStop
forall a b. (a -> b) -> a -> b
$ [Char]
"Date_BC_AD_Stop can not be converted to Int, because of a trailing " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Text -> [Char]
forall a. Show a => a -> [Char]
show Text
rest
instance Show JannoDateBCADStop where show :: JannoDateBCADStop -> [Char]
show (JannoDateBCADStop Int
x) = Int -> [Char]
forall a. Show a => a -> [Char]
show Int
x
instance Csv.ToField JannoDateBCADStop where toField :: JannoDateBCADStop -> Field
toField (JannoDateBCADStop Int
x) = Int -> Field
forall a. ToField a => a -> Field
Csv.toField Int
x
instance Csv.FromField JannoDateBCADStop where parseField :: Field -> Parser JannoDateBCADStop
parseField = [Char] -> Field -> Parser JannoDateBCADStop
forall a (m :: * -> *).
(MonadFail m, Makeable a, Typeable a) =>
[Char] -> Field -> m a
parseTypeCSV [Char]
"Date_BC_AD_Stop"
newtype JannoDateNote = JannoDateNote T.Text deriving (JannoDateNote -> JannoDateNote -> Bool
(JannoDateNote -> JannoDateNote -> Bool)
-> (JannoDateNote -> JannoDateNote -> Bool) -> Eq JannoDateNote
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoDateNote -> JannoDateNote -> Bool
== :: JannoDateNote -> JannoDateNote -> Bool
$c/= :: JannoDateNote -> JannoDateNote -> Bool
/= :: JannoDateNote -> JannoDateNote -> Bool
Eq, Eq JannoDateNote
Eq JannoDateNote
-> (JannoDateNote -> JannoDateNote -> Ordering)
-> (JannoDateNote -> JannoDateNote -> Bool)
-> (JannoDateNote -> JannoDateNote -> Bool)
-> (JannoDateNote -> JannoDateNote -> Bool)
-> (JannoDateNote -> JannoDateNote -> Bool)
-> (JannoDateNote -> JannoDateNote -> JannoDateNote)
-> (JannoDateNote -> JannoDateNote -> JannoDateNote)
-> Ord JannoDateNote
JannoDateNote -> JannoDateNote -> Bool
JannoDateNote -> JannoDateNote -> Ordering
JannoDateNote -> JannoDateNote -> JannoDateNote
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: JannoDateNote -> JannoDateNote -> Ordering
compare :: JannoDateNote -> JannoDateNote -> Ordering
$c< :: JannoDateNote -> JannoDateNote -> Bool
< :: JannoDateNote -> JannoDateNote -> Bool
$c<= :: JannoDateNote -> JannoDateNote -> Bool
<= :: JannoDateNote -> JannoDateNote -> Bool
$c> :: JannoDateNote -> JannoDateNote -> Bool
> :: JannoDateNote -> JannoDateNote -> Bool
$c>= :: JannoDateNote -> JannoDateNote -> Bool
>= :: JannoDateNote -> JannoDateNote -> Bool
$cmax :: JannoDateNote -> JannoDateNote -> JannoDateNote
max :: JannoDateNote -> JannoDateNote -> JannoDateNote
$cmin :: JannoDateNote -> JannoDateNote -> JannoDateNote
min :: JannoDateNote -> JannoDateNote -> JannoDateNote
Ord)
$(makeInstances ''JannoDateNote "Date_Note")
newtype JannoMTHaplogroup = JannoMTHaplogroup T.Text deriving (JannoMTHaplogroup -> JannoMTHaplogroup -> Bool
(JannoMTHaplogroup -> JannoMTHaplogroup -> Bool)
-> (JannoMTHaplogroup -> JannoMTHaplogroup -> Bool)
-> Eq JannoMTHaplogroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoMTHaplogroup -> JannoMTHaplogroup -> Bool
== :: JannoMTHaplogroup -> JannoMTHaplogroup -> Bool
$c/= :: JannoMTHaplogroup -> JannoMTHaplogroup -> Bool
/= :: JannoMTHaplogroup -> JannoMTHaplogroup -> Bool
Eq, Eq JannoMTHaplogroup
Eq JannoMTHaplogroup
-> (JannoMTHaplogroup -> JannoMTHaplogroup -> Ordering)
-> (JannoMTHaplogroup -> JannoMTHaplogroup -> Bool)
-> (JannoMTHaplogroup -> JannoMTHaplogroup -> Bool)
-> (JannoMTHaplogroup -> JannoMTHaplogroup -> Bool)
-> (JannoMTHaplogroup -> JannoMTHaplogroup -> Bool)
-> (JannoMTHaplogroup -> JannoMTHaplogroup -> JannoMTHaplogroup)
-> (JannoMTHaplogroup -> JannoMTHaplogroup -> JannoMTHaplogroup)
-> Ord JannoMTHaplogroup
JannoMTHaplogroup -> JannoMTHaplogroup -> Bool
JannoMTHaplogroup -> JannoMTHaplogroup -> Ordering
JannoMTHaplogroup -> JannoMTHaplogroup -> JannoMTHaplogroup
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: JannoMTHaplogroup -> JannoMTHaplogroup -> Ordering
compare :: JannoMTHaplogroup -> JannoMTHaplogroup -> Ordering
$c< :: JannoMTHaplogroup -> JannoMTHaplogroup -> Bool
< :: JannoMTHaplogroup -> JannoMTHaplogroup -> Bool
$c<= :: JannoMTHaplogroup -> JannoMTHaplogroup -> Bool
<= :: JannoMTHaplogroup -> JannoMTHaplogroup -> Bool
$c> :: JannoMTHaplogroup -> JannoMTHaplogroup -> Bool
> :: JannoMTHaplogroup -> JannoMTHaplogroup -> Bool
$c>= :: JannoMTHaplogroup -> JannoMTHaplogroup -> Bool
>= :: JannoMTHaplogroup -> JannoMTHaplogroup -> Bool
$cmax :: JannoMTHaplogroup -> JannoMTHaplogroup -> JannoMTHaplogroup
max :: JannoMTHaplogroup -> JannoMTHaplogroup -> JannoMTHaplogroup
$cmin :: JannoMTHaplogroup -> JannoMTHaplogroup -> JannoMTHaplogroup
min :: JannoMTHaplogroup -> JannoMTHaplogroup -> JannoMTHaplogroup
Ord)
$(makeInstances ''JannoMTHaplogroup "MT_Haplogroup")
newtype JannoYHaplogroup = JannoYHaplogroup T.Text deriving (JannoYHaplogroup -> JannoYHaplogroup -> Bool
(JannoYHaplogroup -> JannoYHaplogroup -> Bool)
-> (JannoYHaplogroup -> JannoYHaplogroup -> Bool)
-> Eq JannoYHaplogroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoYHaplogroup -> JannoYHaplogroup -> Bool
== :: JannoYHaplogroup -> JannoYHaplogroup -> Bool
$c/= :: JannoYHaplogroup -> JannoYHaplogroup -> Bool
/= :: JannoYHaplogroup -> JannoYHaplogroup -> Bool
Eq, Eq JannoYHaplogroup
Eq JannoYHaplogroup
-> (JannoYHaplogroup -> JannoYHaplogroup -> Ordering)
-> (JannoYHaplogroup -> JannoYHaplogroup -> Bool)
-> (JannoYHaplogroup -> JannoYHaplogroup -> Bool)
-> (JannoYHaplogroup -> JannoYHaplogroup -> Bool)
-> (JannoYHaplogroup -> JannoYHaplogroup -> Bool)
-> (JannoYHaplogroup -> JannoYHaplogroup -> JannoYHaplogroup)
-> (JannoYHaplogroup -> JannoYHaplogroup -> JannoYHaplogroup)
-> Ord JannoYHaplogroup
JannoYHaplogroup -> JannoYHaplogroup -> Bool
JannoYHaplogroup -> JannoYHaplogroup -> Ordering
JannoYHaplogroup -> JannoYHaplogroup -> JannoYHaplogroup
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: JannoYHaplogroup -> JannoYHaplogroup -> Ordering
compare :: JannoYHaplogroup -> JannoYHaplogroup -> Ordering
$c< :: JannoYHaplogroup -> JannoYHaplogroup -> Bool
< :: JannoYHaplogroup -> JannoYHaplogroup -> Bool
$c<= :: JannoYHaplogroup -> JannoYHaplogroup -> Bool
<= :: JannoYHaplogroup -> JannoYHaplogroup -> Bool
$c> :: JannoYHaplogroup -> JannoYHaplogroup -> Bool
> :: JannoYHaplogroup -> JannoYHaplogroup -> Bool
$c>= :: JannoYHaplogroup -> JannoYHaplogroup -> Bool
>= :: JannoYHaplogroup -> JannoYHaplogroup -> Bool
$cmax :: JannoYHaplogroup -> JannoYHaplogroup -> JannoYHaplogroup
max :: JannoYHaplogroup -> JannoYHaplogroup -> JannoYHaplogroup
$cmin :: JannoYHaplogroup -> JannoYHaplogroup -> JannoYHaplogroup
min :: JannoYHaplogroup -> JannoYHaplogroup -> JannoYHaplogroup
Ord)
$(makeInstances ''JannoYHaplogroup "Y_Haplogroup")
newtype JannoSourceTissue = JannoSourceTissue T.Text deriving (JannoSourceTissue -> JannoSourceTissue -> Bool
(JannoSourceTissue -> JannoSourceTissue -> Bool)
-> (JannoSourceTissue -> JannoSourceTissue -> Bool)
-> Eq JannoSourceTissue
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoSourceTissue -> JannoSourceTissue -> Bool
== :: JannoSourceTissue -> JannoSourceTissue -> Bool
$c/= :: JannoSourceTissue -> JannoSourceTissue -> Bool
/= :: JannoSourceTissue -> JannoSourceTissue -> Bool
Eq)
$(makeInstances ''JannoSourceTissue "Source_Tissue")
newtype JannoNrLibraries = JannoNrLibraries Int deriving (JannoNrLibraries -> JannoNrLibraries -> Bool
(JannoNrLibraries -> JannoNrLibraries -> Bool)
-> (JannoNrLibraries -> JannoNrLibraries -> Bool)
-> Eq JannoNrLibraries
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoNrLibraries -> JannoNrLibraries -> Bool
== :: JannoNrLibraries -> JannoNrLibraries -> Bool
$c/= :: JannoNrLibraries -> JannoNrLibraries -> Bool
/= :: JannoNrLibraries -> JannoNrLibraries -> Bool
Eq, Eq JannoNrLibraries
Eq JannoNrLibraries
-> (JannoNrLibraries -> JannoNrLibraries -> Ordering)
-> (JannoNrLibraries -> JannoNrLibraries -> Bool)
-> (JannoNrLibraries -> JannoNrLibraries -> Bool)
-> (JannoNrLibraries -> JannoNrLibraries -> Bool)
-> (JannoNrLibraries -> JannoNrLibraries -> Bool)
-> (JannoNrLibraries -> JannoNrLibraries -> JannoNrLibraries)
-> (JannoNrLibraries -> JannoNrLibraries -> JannoNrLibraries)
-> Ord JannoNrLibraries
JannoNrLibraries -> JannoNrLibraries -> Bool
JannoNrLibraries -> JannoNrLibraries -> Ordering
JannoNrLibraries -> JannoNrLibraries -> JannoNrLibraries
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: JannoNrLibraries -> JannoNrLibraries -> Ordering
compare :: JannoNrLibraries -> JannoNrLibraries -> Ordering
$c< :: JannoNrLibraries -> JannoNrLibraries -> Bool
< :: JannoNrLibraries -> JannoNrLibraries -> Bool
$c<= :: JannoNrLibraries -> JannoNrLibraries -> Bool
<= :: JannoNrLibraries -> JannoNrLibraries -> Bool
$c> :: JannoNrLibraries -> JannoNrLibraries -> Bool
> :: JannoNrLibraries -> JannoNrLibraries -> Bool
$c>= :: JannoNrLibraries -> JannoNrLibraries -> Bool
>= :: JannoNrLibraries -> JannoNrLibraries -> Bool
$cmax :: JannoNrLibraries -> JannoNrLibraries -> JannoNrLibraries
max :: JannoNrLibraries -> JannoNrLibraries -> JannoNrLibraries
$cmin :: JannoNrLibraries -> JannoNrLibraries -> JannoNrLibraries
min :: JannoNrLibraries -> JannoNrLibraries -> JannoNrLibraries
Ord, (forall x. JannoNrLibraries -> Rep JannoNrLibraries x)
-> (forall x. Rep JannoNrLibraries x -> JannoNrLibraries)
-> Generic JannoNrLibraries
forall x. Rep JannoNrLibraries x -> JannoNrLibraries
forall x. JannoNrLibraries -> Rep JannoNrLibraries x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. JannoNrLibraries -> Rep JannoNrLibraries x
from :: forall x. JannoNrLibraries -> Rep JannoNrLibraries x
$cto :: forall x. Rep JannoNrLibraries x -> JannoNrLibraries
to :: forall x. Rep JannoNrLibraries x -> JannoNrLibraries
Generic)
instance Makeable JannoNrLibraries where
make :: forall (m :: * -> *). MonadFail m => Text -> m JannoNrLibraries
make Text
x =
case Reader Int -> Reader Int
forall a. Num a => Reader a -> Reader a
T.signed Reader Int
forall a. Integral a => Reader a
T.decimal Text
x of
Left [Char]
e -> [Char] -> m JannoNrLibraries
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoNrLibraries) -> [Char] -> m JannoNrLibraries
forall a b. (a -> b) -> a -> b
$ [Char]
"Nr_Libraries can not be converted to Int because " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
e
Right (Int
num, Text
"") ->
if Int
num Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
< Int
1
then [Char] -> m JannoNrLibraries
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoNrLibraries) -> [Char] -> m JannoNrLibraries
forall a b. (a -> b) -> a -> b
$ [Char]
"Nr_Libraries " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Text -> [Char]
forall a. Show a => a -> [Char]
show Text
x [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
" lower than 1, which is impossible."
else JannoNrLibraries -> m JannoNrLibraries
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (JannoNrLibraries -> m JannoNrLibraries)
-> JannoNrLibraries -> m JannoNrLibraries
forall a b. (a -> b) -> a -> b
$ Int -> JannoNrLibraries
JannoNrLibraries Int
num
Right (Int
_, Text
rest) -> [Char] -> m JannoNrLibraries
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoNrLibraries) -> [Char] -> m JannoNrLibraries
forall a b. (a -> b) -> a -> b
$ [Char]
"Nr_Libraries can not be converted to Int, because of a trailing " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Text -> [Char]
forall a. Show a => a -> [Char]
show Text
rest
instance Show JannoNrLibraries where show :: JannoNrLibraries -> [Char]
show (JannoNrLibraries Int
x) = Int -> [Char]
forall a. Show a => a -> [Char]
show Int
x
instance Csv.ToField JannoNrLibraries where toField :: JannoNrLibraries -> Field
toField (JannoNrLibraries Int
x) = Int -> Field
forall a. ToField a => a -> Field
Csv.toField Int
x
instance Csv.FromField JannoNrLibraries where parseField :: Field -> Parser JannoNrLibraries
parseField = [Char] -> Field -> Parser JannoNrLibraries
forall a (m :: * -> *).
(MonadFail m, Makeable a, Typeable a) =>
[Char] -> Field -> m a
parseTypeCSV [Char]
"Nr_Libraries"
newtype JannoLibraryName = JannoLibraryName T.Text deriving (JannoLibraryName -> JannoLibraryName -> Bool
(JannoLibraryName -> JannoLibraryName -> Bool)
-> (JannoLibraryName -> JannoLibraryName -> Bool)
-> Eq JannoLibraryName
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoLibraryName -> JannoLibraryName -> Bool
== :: JannoLibraryName -> JannoLibraryName -> Bool
$c/= :: JannoLibraryName -> JannoLibraryName -> Bool
/= :: JannoLibraryName -> JannoLibraryName -> Bool
Eq)
$(makeInstances ''JannoLibraryName "Library_Names")
data JannoCaptureType =
Shotgun
| A1240K
| ArborComplete
| ArborPrimePlus
| ArborAncestralPlus
| TwistAncientDNA
| OtherCapture
| ReferenceGenome
deriving (JannoCaptureType -> JannoCaptureType -> Bool
(JannoCaptureType -> JannoCaptureType -> Bool)
-> (JannoCaptureType -> JannoCaptureType -> Bool)
-> Eq JannoCaptureType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoCaptureType -> JannoCaptureType -> Bool
== :: JannoCaptureType -> JannoCaptureType -> Bool
$c/= :: JannoCaptureType -> JannoCaptureType -> Bool
/= :: JannoCaptureType -> JannoCaptureType -> Bool
Eq, Eq JannoCaptureType
Eq JannoCaptureType
-> (JannoCaptureType -> JannoCaptureType -> Ordering)
-> (JannoCaptureType -> JannoCaptureType -> Bool)
-> (JannoCaptureType -> JannoCaptureType -> Bool)
-> (JannoCaptureType -> JannoCaptureType -> Bool)
-> (JannoCaptureType -> JannoCaptureType -> Bool)
-> (JannoCaptureType -> JannoCaptureType -> JannoCaptureType)
-> (JannoCaptureType -> JannoCaptureType -> JannoCaptureType)
-> Ord JannoCaptureType
JannoCaptureType -> JannoCaptureType -> Bool
JannoCaptureType -> JannoCaptureType -> Ordering
JannoCaptureType -> JannoCaptureType -> JannoCaptureType
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: JannoCaptureType -> JannoCaptureType -> Ordering
compare :: JannoCaptureType -> JannoCaptureType -> Ordering
$c< :: JannoCaptureType -> JannoCaptureType -> Bool
< :: JannoCaptureType -> JannoCaptureType -> Bool
$c<= :: JannoCaptureType -> JannoCaptureType -> Bool
<= :: JannoCaptureType -> JannoCaptureType -> Bool
$c> :: JannoCaptureType -> JannoCaptureType -> Bool
> :: JannoCaptureType -> JannoCaptureType -> Bool
$c>= :: JannoCaptureType -> JannoCaptureType -> Bool
>= :: JannoCaptureType -> JannoCaptureType -> Bool
$cmax :: JannoCaptureType -> JannoCaptureType -> JannoCaptureType
max :: JannoCaptureType -> JannoCaptureType -> JannoCaptureType
$cmin :: JannoCaptureType -> JannoCaptureType -> JannoCaptureType
min :: JannoCaptureType -> JannoCaptureType -> JannoCaptureType
Ord, (forall x. JannoCaptureType -> Rep JannoCaptureType x)
-> (forall x. Rep JannoCaptureType x -> JannoCaptureType)
-> Generic JannoCaptureType
forall x. Rep JannoCaptureType x -> JannoCaptureType
forall x. JannoCaptureType -> Rep JannoCaptureType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. JannoCaptureType -> Rep JannoCaptureType x
from :: forall x. JannoCaptureType -> Rep JannoCaptureType x
$cto :: forall x. Rep JannoCaptureType x -> JannoCaptureType
to :: forall x. Rep JannoCaptureType x -> JannoCaptureType
Generic, Int -> JannoCaptureType
JannoCaptureType -> Int
JannoCaptureType -> [JannoCaptureType]
JannoCaptureType -> JannoCaptureType
JannoCaptureType -> JannoCaptureType -> [JannoCaptureType]
JannoCaptureType
-> JannoCaptureType -> JannoCaptureType -> [JannoCaptureType]
(JannoCaptureType -> JannoCaptureType)
-> (JannoCaptureType -> JannoCaptureType)
-> (Int -> JannoCaptureType)
-> (JannoCaptureType -> Int)
-> (JannoCaptureType -> [JannoCaptureType])
-> (JannoCaptureType -> JannoCaptureType -> [JannoCaptureType])
-> (JannoCaptureType -> JannoCaptureType -> [JannoCaptureType])
-> (JannoCaptureType
-> JannoCaptureType -> JannoCaptureType -> [JannoCaptureType])
-> Enum JannoCaptureType
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: JannoCaptureType -> JannoCaptureType
succ :: JannoCaptureType -> JannoCaptureType
$cpred :: JannoCaptureType -> JannoCaptureType
pred :: JannoCaptureType -> JannoCaptureType
$ctoEnum :: Int -> JannoCaptureType
toEnum :: Int -> JannoCaptureType
$cfromEnum :: JannoCaptureType -> Int
fromEnum :: JannoCaptureType -> Int
$cenumFrom :: JannoCaptureType -> [JannoCaptureType]
enumFrom :: JannoCaptureType -> [JannoCaptureType]
$cenumFromThen :: JannoCaptureType -> JannoCaptureType -> [JannoCaptureType]
enumFromThen :: JannoCaptureType -> JannoCaptureType -> [JannoCaptureType]
$cenumFromTo :: JannoCaptureType -> JannoCaptureType -> [JannoCaptureType]
enumFromTo :: JannoCaptureType -> JannoCaptureType -> [JannoCaptureType]
$cenumFromThenTo :: JannoCaptureType
-> JannoCaptureType -> JannoCaptureType -> [JannoCaptureType]
enumFromThenTo :: JannoCaptureType
-> JannoCaptureType -> JannoCaptureType -> [JannoCaptureType]
Enum, JannoCaptureType
JannoCaptureType -> JannoCaptureType -> Bounded JannoCaptureType
forall a. a -> a -> Bounded a
$cminBound :: JannoCaptureType
minBound :: JannoCaptureType
$cmaxBound :: JannoCaptureType
maxBound :: JannoCaptureType
Bounded)
instance Makeable JannoCaptureType where
make :: forall (m :: * -> *). MonadFail m => Text -> m JannoCaptureType
make Text
x
| Text
x Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
"Shotgun" = JannoCaptureType -> m JannoCaptureType
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure JannoCaptureType
Shotgun
| Text
x Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
"1240K" = JannoCaptureType -> m JannoCaptureType
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure JannoCaptureType
A1240K
| Text
x Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
"ArborComplete" = JannoCaptureType -> m JannoCaptureType
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure JannoCaptureType
ArborComplete
| Text
x Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
"ArborPrimePlus" = JannoCaptureType -> m JannoCaptureType
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure JannoCaptureType
ArborPrimePlus
| Text
x Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
"ArborAncestralPlus" = JannoCaptureType -> m JannoCaptureType
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure JannoCaptureType
ArborAncestralPlus
| Text
x Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
"TwistAncientDNA" = JannoCaptureType -> m JannoCaptureType
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure JannoCaptureType
TwistAncientDNA
| Text
x Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
"OtherCapture" = JannoCaptureType -> m JannoCaptureType
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure JannoCaptureType
OtherCapture
| Text
x Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
"ReferenceGenome" = JannoCaptureType -> m JannoCaptureType
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure JannoCaptureType
ReferenceGenome
| Bool
otherwise = [Char] -> m JannoCaptureType
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoCaptureType) -> [Char] -> m JannoCaptureType
forall a b. (a -> b) -> a -> b
$ [Char]
"Capture_Type is set to " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Text -> [Char]
forall a. Show a => a -> [Char]
show Text
x [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
". " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++
[Char]
"That is not in the allowed set [Shotgun, 1240K, ArborComplete, ArborPrimePlus, ArborAncestralPlus, TwistAncientDNA, OtherCapture, ReferenceGenome]."
instance Show JannoCaptureType where
show :: JannoCaptureType -> [Char]
show JannoCaptureType
Shotgun = [Char]
"Shotgun"
show JannoCaptureType
A1240K = [Char]
"1240K"
show JannoCaptureType
ArborComplete = [Char]
"ArborComplete"
show JannoCaptureType
ArborPrimePlus = [Char]
"ArborPrimePlus"
show JannoCaptureType
ArborAncestralPlus = [Char]
"ArborAncestralPlus"
show JannoCaptureType
TwistAncientDNA = [Char]
"TwistAncientDNA"
show JannoCaptureType
OtherCapture = [Char]
"OtherCapture"
show JannoCaptureType
ReferenceGenome = [Char]
"ReferenceGenome"
instance Csv.ToField JannoCaptureType where toField :: JannoCaptureType -> Field
toField JannoCaptureType
x = [Char] -> Field
forall a. ToField a => a -> Field
Csv.toField ([Char] -> Field) -> [Char] -> Field
forall a b. (a -> b) -> a -> b
$ JannoCaptureType -> [Char]
forall a. Show a => a -> [Char]
show JannoCaptureType
x
instance Csv.FromField JannoCaptureType where parseField :: Field -> Parser JannoCaptureType
parseField = [Char] -> Field -> Parser JannoCaptureType
forall a (m :: * -> *).
(MonadFail m, Makeable a, Typeable a) =>
[Char] -> Field -> m a
parseTypeCSV [Char]
"Capture_Type"
data JannoUDG =
Minus
| Half
| Plus
| Mixed
deriving (JannoUDG -> JannoUDG -> Bool
(JannoUDG -> JannoUDG -> Bool)
-> (JannoUDG -> JannoUDG -> Bool) -> Eq JannoUDG
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoUDG -> JannoUDG -> Bool
== :: JannoUDG -> JannoUDG -> Bool
$c/= :: JannoUDG -> JannoUDG -> Bool
/= :: JannoUDG -> JannoUDG -> Bool
Eq, Eq JannoUDG
Eq JannoUDG
-> (JannoUDG -> JannoUDG -> Ordering)
-> (JannoUDG -> JannoUDG -> Bool)
-> (JannoUDG -> JannoUDG -> Bool)
-> (JannoUDG -> JannoUDG -> Bool)
-> (JannoUDG -> JannoUDG -> Bool)
-> (JannoUDG -> JannoUDG -> JannoUDG)
-> (JannoUDG -> JannoUDG -> JannoUDG)
-> Ord JannoUDG
JannoUDG -> JannoUDG -> Bool
JannoUDG -> JannoUDG -> Ordering
JannoUDG -> JannoUDG -> JannoUDG
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: JannoUDG -> JannoUDG -> Ordering
compare :: JannoUDG -> JannoUDG -> Ordering
$c< :: JannoUDG -> JannoUDG -> Bool
< :: JannoUDG -> JannoUDG -> Bool
$c<= :: JannoUDG -> JannoUDG -> Bool
<= :: JannoUDG -> JannoUDG -> Bool
$c> :: JannoUDG -> JannoUDG -> Bool
> :: JannoUDG -> JannoUDG -> Bool
$c>= :: JannoUDG -> JannoUDG -> Bool
>= :: JannoUDG -> JannoUDG -> Bool
$cmax :: JannoUDG -> JannoUDG -> JannoUDG
max :: JannoUDG -> JannoUDG -> JannoUDG
$cmin :: JannoUDG -> JannoUDG -> JannoUDG
min :: JannoUDG -> JannoUDG -> JannoUDG
Ord, (forall x. JannoUDG -> Rep JannoUDG x)
-> (forall x. Rep JannoUDG x -> JannoUDG) -> Generic JannoUDG
forall x. Rep JannoUDG x -> JannoUDG
forall x. JannoUDG -> Rep JannoUDG x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. JannoUDG -> Rep JannoUDG x
from :: forall x. JannoUDG -> Rep JannoUDG x
$cto :: forall x. Rep JannoUDG x -> JannoUDG
to :: forall x. Rep JannoUDG x -> JannoUDG
Generic, Int -> JannoUDG
JannoUDG -> Int
JannoUDG -> [JannoUDG]
JannoUDG -> JannoUDG
JannoUDG -> JannoUDG -> [JannoUDG]
JannoUDG -> JannoUDG -> JannoUDG -> [JannoUDG]
(JannoUDG -> JannoUDG)
-> (JannoUDG -> JannoUDG)
-> (Int -> JannoUDG)
-> (JannoUDG -> Int)
-> (JannoUDG -> [JannoUDG])
-> (JannoUDG -> JannoUDG -> [JannoUDG])
-> (JannoUDG -> JannoUDG -> [JannoUDG])
-> (JannoUDG -> JannoUDG -> JannoUDG -> [JannoUDG])
-> Enum JannoUDG
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: JannoUDG -> JannoUDG
succ :: JannoUDG -> JannoUDG
$cpred :: JannoUDG -> JannoUDG
pred :: JannoUDG -> JannoUDG
$ctoEnum :: Int -> JannoUDG
toEnum :: Int -> JannoUDG
$cfromEnum :: JannoUDG -> Int
fromEnum :: JannoUDG -> Int
$cenumFrom :: JannoUDG -> [JannoUDG]
enumFrom :: JannoUDG -> [JannoUDG]
$cenumFromThen :: JannoUDG -> JannoUDG -> [JannoUDG]
enumFromThen :: JannoUDG -> JannoUDG -> [JannoUDG]
$cenumFromTo :: JannoUDG -> JannoUDG -> [JannoUDG]
enumFromTo :: JannoUDG -> JannoUDG -> [JannoUDG]
$cenumFromThenTo :: JannoUDG -> JannoUDG -> JannoUDG -> [JannoUDG]
enumFromThenTo :: JannoUDG -> JannoUDG -> JannoUDG -> [JannoUDG]
Enum, JannoUDG
JannoUDG -> JannoUDG -> Bounded JannoUDG
forall a. a -> a -> Bounded a
$cminBound :: JannoUDG
minBound :: JannoUDG
$cmaxBound :: JannoUDG
maxBound :: JannoUDG
Bounded)
instance Makeable JannoUDG where
make :: forall (m :: * -> *). MonadFail m => Text -> m JannoUDG
make Text
x
| Text
x Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
"minus" = JannoUDG -> m JannoUDG
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure JannoUDG
Minus
| Text
x Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
"half" = JannoUDG -> m JannoUDG
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure JannoUDG
Half
| Text
x Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
"plus" = JannoUDG -> m JannoUDG
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure JannoUDG
Plus
| Text
x Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
"mixed" = JannoUDG -> m JannoUDG
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure JannoUDG
Mixed
| Bool
otherwise = [Char] -> m JannoUDG
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoUDG) -> [Char] -> m JannoUDG
forall a b. (a -> b) -> a -> b
$ [Char]
"UDG is set to " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Text -> [Char]
forall a. Show a => a -> [Char]
show Text
x [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
". " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++
[Char]
"That is not in the allowed set [minus, half, plus, mixed]."
instance Show JannoUDG where
show :: JannoUDG -> [Char]
show JannoUDG
Minus = [Char]
"minus"
show JannoUDG
Half = [Char]
"half"
show JannoUDG
Plus = [Char]
"plus"
show JannoUDG
Mixed = [Char]
"mixed"
instance Csv.ToField JannoUDG where toField :: JannoUDG -> Field
toField JannoUDG
x = [Char] -> Field
forall a. ToField a => a -> Field
Csv.toField ([Char] -> Field) -> [Char] -> Field
forall a b. (a -> b) -> a -> b
$ JannoUDG -> [Char]
forall a. Show a => a -> [Char]
show JannoUDG
x
instance Csv.FromField JannoUDG where parseField :: Field -> Parser JannoUDG
parseField = [Char] -> Field -> Parser JannoUDG
forall a (m :: * -> *).
(MonadFail m, Makeable a, Typeable a) =>
[Char] -> Field -> m a
parseTypeCSV [Char]
"UDG"
data JannoLibraryBuilt =
DS
| SS
| MixedSSDS
| Other
deriving (JannoLibraryBuilt -> JannoLibraryBuilt -> Bool
(JannoLibraryBuilt -> JannoLibraryBuilt -> Bool)
-> (JannoLibraryBuilt -> JannoLibraryBuilt -> Bool)
-> Eq JannoLibraryBuilt
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoLibraryBuilt -> JannoLibraryBuilt -> Bool
== :: JannoLibraryBuilt -> JannoLibraryBuilt -> Bool
$c/= :: JannoLibraryBuilt -> JannoLibraryBuilt -> Bool
/= :: JannoLibraryBuilt -> JannoLibraryBuilt -> Bool
Eq, Eq JannoLibraryBuilt
Eq JannoLibraryBuilt
-> (JannoLibraryBuilt -> JannoLibraryBuilt -> Ordering)
-> (JannoLibraryBuilt -> JannoLibraryBuilt -> Bool)
-> (JannoLibraryBuilt -> JannoLibraryBuilt -> Bool)
-> (JannoLibraryBuilt -> JannoLibraryBuilt -> Bool)
-> (JannoLibraryBuilt -> JannoLibraryBuilt -> Bool)
-> (JannoLibraryBuilt -> JannoLibraryBuilt -> JannoLibraryBuilt)
-> (JannoLibraryBuilt -> JannoLibraryBuilt -> JannoLibraryBuilt)
-> Ord JannoLibraryBuilt
JannoLibraryBuilt -> JannoLibraryBuilt -> Bool
JannoLibraryBuilt -> JannoLibraryBuilt -> Ordering
JannoLibraryBuilt -> JannoLibraryBuilt -> JannoLibraryBuilt
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: JannoLibraryBuilt -> JannoLibraryBuilt -> Ordering
compare :: JannoLibraryBuilt -> JannoLibraryBuilt -> Ordering
$c< :: JannoLibraryBuilt -> JannoLibraryBuilt -> Bool
< :: JannoLibraryBuilt -> JannoLibraryBuilt -> Bool
$c<= :: JannoLibraryBuilt -> JannoLibraryBuilt -> Bool
<= :: JannoLibraryBuilt -> JannoLibraryBuilt -> Bool
$c> :: JannoLibraryBuilt -> JannoLibraryBuilt -> Bool
> :: JannoLibraryBuilt -> JannoLibraryBuilt -> Bool
$c>= :: JannoLibraryBuilt -> JannoLibraryBuilt -> Bool
>= :: JannoLibraryBuilt -> JannoLibraryBuilt -> Bool
$cmax :: JannoLibraryBuilt -> JannoLibraryBuilt -> JannoLibraryBuilt
max :: JannoLibraryBuilt -> JannoLibraryBuilt -> JannoLibraryBuilt
$cmin :: JannoLibraryBuilt -> JannoLibraryBuilt -> JannoLibraryBuilt
min :: JannoLibraryBuilt -> JannoLibraryBuilt -> JannoLibraryBuilt
Ord, (forall x. JannoLibraryBuilt -> Rep JannoLibraryBuilt x)
-> (forall x. Rep JannoLibraryBuilt x -> JannoLibraryBuilt)
-> Generic JannoLibraryBuilt
forall x. Rep JannoLibraryBuilt x -> JannoLibraryBuilt
forall x. JannoLibraryBuilt -> Rep JannoLibraryBuilt x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. JannoLibraryBuilt -> Rep JannoLibraryBuilt x
from :: forall x. JannoLibraryBuilt -> Rep JannoLibraryBuilt x
$cto :: forall x. Rep JannoLibraryBuilt x -> JannoLibraryBuilt
to :: forall x. Rep JannoLibraryBuilt x -> JannoLibraryBuilt
Generic, Int -> JannoLibraryBuilt
JannoLibraryBuilt -> Int
JannoLibraryBuilt -> [JannoLibraryBuilt]
JannoLibraryBuilt -> JannoLibraryBuilt
JannoLibraryBuilt -> JannoLibraryBuilt -> [JannoLibraryBuilt]
JannoLibraryBuilt
-> JannoLibraryBuilt -> JannoLibraryBuilt -> [JannoLibraryBuilt]
(JannoLibraryBuilt -> JannoLibraryBuilt)
-> (JannoLibraryBuilt -> JannoLibraryBuilt)
-> (Int -> JannoLibraryBuilt)
-> (JannoLibraryBuilt -> Int)
-> (JannoLibraryBuilt -> [JannoLibraryBuilt])
-> (JannoLibraryBuilt -> JannoLibraryBuilt -> [JannoLibraryBuilt])
-> (JannoLibraryBuilt -> JannoLibraryBuilt -> [JannoLibraryBuilt])
-> (JannoLibraryBuilt
-> JannoLibraryBuilt -> JannoLibraryBuilt -> [JannoLibraryBuilt])
-> Enum JannoLibraryBuilt
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: JannoLibraryBuilt -> JannoLibraryBuilt
succ :: JannoLibraryBuilt -> JannoLibraryBuilt
$cpred :: JannoLibraryBuilt -> JannoLibraryBuilt
pred :: JannoLibraryBuilt -> JannoLibraryBuilt
$ctoEnum :: Int -> JannoLibraryBuilt
toEnum :: Int -> JannoLibraryBuilt
$cfromEnum :: JannoLibraryBuilt -> Int
fromEnum :: JannoLibraryBuilt -> Int
$cenumFrom :: JannoLibraryBuilt -> [JannoLibraryBuilt]
enumFrom :: JannoLibraryBuilt -> [JannoLibraryBuilt]
$cenumFromThen :: JannoLibraryBuilt -> JannoLibraryBuilt -> [JannoLibraryBuilt]
enumFromThen :: JannoLibraryBuilt -> JannoLibraryBuilt -> [JannoLibraryBuilt]
$cenumFromTo :: JannoLibraryBuilt -> JannoLibraryBuilt -> [JannoLibraryBuilt]
enumFromTo :: JannoLibraryBuilt -> JannoLibraryBuilt -> [JannoLibraryBuilt]
$cenumFromThenTo :: JannoLibraryBuilt
-> JannoLibraryBuilt -> JannoLibraryBuilt -> [JannoLibraryBuilt]
enumFromThenTo :: JannoLibraryBuilt
-> JannoLibraryBuilt -> JannoLibraryBuilt -> [JannoLibraryBuilt]
Enum, JannoLibraryBuilt
JannoLibraryBuilt -> JannoLibraryBuilt -> Bounded JannoLibraryBuilt
forall a. a -> a -> Bounded a
$cminBound :: JannoLibraryBuilt
minBound :: JannoLibraryBuilt
$cmaxBound :: JannoLibraryBuilt
maxBound :: JannoLibraryBuilt
Bounded)
instance Makeable JannoLibraryBuilt where
make :: forall (m :: * -> *). MonadFail m => Text -> m JannoLibraryBuilt
make Text
x
| Text
x Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
"ds" = JannoLibraryBuilt -> m JannoLibraryBuilt
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure JannoLibraryBuilt
DS
| Text
x Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
"ss" = JannoLibraryBuilt -> m JannoLibraryBuilt
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure JannoLibraryBuilt
SS
| Text
x Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
"mixed" = JannoLibraryBuilt -> m JannoLibraryBuilt
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure JannoLibraryBuilt
MixedSSDS
| Text
x Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
"other" = JannoLibraryBuilt -> m JannoLibraryBuilt
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure JannoLibraryBuilt
Other
| Bool
otherwise = [Char] -> m JannoLibraryBuilt
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoLibraryBuilt) -> [Char] -> m JannoLibraryBuilt
forall a b. (a -> b) -> a -> b
$ [Char]
"Library_Built is set to " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Text -> [Char]
forall a. Show a => a -> [Char]
show Text
x [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
". " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++
[Char]
"That is not in the allowed set [ds, ss, mixed]."
instance Show JannoLibraryBuilt where
show :: JannoLibraryBuilt -> [Char]
show JannoLibraryBuilt
DS = [Char]
"ds"
show JannoLibraryBuilt
SS = [Char]
"ss"
show JannoLibraryBuilt
MixedSSDS = [Char]
"mixed"
show JannoLibraryBuilt
Other = [Char]
"other"
instance Csv.ToField JannoLibraryBuilt where toField :: JannoLibraryBuilt -> Field
toField JannoLibraryBuilt
x = [Char] -> Field
forall a. ToField a => a -> Field
Csv.toField ([Char] -> Field) -> [Char] -> Field
forall a b. (a -> b) -> a -> b
$ JannoLibraryBuilt -> [Char]
forall a. Show a => a -> [Char]
show JannoLibraryBuilt
x
instance Csv.FromField JannoLibraryBuilt where parseField :: Field -> Parser JannoLibraryBuilt
parseField = [Char] -> Field -> Parser JannoLibraryBuilt
forall a (m :: * -> *).
(MonadFail m, Makeable a, Typeable a) =>
[Char] -> Field -> m a
parseTypeCSV [Char]
"Library_Built"
data JannoGenotypePloidy =
Diploid
| Haploid
deriving (JannoGenotypePloidy -> JannoGenotypePloidy -> Bool
(JannoGenotypePloidy -> JannoGenotypePloidy -> Bool)
-> (JannoGenotypePloidy -> JannoGenotypePloidy -> Bool)
-> Eq JannoGenotypePloidy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoGenotypePloidy -> JannoGenotypePloidy -> Bool
== :: JannoGenotypePloidy -> JannoGenotypePloidy -> Bool
$c/= :: JannoGenotypePloidy -> JannoGenotypePloidy -> Bool
/= :: JannoGenotypePloidy -> JannoGenotypePloidy -> Bool
Eq, Eq JannoGenotypePloidy
Eq JannoGenotypePloidy
-> (JannoGenotypePloidy -> JannoGenotypePloidy -> Ordering)
-> (JannoGenotypePloidy -> JannoGenotypePloidy -> Bool)
-> (JannoGenotypePloidy -> JannoGenotypePloidy -> Bool)
-> (JannoGenotypePloidy -> JannoGenotypePloidy -> Bool)
-> (JannoGenotypePloidy -> JannoGenotypePloidy -> Bool)
-> (JannoGenotypePloidy
-> JannoGenotypePloidy -> JannoGenotypePloidy)
-> (JannoGenotypePloidy
-> JannoGenotypePloidy -> JannoGenotypePloidy)
-> Ord JannoGenotypePloidy
JannoGenotypePloidy -> JannoGenotypePloidy -> Bool
JannoGenotypePloidy -> JannoGenotypePloidy -> Ordering
JannoGenotypePloidy -> JannoGenotypePloidy -> JannoGenotypePloidy
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: JannoGenotypePloidy -> JannoGenotypePloidy -> Ordering
compare :: JannoGenotypePloidy -> JannoGenotypePloidy -> Ordering
$c< :: JannoGenotypePloidy -> JannoGenotypePloidy -> Bool
< :: JannoGenotypePloidy -> JannoGenotypePloidy -> Bool
$c<= :: JannoGenotypePloidy -> JannoGenotypePloidy -> Bool
<= :: JannoGenotypePloidy -> JannoGenotypePloidy -> Bool
$c> :: JannoGenotypePloidy -> JannoGenotypePloidy -> Bool
> :: JannoGenotypePloidy -> JannoGenotypePloidy -> Bool
$c>= :: JannoGenotypePloidy -> JannoGenotypePloidy -> Bool
>= :: JannoGenotypePloidy -> JannoGenotypePloidy -> Bool
$cmax :: JannoGenotypePloidy -> JannoGenotypePloidy -> JannoGenotypePloidy
max :: JannoGenotypePloidy -> JannoGenotypePloidy -> JannoGenotypePloidy
$cmin :: JannoGenotypePloidy -> JannoGenotypePloidy -> JannoGenotypePloidy
min :: JannoGenotypePloidy -> JannoGenotypePloidy -> JannoGenotypePloidy
Ord, (forall x. JannoGenotypePloidy -> Rep JannoGenotypePloidy x)
-> (forall x. Rep JannoGenotypePloidy x -> JannoGenotypePloidy)
-> Generic JannoGenotypePloidy
forall x. Rep JannoGenotypePloidy x -> JannoGenotypePloidy
forall x. JannoGenotypePloidy -> Rep JannoGenotypePloidy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. JannoGenotypePloidy -> Rep JannoGenotypePloidy x
from :: forall x. JannoGenotypePloidy -> Rep JannoGenotypePloidy x
$cto :: forall x. Rep JannoGenotypePloidy x -> JannoGenotypePloidy
to :: forall x. Rep JannoGenotypePloidy x -> JannoGenotypePloidy
Generic, Int -> JannoGenotypePloidy
JannoGenotypePloidy -> Int
JannoGenotypePloidy -> [JannoGenotypePloidy]
JannoGenotypePloidy -> JannoGenotypePloidy
JannoGenotypePloidy -> JannoGenotypePloidy -> [JannoGenotypePloidy]
JannoGenotypePloidy
-> JannoGenotypePloidy
-> JannoGenotypePloidy
-> [JannoGenotypePloidy]
(JannoGenotypePloidy -> JannoGenotypePloidy)
-> (JannoGenotypePloidy -> JannoGenotypePloidy)
-> (Int -> JannoGenotypePloidy)
-> (JannoGenotypePloidy -> Int)
-> (JannoGenotypePloidy -> [JannoGenotypePloidy])
-> (JannoGenotypePloidy
-> JannoGenotypePloidy -> [JannoGenotypePloidy])
-> (JannoGenotypePloidy
-> JannoGenotypePloidy -> [JannoGenotypePloidy])
-> (JannoGenotypePloidy
-> JannoGenotypePloidy
-> JannoGenotypePloidy
-> [JannoGenotypePloidy])
-> Enum JannoGenotypePloidy
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: JannoGenotypePloidy -> JannoGenotypePloidy
succ :: JannoGenotypePloidy -> JannoGenotypePloidy
$cpred :: JannoGenotypePloidy -> JannoGenotypePloidy
pred :: JannoGenotypePloidy -> JannoGenotypePloidy
$ctoEnum :: Int -> JannoGenotypePloidy
toEnum :: Int -> JannoGenotypePloidy
$cfromEnum :: JannoGenotypePloidy -> Int
fromEnum :: JannoGenotypePloidy -> Int
$cenumFrom :: JannoGenotypePloidy -> [JannoGenotypePloidy]
enumFrom :: JannoGenotypePloidy -> [JannoGenotypePloidy]
$cenumFromThen :: JannoGenotypePloidy -> JannoGenotypePloidy -> [JannoGenotypePloidy]
enumFromThen :: JannoGenotypePloidy -> JannoGenotypePloidy -> [JannoGenotypePloidy]
$cenumFromTo :: JannoGenotypePloidy -> JannoGenotypePloidy -> [JannoGenotypePloidy]
enumFromTo :: JannoGenotypePloidy -> JannoGenotypePloidy -> [JannoGenotypePloidy]
$cenumFromThenTo :: JannoGenotypePloidy
-> JannoGenotypePloidy
-> JannoGenotypePloidy
-> [JannoGenotypePloidy]
enumFromThenTo :: JannoGenotypePloidy
-> JannoGenotypePloidy
-> JannoGenotypePloidy
-> [JannoGenotypePloidy]
Enum, JannoGenotypePloidy
JannoGenotypePloidy
-> JannoGenotypePloidy -> Bounded JannoGenotypePloidy
forall a. a -> a -> Bounded a
$cminBound :: JannoGenotypePloidy
minBound :: JannoGenotypePloidy
$cmaxBound :: JannoGenotypePloidy
maxBound :: JannoGenotypePloidy
Bounded)
instance Makeable JannoGenotypePloidy where
make :: forall (m :: * -> *). MonadFail m => Text -> m JannoGenotypePloidy
make Text
x
| Text
x Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
"diploid" = JannoGenotypePloidy -> m JannoGenotypePloidy
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure JannoGenotypePloidy
Diploid
| Text
x Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
"haploid" = JannoGenotypePloidy -> m JannoGenotypePloidy
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure JannoGenotypePloidy
Haploid
| Bool
otherwise = [Char] -> m JannoGenotypePloidy
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoGenotypePloidy)
-> [Char] -> m JannoGenotypePloidy
forall a b. (a -> b) -> a -> b
$ [Char]
"Genotype_Ploidy is set to " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Text -> [Char]
forall a. Show a => a -> [Char]
show Text
x [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
". " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++
[Char]
"That is not in the allowed set [diploid, haploid]."
instance Show JannoGenotypePloidy where
show :: JannoGenotypePloidy -> [Char]
show JannoGenotypePloidy
Diploid = [Char]
"diploid"
show JannoGenotypePloidy
Haploid = [Char]
"haploid"
instance Csv.ToField JannoGenotypePloidy where toField :: JannoGenotypePloidy -> Field
toField JannoGenotypePloidy
x = [Char] -> Field
forall a. ToField a => a -> Field
Csv.toField ([Char] -> Field) -> [Char] -> Field
forall a b. (a -> b) -> a -> b
$ JannoGenotypePloidy -> [Char]
forall a. Show a => a -> [Char]
show JannoGenotypePloidy
x
instance Csv.FromField JannoGenotypePloidy where parseField :: Field -> Parser JannoGenotypePloidy
parseField = [Char] -> Field -> Parser JannoGenotypePloidy
forall a (m :: * -> *).
(MonadFail m, Makeable a, Typeable a) =>
[Char] -> Field -> m a
parseTypeCSV [Char]
"Genotype_Ploidy"
newtype JannoDataPreparationPipelineURL = JannoDataPreparationPipelineURL T.Text deriving (JannoDataPreparationPipelineURL
-> JannoDataPreparationPipelineURL -> Bool
(JannoDataPreparationPipelineURL
-> JannoDataPreparationPipelineURL -> Bool)
-> (JannoDataPreparationPipelineURL
-> JannoDataPreparationPipelineURL -> Bool)
-> Eq JannoDataPreparationPipelineURL
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoDataPreparationPipelineURL
-> JannoDataPreparationPipelineURL -> Bool
== :: JannoDataPreparationPipelineURL
-> JannoDataPreparationPipelineURL -> Bool
$c/= :: JannoDataPreparationPipelineURL
-> JannoDataPreparationPipelineURL -> Bool
/= :: JannoDataPreparationPipelineURL
-> JannoDataPreparationPipelineURL -> Bool
Eq, Eq JannoDataPreparationPipelineURL
Eq JannoDataPreparationPipelineURL
-> (JannoDataPreparationPipelineURL
-> JannoDataPreparationPipelineURL -> Ordering)
-> (JannoDataPreparationPipelineURL
-> JannoDataPreparationPipelineURL -> Bool)
-> (JannoDataPreparationPipelineURL
-> JannoDataPreparationPipelineURL -> Bool)
-> (JannoDataPreparationPipelineURL
-> JannoDataPreparationPipelineURL -> Bool)
-> (JannoDataPreparationPipelineURL
-> JannoDataPreparationPipelineURL -> Bool)
-> (JannoDataPreparationPipelineURL
-> JannoDataPreparationPipelineURL
-> JannoDataPreparationPipelineURL)
-> (JannoDataPreparationPipelineURL
-> JannoDataPreparationPipelineURL
-> JannoDataPreparationPipelineURL)
-> Ord JannoDataPreparationPipelineURL
JannoDataPreparationPipelineURL
-> JannoDataPreparationPipelineURL -> Bool
JannoDataPreparationPipelineURL
-> JannoDataPreparationPipelineURL -> Ordering
JannoDataPreparationPipelineURL
-> JannoDataPreparationPipelineURL
-> JannoDataPreparationPipelineURL
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: JannoDataPreparationPipelineURL
-> JannoDataPreparationPipelineURL -> Ordering
compare :: JannoDataPreparationPipelineURL
-> JannoDataPreparationPipelineURL -> Ordering
$c< :: JannoDataPreparationPipelineURL
-> JannoDataPreparationPipelineURL -> Bool
< :: JannoDataPreparationPipelineURL
-> JannoDataPreparationPipelineURL -> Bool
$c<= :: JannoDataPreparationPipelineURL
-> JannoDataPreparationPipelineURL -> Bool
<= :: JannoDataPreparationPipelineURL
-> JannoDataPreparationPipelineURL -> Bool
$c> :: JannoDataPreparationPipelineURL
-> JannoDataPreparationPipelineURL -> Bool
> :: JannoDataPreparationPipelineURL
-> JannoDataPreparationPipelineURL -> Bool
$c>= :: JannoDataPreparationPipelineURL
-> JannoDataPreparationPipelineURL -> Bool
>= :: JannoDataPreparationPipelineURL
-> JannoDataPreparationPipelineURL -> Bool
$cmax :: JannoDataPreparationPipelineURL
-> JannoDataPreparationPipelineURL
-> JannoDataPreparationPipelineURL
max :: JannoDataPreparationPipelineURL
-> JannoDataPreparationPipelineURL
-> JannoDataPreparationPipelineURL
$cmin :: JannoDataPreparationPipelineURL
-> JannoDataPreparationPipelineURL
-> JannoDataPreparationPipelineURL
min :: JannoDataPreparationPipelineURL
-> JannoDataPreparationPipelineURL
-> JannoDataPreparationPipelineURL
Ord, (forall x.
JannoDataPreparationPipelineURL
-> Rep JannoDataPreparationPipelineURL x)
-> (forall x.
Rep JannoDataPreparationPipelineURL x
-> JannoDataPreparationPipelineURL)
-> Generic JannoDataPreparationPipelineURL
forall x.
Rep JannoDataPreparationPipelineURL x
-> JannoDataPreparationPipelineURL
forall x.
JannoDataPreparationPipelineURL
-> Rep JannoDataPreparationPipelineURL x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
JannoDataPreparationPipelineURL
-> Rep JannoDataPreparationPipelineURL x
from :: forall x.
JannoDataPreparationPipelineURL
-> Rep JannoDataPreparationPipelineURL x
$cto :: forall x.
Rep JannoDataPreparationPipelineURL x
-> JannoDataPreparationPipelineURL
to :: forall x.
Rep JannoDataPreparationPipelineURL x
-> JannoDataPreparationPipelineURL
Generic)
instance Makeable JannoDataPreparationPipelineURL where
make :: forall (m :: * -> *).
MonadFail m =>
Text -> m JannoDataPreparationPipelineURL
make Text
x
| [Char] -> Bool
isURIReference (Text -> [Char]
T.unpack Text
x) = JannoDataPreparationPipelineURL
-> m JannoDataPreparationPipelineURL
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (JannoDataPreparationPipelineURL
-> m JannoDataPreparationPipelineURL)
-> JannoDataPreparationPipelineURL
-> m JannoDataPreparationPipelineURL
forall a b. (a -> b) -> a -> b
$ Text -> JannoDataPreparationPipelineURL
JannoDataPreparationPipelineURL Text
x
| Bool
otherwise = [Char] -> m JannoDataPreparationPipelineURL
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoDataPreparationPipelineURL)
-> [Char] -> m JannoDataPreparationPipelineURL
forall a b. (a -> b) -> a -> b
$ [Char]
"Data_Preparation_Pipeline_URL " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Text -> [Char]
forall a. Show a => a -> [Char]
show Text
x [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
" is not a well structured URI."
instance Show JannoDataPreparationPipelineURL where show :: JannoDataPreparationPipelineURL -> [Char]
show (JannoDataPreparationPipelineURL Text
x) = Text -> [Char]
T.unpack Text
x
instance Csv.ToField JannoDataPreparationPipelineURL where toField :: JannoDataPreparationPipelineURL -> Field
toField (JannoDataPreparationPipelineURL Text
x) = Text -> Field
forall a. ToField a => a -> Field
Csv.toField Text
x
instance Csv.FromField JannoDataPreparationPipelineURL where parseField :: Field -> Parser JannoDataPreparationPipelineURL
parseField = [Char] -> Field -> Parser JannoDataPreparationPipelineURL
forall a (m :: * -> *).
(MonadFail m, Makeable a, Typeable a) =>
[Char] -> Field -> m a
parseTypeCSV [Char]
"Data_Preparation_Pipeline_URL"
newtype JannoEndogenous = JannoEndogenous Double deriving (JannoEndogenous -> JannoEndogenous -> Bool
(JannoEndogenous -> JannoEndogenous -> Bool)
-> (JannoEndogenous -> JannoEndogenous -> Bool)
-> Eq JannoEndogenous
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoEndogenous -> JannoEndogenous -> Bool
== :: JannoEndogenous -> JannoEndogenous -> Bool
$c/= :: JannoEndogenous -> JannoEndogenous -> Bool
/= :: JannoEndogenous -> JannoEndogenous -> Bool
Eq, Eq JannoEndogenous
Eq JannoEndogenous
-> (JannoEndogenous -> JannoEndogenous -> Ordering)
-> (JannoEndogenous -> JannoEndogenous -> Bool)
-> (JannoEndogenous -> JannoEndogenous -> Bool)
-> (JannoEndogenous -> JannoEndogenous -> Bool)
-> (JannoEndogenous -> JannoEndogenous -> Bool)
-> (JannoEndogenous -> JannoEndogenous -> JannoEndogenous)
-> (JannoEndogenous -> JannoEndogenous -> JannoEndogenous)
-> Ord JannoEndogenous
JannoEndogenous -> JannoEndogenous -> Bool
JannoEndogenous -> JannoEndogenous -> Ordering
JannoEndogenous -> JannoEndogenous -> JannoEndogenous
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: JannoEndogenous -> JannoEndogenous -> Ordering
compare :: JannoEndogenous -> JannoEndogenous -> Ordering
$c< :: JannoEndogenous -> JannoEndogenous -> Bool
< :: JannoEndogenous -> JannoEndogenous -> Bool
$c<= :: JannoEndogenous -> JannoEndogenous -> Bool
<= :: JannoEndogenous -> JannoEndogenous -> Bool
$c> :: JannoEndogenous -> JannoEndogenous -> Bool
> :: JannoEndogenous -> JannoEndogenous -> Bool
$c>= :: JannoEndogenous -> JannoEndogenous -> Bool
>= :: JannoEndogenous -> JannoEndogenous -> Bool
$cmax :: JannoEndogenous -> JannoEndogenous -> JannoEndogenous
max :: JannoEndogenous -> JannoEndogenous -> JannoEndogenous
$cmin :: JannoEndogenous -> JannoEndogenous -> JannoEndogenous
min :: JannoEndogenous -> JannoEndogenous -> JannoEndogenous
Ord, (forall x. JannoEndogenous -> Rep JannoEndogenous x)
-> (forall x. Rep JannoEndogenous x -> JannoEndogenous)
-> Generic JannoEndogenous
forall x. Rep JannoEndogenous x -> JannoEndogenous
forall x. JannoEndogenous -> Rep JannoEndogenous x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. JannoEndogenous -> Rep JannoEndogenous x
from :: forall x. JannoEndogenous -> Rep JannoEndogenous x
$cto :: forall x. Rep JannoEndogenous x -> JannoEndogenous
to :: forall x. Rep JannoEndogenous x -> JannoEndogenous
Generic)
instance Makeable JannoEndogenous where
make :: forall (m :: * -> *). MonadFail m => Text -> m JannoEndogenous
make Text
x =
case Reader Double
T.double Text
x of
Left [Char]
e -> [Char] -> m JannoEndogenous
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoEndogenous) -> [Char] -> m JannoEndogenous
forall a b. (a -> b) -> a -> b
$ [Char]
"Endogenous can not be converted to Double because " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
e
Right (Double
num, Text
"") ->
if Double
num Double -> Double -> Bool
forall a. Ord a => a -> a -> Bool
>= Double
0 Bool -> Bool -> Bool
&& Double
num Double -> Double -> Bool
forall a. Ord a => a -> a -> Bool
<= Double
100
then JannoEndogenous -> m JannoEndogenous
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Double -> JannoEndogenous
JannoEndogenous Double
num)
else [Char] -> m JannoEndogenous
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoEndogenous) -> [Char] -> m JannoEndogenous
forall a b. (a -> b) -> a -> b
$ [Char]
"Endogenous " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Text -> [Char]
forall a. Show a => a -> [Char]
show Text
x [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
" not between 0 and 100."
Right (Double
_, Text
rest) -> [Char] -> m JannoEndogenous
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoEndogenous) -> [Char] -> m JannoEndogenous
forall a b. (a -> b) -> a -> b
$ [Char]
"Endogenous can not be converted to Double, because of a trailing " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Text -> [Char]
forall a. Show a => a -> [Char]
show Text
rest
instance Show JannoEndogenous where show :: JannoEndogenous -> [Char]
show (JannoEndogenous Double
x) = Double -> [Char]
forall a. Show a => a -> [Char]
show Double
x
instance Csv.ToField JannoEndogenous where toField :: JannoEndogenous -> Field
toField (JannoEndogenous Double
x) = Double -> Field
forall a. ToField a => a -> Field
Csv.toField Double
x
instance Csv.FromField JannoEndogenous where parseField :: Field -> Parser JannoEndogenous
parseField = [Char] -> Field -> Parser JannoEndogenous
forall a (m :: * -> *).
(MonadFail m, Makeable a, Typeable a) =>
[Char] -> Field -> m a
parseTypeCSV [Char]
"Endogenous"
newtype JannoNrSNPs = JannoNrSNPs Int deriving (JannoNrSNPs -> JannoNrSNPs -> Bool
(JannoNrSNPs -> JannoNrSNPs -> Bool)
-> (JannoNrSNPs -> JannoNrSNPs -> Bool) -> Eq JannoNrSNPs
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoNrSNPs -> JannoNrSNPs -> Bool
== :: JannoNrSNPs -> JannoNrSNPs -> Bool
$c/= :: JannoNrSNPs -> JannoNrSNPs -> Bool
/= :: JannoNrSNPs -> JannoNrSNPs -> Bool
Eq, Eq JannoNrSNPs
Eq JannoNrSNPs
-> (JannoNrSNPs -> JannoNrSNPs -> Ordering)
-> (JannoNrSNPs -> JannoNrSNPs -> Bool)
-> (JannoNrSNPs -> JannoNrSNPs -> Bool)
-> (JannoNrSNPs -> JannoNrSNPs -> Bool)
-> (JannoNrSNPs -> JannoNrSNPs -> Bool)
-> (JannoNrSNPs -> JannoNrSNPs -> JannoNrSNPs)
-> (JannoNrSNPs -> JannoNrSNPs -> JannoNrSNPs)
-> Ord JannoNrSNPs
JannoNrSNPs -> JannoNrSNPs -> Bool
JannoNrSNPs -> JannoNrSNPs -> Ordering
JannoNrSNPs -> JannoNrSNPs -> JannoNrSNPs
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: JannoNrSNPs -> JannoNrSNPs -> Ordering
compare :: JannoNrSNPs -> JannoNrSNPs -> Ordering
$c< :: JannoNrSNPs -> JannoNrSNPs -> Bool
< :: JannoNrSNPs -> JannoNrSNPs -> Bool
$c<= :: JannoNrSNPs -> JannoNrSNPs -> Bool
<= :: JannoNrSNPs -> JannoNrSNPs -> Bool
$c> :: JannoNrSNPs -> JannoNrSNPs -> Bool
> :: JannoNrSNPs -> JannoNrSNPs -> Bool
$c>= :: JannoNrSNPs -> JannoNrSNPs -> Bool
>= :: JannoNrSNPs -> JannoNrSNPs -> Bool
$cmax :: JannoNrSNPs -> JannoNrSNPs -> JannoNrSNPs
max :: JannoNrSNPs -> JannoNrSNPs -> JannoNrSNPs
$cmin :: JannoNrSNPs -> JannoNrSNPs -> JannoNrSNPs
min :: JannoNrSNPs -> JannoNrSNPs -> JannoNrSNPs
Ord, (forall x. JannoNrSNPs -> Rep JannoNrSNPs x)
-> (forall x. Rep JannoNrSNPs x -> JannoNrSNPs)
-> Generic JannoNrSNPs
forall x. Rep JannoNrSNPs x -> JannoNrSNPs
forall x. JannoNrSNPs -> Rep JannoNrSNPs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. JannoNrSNPs -> Rep JannoNrSNPs x
from :: forall x. JannoNrSNPs -> Rep JannoNrSNPs x
$cto :: forall x. Rep JannoNrSNPs x -> JannoNrSNPs
to :: forall x. Rep JannoNrSNPs x -> JannoNrSNPs
Generic)
instance Makeable JannoNrSNPs where
make :: forall (m :: * -> *). MonadFail m => Text -> m JannoNrSNPs
make Text
x =
case Reader Int -> Reader Int
forall a. Num a => Reader a -> Reader a
T.signed Reader Int
forall a. Integral a => Reader a
T.decimal Text
x of
Left [Char]
e -> [Char] -> m JannoNrSNPs
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoNrSNPs) -> [Char] -> m JannoNrSNPs
forall a b. (a -> b) -> a -> b
$ [Char]
"Nr_SNPs can not be converted to Int because " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
e
Right (Int
num, Text
"") ->
if Int
num Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
< Int
0
then [Char] -> m JannoNrSNPs
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoNrSNPs) -> [Char] -> m JannoNrSNPs
forall a b. (a -> b) -> a -> b
$ [Char]
"Nr_SNPs " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Text -> [Char]
forall a. Show a => a -> [Char]
show Text
x [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
" lower than 0, which is not meaningful."
else JannoNrSNPs -> m JannoNrSNPs
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (JannoNrSNPs -> m JannoNrSNPs) -> JannoNrSNPs -> m JannoNrSNPs
forall a b. (a -> b) -> a -> b
$ Int -> JannoNrSNPs
JannoNrSNPs Int
num
Right (Int
_, Text
rest) -> [Char] -> m JannoNrSNPs
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoNrSNPs) -> [Char] -> m JannoNrSNPs
forall a b. (a -> b) -> a -> b
$ [Char]
"Nr_SNPs can not be converted to Int, because of a trailing " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Text -> [Char]
forall a. Show a => a -> [Char]
show Text
rest
instance Show JannoNrSNPs where show :: JannoNrSNPs -> [Char]
show (JannoNrSNPs Int
x) = Int -> [Char]
forall a. Show a => a -> [Char]
show Int
x
instance Csv.ToField JannoNrSNPs where toField :: JannoNrSNPs -> Field
toField (JannoNrSNPs Int
x) = Int -> Field
forall a. ToField a => a -> Field
Csv.toField Int
x
instance Csv.FromField JannoNrSNPs where parseField :: Field -> Parser JannoNrSNPs
parseField = [Char] -> Field -> Parser JannoNrSNPs
forall a (m :: * -> *).
(MonadFail m, Makeable a, Typeable a) =>
[Char] -> Field -> m a
parseTypeCSV [Char]
"Nr_SNPs"
newtype JannoCoverageOnTargets = JannoCoverageOnTargets Double deriving (JannoCoverageOnTargets -> JannoCoverageOnTargets -> Bool
(JannoCoverageOnTargets -> JannoCoverageOnTargets -> Bool)
-> (JannoCoverageOnTargets -> JannoCoverageOnTargets -> Bool)
-> Eq JannoCoverageOnTargets
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoCoverageOnTargets -> JannoCoverageOnTargets -> Bool
== :: JannoCoverageOnTargets -> JannoCoverageOnTargets -> Bool
$c/= :: JannoCoverageOnTargets -> JannoCoverageOnTargets -> Bool
/= :: JannoCoverageOnTargets -> JannoCoverageOnTargets -> Bool
Eq, Eq JannoCoverageOnTargets
Eq JannoCoverageOnTargets
-> (JannoCoverageOnTargets -> JannoCoverageOnTargets -> Ordering)
-> (JannoCoverageOnTargets -> JannoCoverageOnTargets -> Bool)
-> (JannoCoverageOnTargets -> JannoCoverageOnTargets -> Bool)
-> (JannoCoverageOnTargets -> JannoCoverageOnTargets -> Bool)
-> (JannoCoverageOnTargets -> JannoCoverageOnTargets -> Bool)
-> (JannoCoverageOnTargets
-> JannoCoverageOnTargets -> JannoCoverageOnTargets)
-> (JannoCoverageOnTargets
-> JannoCoverageOnTargets -> JannoCoverageOnTargets)
-> Ord JannoCoverageOnTargets
JannoCoverageOnTargets -> JannoCoverageOnTargets -> Bool
JannoCoverageOnTargets -> JannoCoverageOnTargets -> Ordering
JannoCoverageOnTargets
-> JannoCoverageOnTargets -> JannoCoverageOnTargets
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: JannoCoverageOnTargets -> JannoCoverageOnTargets -> Ordering
compare :: JannoCoverageOnTargets -> JannoCoverageOnTargets -> Ordering
$c< :: JannoCoverageOnTargets -> JannoCoverageOnTargets -> Bool
< :: JannoCoverageOnTargets -> JannoCoverageOnTargets -> Bool
$c<= :: JannoCoverageOnTargets -> JannoCoverageOnTargets -> Bool
<= :: JannoCoverageOnTargets -> JannoCoverageOnTargets -> Bool
$c> :: JannoCoverageOnTargets -> JannoCoverageOnTargets -> Bool
> :: JannoCoverageOnTargets -> JannoCoverageOnTargets -> Bool
$c>= :: JannoCoverageOnTargets -> JannoCoverageOnTargets -> Bool
>= :: JannoCoverageOnTargets -> JannoCoverageOnTargets -> Bool
$cmax :: JannoCoverageOnTargets
-> JannoCoverageOnTargets -> JannoCoverageOnTargets
max :: JannoCoverageOnTargets
-> JannoCoverageOnTargets -> JannoCoverageOnTargets
$cmin :: JannoCoverageOnTargets
-> JannoCoverageOnTargets -> JannoCoverageOnTargets
min :: JannoCoverageOnTargets
-> JannoCoverageOnTargets -> JannoCoverageOnTargets
Ord, (forall x. JannoCoverageOnTargets -> Rep JannoCoverageOnTargets x)
-> (forall x.
Rep JannoCoverageOnTargets x -> JannoCoverageOnTargets)
-> Generic JannoCoverageOnTargets
forall x. Rep JannoCoverageOnTargets x -> JannoCoverageOnTargets
forall x. JannoCoverageOnTargets -> Rep JannoCoverageOnTargets x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. JannoCoverageOnTargets -> Rep JannoCoverageOnTargets x
from :: forall x. JannoCoverageOnTargets -> Rep JannoCoverageOnTargets x
$cto :: forall x. Rep JannoCoverageOnTargets x -> JannoCoverageOnTargets
to :: forall x. Rep JannoCoverageOnTargets x -> JannoCoverageOnTargets
Generic)
instance Makeable JannoCoverageOnTargets where
make :: forall (m :: * -> *).
MonadFail m =>
Text -> m JannoCoverageOnTargets
make Text
x =
case Reader Double
T.double Text
x of
Left [Char]
e -> [Char] -> m JannoCoverageOnTargets
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoCoverageOnTargets)
-> [Char] -> m JannoCoverageOnTargets
forall a b. (a -> b) -> a -> b
$ [Char]
"Coverage_on_Target_SNPs can not be converted to Double because " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
e
Right (Double
num, Text
"") -> JannoCoverageOnTargets -> m JannoCoverageOnTargets
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Double -> JannoCoverageOnTargets
JannoCoverageOnTargets Double
num)
Right (Double
_, Text
rest) -> [Char] -> m JannoCoverageOnTargets
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoCoverageOnTargets)
-> [Char] -> m JannoCoverageOnTargets
forall a b. (a -> b) -> a -> b
$ [Char]
"Coverage_on_Target_SNPs can not be converted to Double, because of a trailing " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Text -> [Char]
forall a. Show a => a -> [Char]
show Text
rest
instance Show JannoCoverageOnTargets where show :: JannoCoverageOnTargets -> [Char]
show (JannoCoverageOnTargets Double
x) = Double -> [Char]
forall a. Show a => a -> [Char]
show Double
x
instance Csv.ToField JannoCoverageOnTargets where toField :: JannoCoverageOnTargets -> Field
toField (JannoCoverageOnTargets Double
x) = Double -> Field
forall a. ToField a => a -> Field
Csv.toField Double
x
instance Csv.FromField JannoCoverageOnTargets where parseField :: Field -> Parser JannoCoverageOnTargets
parseField = [Char] -> Field -> Parser JannoCoverageOnTargets
forall a (m :: * -> *).
(MonadFail m, Makeable a, Typeable a) =>
[Char] -> Field -> m a
parseTypeCSV [Char]
"Coverage_on_Target_SNPs"
newtype JannoDamage = JannoDamage Double deriving (JannoDamage -> JannoDamage -> Bool
(JannoDamage -> JannoDamage -> Bool)
-> (JannoDamage -> JannoDamage -> Bool) -> Eq JannoDamage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoDamage -> JannoDamage -> Bool
== :: JannoDamage -> JannoDamage -> Bool
$c/= :: JannoDamage -> JannoDamage -> Bool
/= :: JannoDamage -> JannoDamage -> Bool
Eq, Eq JannoDamage
Eq JannoDamage
-> (JannoDamage -> JannoDamage -> Ordering)
-> (JannoDamage -> JannoDamage -> Bool)
-> (JannoDamage -> JannoDamage -> Bool)
-> (JannoDamage -> JannoDamage -> Bool)
-> (JannoDamage -> JannoDamage -> Bool)
-> (JannoDamage -> JannoDamage -> JannoDamage)
-> (JannoDamage -> JannoDamage -> JannoDamage)
-> Ord JannoDamage
JannoDamage -> JannoDamage -> Bool
JannoDamage -> JannoDamage -> Ordering
JannoDamage -> JannoDamage -> JannoDamage
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: JannoDamage -> JannoDamage -> Ordering
compare :: JannoDamage -> JannoDamage -> Ordering
$c< :: JannoDamage -> JannoDamage -> Bool
< :: JannoDamage -> JannoDamage -> Bool
$c<= :: JannoDamage -> JannoDamage -> Bool
<= :: JannoDamage -> JannoDamage -> Bool
$c> :: JannoDamage -> JannoDamage -> Bool
> :: JannoDamage -> JannoDamage -> Bool
$c>= :: JannoDamage -> JannoDamage -> Bool
>= :: JannoDamage -> JannoDamage -> Bool
$cmax :: JannoDamage -> JannoDamage -> JannoDamage
max :: JannoDamage -> JannoDamage -> JannoDamage
$cmin :: JannoDamage -> JannoDamage -> JannoDamage
min :: JannoDamage -> JannoDamage -> JannoDamage
Ord, (forall x. JannoDamage -> Rep JannoDamage x)
-> (forall x. Rep JannoDamage x -> JannoDamage)
-> Generic JannoDamage
forall x. Rep JannoDamage x -> JannoDamage
forall x. JannoDamage -> Rep JannoDamage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. JannoDamage -> Rep JannoDamage x
from :: forall x. JannoDamage -> Rep JannoDamage x
$cto :: forall x. Rep JannoDamage x -> JannoDamage
to :: forall x. Rep JannoDamage x -> JannoDamage
Generic)
instance Makeable JannoDamage where
make :: forall (m :: * -> *). MonadFail m => Text -> m JannoDamage
make Text
x =
case Reader Double
T.double Text
x of
Left [Char]
e -> [Char] -> m JannoDamage
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoDamage) -> [Char] -> m JannoDamage
forall a b. (a -> b) -> a -> b
$ [Char]
"Damage can not be converted to Double because " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
e
Right (Double
num, Text
"") ->
if Double
num Double -> Double -> Bool
forall a. Ord a => a -> a -> Bool
>= Double
0 Bool -> Bool -> Bool
&& Double
num Double -> Double -> Bool
forall a. Ord a => a -> a -> Bool
<= Double
100
then JannoDamage -> m JannoDamage
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Double -> JannoDamage
JannoDamage Double
num)
else [Char] -> m JannoDamage
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoDamage) -> [Char] -> m JannoDamage
forall a b. (a -> b) -> a -> b
$ [Char]
"Damage " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Text -> [Char]
forall a. Show a => a -> [Char]
show Text
x [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
" not between 0 and 100."
Right (Double
_, Text
rest) -> [Char] -> m JannoDamage
forall a. [Char] -> m a
forall (m :: * -> *) a. MonadFail m => [Char] -> m a
fail ([Char] -> m JannoDamage) -> [Char] -> m JannoDamage
forall a b. (a -> b) -> a -> b
$ [Char]
"Damage can not be converted to Double, because of a trailing " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Text -> [Char]
forall a. Show a => a -> [Char]
show Text
rest
instance Show JannoDamage where show :: JannoDamage -> [Char]
show (JannoDamage Double
x) = Double -> [Char]
forall a. Show a => a -> [Char]
show Double
x
instance Csv.ToField JannoDamage where toField :: JannoDamage -> Field
toField (JannoDamage Double
x) = Double -> Field
forall a. ToField a => a -> Field
Csv.toField Double
x
instance Csv.FromField JannoDamage where parseField :: Field -> Parser JannoDamage
parseField = [Char] -> Field -> Parser JannoDamage
forall a (m :: * -> *).
(MonadFail m, Makeable a, Typeable a) =>
[Char] -> Field -> m a
parseTypeCSV [Char]
"Damage"
newtype JannoContamination = JannoContamination T.Text deriving (JannoContamination -> JannoContamination -> Bool
(JannoContamination -> JannoContamination -> Bool)
-> (JannoContamination -> JannoContamination -> Bool)
-> Eq JannoContamination
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoContamination -> JannoContamination -> Bool
== :: JannoContamination -> JannoContamination -> Bool
$c/= :: JannoContamination -> JannoContamination -> Bool
/= :: JannoContamination -> JannoContamination -> Bool
Eq)
$(makeInstances ''JannoContamination "Contamination")
newtype JannoContaminationErr = JannoContaminationErr T.Text deriving (JannoContaminationErr -> JannoContaminationErr -> Bool
(JannoContaminationErr -> JannoContaminationErr -> Bool)
-> (JannoContaminationErr -> JannoContaminationErr -> Bool)
-> Eq JannoContaminationErr
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoContaminationErr -> JannoContaminationErr -> Bool
== :: JannoContaminationErr -> JannoContaminationErr -> Bool
$c/= :: JannoContaminationErr -> JannoContaminationErr -> Bool
/= :: JannoContaminationErr -> JannoContaminationErr -> Bool
Eq)
$(makeInstances ''JannoContaminationErr "Contamination_Err")
newtype JannoContaminationMeas = JannoContaminationMeas T.Text deriving (JannoContaminationMeas -> JannoContaminationMeas -> Bool
(JannoContaminationMeas -> JannoContaminationMeas -> Bool)
-> (JannoContaminationMeas -> JannoContaminationMeas -> Bool)
-> Eq JannoContaminationMeas
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoContaminationMeas -> JannoContaminationMeas -> Bool
== :: JannoContaminationMeas -> JannoContaminationMeas -> Bool
$c/= :: JannoContaminationMeas -> JannoContaminationMeas -> Bool
/= :: JannoContaminationMeas -> JannoContaminationMeas -> Bool
Eq)
$(makeInstances ''JannoContaminationMeas "Contamination_Meas")
newtype JannoContaminationNote = JannoContaminationNote T.Text deriving (JannoContaminationNote -> JannoContaminationNote -> Bool
(JannoContaminationNote -> JannoContaminationNote -> Bool)
-> (JannoContaminationNote -> JannoContaminationNote -> Bool)
-> Eq JannoContaminationNote
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoContaminationNote -> JannoContaminationNote -> Bool
== :: JannoContaminationNote -> JannoContaminationNote -> Bool
$c/= :: JannoContaminationNote -> JannoContaminationNote -> Bool
/= :: JannoContaminationNote -> JannoContaminationNote -> Bool
Eq)
$(makeInstances ''JannoContaminationNote "Contamination_Note")
data JannoGeneticSourceAccessionID =
INSDCProject T.Text
| INSDCStudy T.Text
| INSDCBioSample T.Text
| INSDCSample T.Text
| INSDCExperiment T.Text
| INSDCRun T.Text
| INSDCAnalysis T.Text
| OtherID T.Text
deriving (JannoGeneticSourceAccessionID
-> JannoGeneticSourceAccessionID -> Bool
(JannoGeneticSourceAccessionID
-> JannoGeneticSourceAccessionID -> Bool)
-> (JannoGeneticSourceAccessionID
-> JannoGeneticSourceAccessionID -> Bool)
-> Eq JannoGeneticSourceAccessionID
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoGeneticSourceAccessionID
-> JannoGeneticSourceAccessionID -> Bool
== :: JannoGeneticSourceAccessionID
-> JannoGeneticSourceAccessionID -> Bool
$c/= :: JannoGeneticSourceAccessionID
-> JannoGeneticSourceAccessionID -> Bool
/= :: JannoGeneticSourceAccessionID
-> JannoGeneticSourceAccessionID -> Bool
Eq, Eq JannoGeneticSourceAccessionID
Eq JannoGeneticSourceAccessionID
-> (JannoGeneticSourceAccessionID
-> JannoGeneticSourceAccessionID -> Ordering)
-> (JannoGeneticSourceAccessionID
-> JannoGeneticSourceAccessionID -> Bool)
-> (JannoGeneticSourceAccessionID
-> JannoGeneticSourceAccessionID -> Bool)
-> (JannoGeneticSourceAccessionID
-> JannoGeneticSourceAccessionID -> Bool)
-> (JannoGeneticSourceAccessionID
-> JannoGeneticSourceAccessionID -> Bool)
-> (JannoGeneticSourceAccessionID
-> JannoGeneticSourceAccessionID -> JannoGeneticSourceAccessionID)
-> (JannoGeneticSourceAccessionID
-> JannoGeneticSourceAccessionID -> JannoGeneticSourceAccessionID)
-> Ord JannoGeneticSourceAccessionID
JannoGeneticSourceAccessionID
-> JannoGeneticSourceAccessionID -> Bool
JannoGeneticSourceAccessionID
-> JannoGeneticSourceAccessionID -> Ordering
JannoGeneticSourceAccessionID
-> JannoGeneticSourceAccessionID -> JannoGeneticSourceAccessionID
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: JannoGeneticSourceAccessionID
-> JannoGeneticSourceAccessionID -> Ordering
compare :: JannoGeneticSourceAccessionID
-> JannoGeneticSourceAccessionID -> Ordering
$c< :: JannoGeneticSourceAccessionID
-> JannoGeneticSourceAccessionID -> Bool
< :: JannoGeneticSourceAccessionID
-> JannoGeneticSourceAccessionID -> Bool
$c<= :: JannoGeneticSourceAccessionID
-> JannoGeneticSourceAccessionID -> Bool
<= :: JannoGeneticSourceAccessionID
-> JannoGeneticSourceAccessionID -> Bool
$c> :: JannoGeneticSourceAccessionID
-> JannoGeneticSourceAccessionID -> Bool
> :: JannoGeneticSourceAccessionID
-> JannoGeneticSourceAccessionID -> Bool
$c>= :: JannoGeneticSourceAccessionID
-> JannoGeneticSourceAccessionID -> Bool
>= :: JannoGeneticSourceAccessionID
-> JannoGeneticSourceAccessionID -> Bool
$cmax :: JannoGeneticSourceAccessionID
-> JannoGeneticSourceAccessionID -> JannoGeneticSourceAccessionID
max :: JannoGeneticSourceAccessionID
-> JannoGeneticSourceAccessionID -> JannoGeneticSourceAccessionID
$cmin :: JannoGeneticSourceAccessionID
-> JannoGeneticSourceAccessionID -> JannoGeneticSourceAccessionID
min :: JannoGeneticSourceAccessionID
-> JannoGeneticSourceAccessionID -> JannoGeneticSourceAccessionID
Ord, (forall x.
JannoGeneticSourceAccessionID
-> Rep JannoGeneticSourceAccessionID x)
-> (forall x.
Rep JannoGeneticSourceAccessionID x
-> JannoGeneticSourceAccessionID)
-> Generic JannoGeneticSourceAccessionID
forall x.
Rep JannoGeneticSourceAccessionID x
-> JannoGeneticSourceAccessionID
forall x.
JannoGeneticSourceAccessionID
-> Rep JannoGeneticSourceAccessionID x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
JannoGeneticSourceAccessionID
-> Rep JannoGeneticSourceAccessionID x
from :: forall x.
JannoGeneticSourceAccessionID
-> Rep JannoGeneticSourceAccessionID x
$cto :: forall x.
Rep JannoGeneticSourceAccessionID x
-> JannoGeneticSourceAccessionID
to :: forall x.
Rep JannoGeneticSourceAccessionID x
-> JannoGeneticSourceAccessionID
Generic)
instance Makeable JannoGeneticSourceAccessionID where
make :: forall (m :: * -> *).
MonadFail m =>
Text -> m JannoGeneticSourceAccessionID
make Text
x
| (Text -> [Char]
T.unpack Text
x) [Char] -> [Char] -> Bool
forall source source1 target.
(RegexMaker Regex CompOption ExecOption source,
RegexContext Regex source1 target) =>
source1 -> source -> target
Reg.=~ ([Char]
"PRJ[EDN][A-Z][0-9]+" :: String) = JannoGeneticSourceAccessionID -> m JannoGeneticSourceAccessionID
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (JannoGeneticSourceAccessionID -> m JannoGeneticSourceAccessionID)
-> JannoGeneticSourceAccessionID -> m JannoGeneticSourceAccessionID
forall a b. (a -> b) -> a -> b
$ Text -> JannoGeneticSourceAccessionID
INSDCProject Text
x
| (Text -> [Char]
T.unpack Text
x) [Char] -> [Char] -> Bool
forall source source1 target.
(RegexMaker Regex CompOption ExecOption source,
RegexContext Regex source1 target) =>
source1 -> source -> target
Reg.=~ ([Char]
"[EDS]RP[0-9]{6,}" :: String) = JannoGeneticSourceAccessionID -> m JannoGeneticSourceAccessionID
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (JannoGeneticSourceAccessionID -> m JannoGeneticSourceAccessionID)
-> JannoGeneticSourceAccessionID -> m JannoGeneticSourceAccessionID
forall a b. (a -> b) -> a -> b
$ Text -> JannoGeneticSourceAccessionID
INSDCStudy Text
x
| (Text -> [Char]
T.unpack Text
x) [Char] -> [Char] -> Bool
forall source source1 target.
(RegexMaker Regex CompOption ExecOption source,
RegexContext Regex source1 target) =>
source1 -> source -> target
Reg.=~ ([Char]
"SAM[EDN][A-Z]?[0-9]+" :: String) = JannoGeneticSourceAccessionID -> m JannoGeneticSourceAccessionID
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (JannoGeneticSourceAccessionID -> m JannoGeneticSourceAccessionID)
-> JannoGeneticSourceAccessionID -> m JannoGeneticSourceAccessionID
forall a b. (a -> b) -> a -> b
$ Text -> JannoGeneticSourceAccessionID
INSDCBioSample Text
x
| (Text -> [Char]
T.unpack Text
x) [Char] -> [Char] -> Bool
forall source source1 target.
(RegexMaker Regex CompOption ExecOption source,
RegexContext Regex source1 target) =>
source1 -> source -> target
Reg.=~ ([Char]
"[EDS]RS[0-9]{6,}" :: String) = JannoGeneticSourceAccessionID -> m JannoGeneticSourceAccessionID
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (JannoGeneticSourceAccessionID -> m JannoGeneticSourceAccessionID)
-> JannoGeneticSourceAccessionID -> m JannoGeneticSourceAccessionID
forall a b. (a -> b) -> a -> b
$ Text -> JannoGeneticSourceAccessionID
INSDCSample Text
x
| (Text -> [Char]
T.unpack Text
x) [Char] -> [Char] -> Bool
forall source source1 target.
(RegexMaker Regex CompOption ExecOption source,
RegexContext Regex source1 target) =>
source1 -> source -> target
Reg.=~ ([Char]
"[EDS]RX[0-9]{6,}" :: String) = JannoGeneticSourceAccessionID -> m JannoGeneticSourceAccessionID
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (JannoGeneticSourceAccessionID -> m JannoGeneticSourceAccessionID)
-> JannoGeneticSourceAccessionID -> m JannoGeneticSourceAccessionID
forall a b. (a -> b) -> a -> b
$ Text -> JannoGeneticSourceAccessionID
INSDCExperiment Text
x
| (Text -> [Char]
T.unpack Text
x) [Char] -> [Char] -> Bool
forall source source1 target.
(RegexMaker Regex CompOption ExecOption source,
RegexContext Regex source1 target) =>
source1 -> source -> target
Reg.=~ ([Char]
"[EDS]RR[0-9]{6,}" :: String) = JannoGeneticSourceAccessionID -> m JannoGeneticSourceAccessionID
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (JannoGeneticSourceAccessionID -> m JannoGeneticSourceAccessionID)
-> JannoGeneticSourceAccessionID -> m JannoGeneticSourceAccessionID
forall a b. (a -> b) -> a -> b
$ Text -> JannoGeneticSourceAccessionID
INSDCRun Text
x
| (Text -> [Char]
T.unpack Text
x) [Char] -> [Char] -> Bool
forall source source1 target.
(RegexMaker Regex CompOption ExecOption source,
RegexContext Regex source1 target) =>
source1 -> source -> target
Reg.=~ ([Char]
"[EDS]RZ[0-9]{6,}" :: String) = JannoGeneticSourceAccessionID -> m JannoGeneticSourceAccessionID
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (JannoGeneticSourceAccessionID -> m JannoGeneticSourceAccessionID)
-> JannoGeneticSourceAccessionID -> m JannoGeneticSourceAccessionID
forall a b. (a -> b) -> a -> b
$ Text -> JannoGeneticSourceAccessionID
INSDCAnalysis Text
x
| Bool
otherwise = JannoGeneticSourceAccessionID -> m JannoGeneticSourceAccessionID
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (JannoGeneticSourceAccessionID -> m JannoGeneticSourceAccessionID)
-> JannoGeneticSourceAccessionID -> m JannoGeneticSourceAccessionID
forall a b. (a -> b) -> a -> b
$ Text -> JannoGeneticSourceAccessionID
OtherID Text
x
instance Show JannoGeneticSourceAccessionID where
show :: JannoGeneticSourceAccessionID -> [Char]
show (INSDCProject Text
x) = Text -> [Char]
T.unpack Text
x
show (INSDCStudy Text
x) = Text -> [Char]
T.unpack Text
x
show (INSDCBioSample Text
x) = Text -> [Char]
T.unpack Text
x
show (INSDCSample Text
x) = Text -> [Char]
T.unpack Text
x
show (INSDCExperiment Text
x) = Text -> [Char]
T.unpack Text
x
show (INSDCRun Text
x) = Text -> [Char]
T.unpack Text
x
show (INSDCAnalysis Text
x) = Text -> [Char]
T.unpack Text
x
show (OtherID Text
x) = Text -> [Char]
T.unpack Text
x
instance Csv.ToField JannoGeneticSourceAccessionID where toField :: JannoGeneticSourceAccessionID -> Field
toField JannoGeneticSourceAccessionID
x = [Char] -> Field
forall a. ToField a => a -> Field
Csv.toField ([Char] -> Field) -> [Char] -> Field
forall a b. (a -> b) -> a -> b
$ JannoGeneticSourceAccessionID -> [Char]
forall a. Show a => a -> [Char]
show JannoGeneticSourceAccessionID
x
instance Csv.FromField JannoGeneticSourceAccessionID where parseField :: Field -> Parser JannoGeneticSourceAccessionID
parseField = [Char] -> Field -> Parser JannoGeneticSourceAccessionID
forall a (m :: * -> *).
(MonadFail m, Makeable a, Typeable a) =>
[Char] -> Field -> m a
parseTypeCSV [Char]
"Genetic_Source_Accession_IDs"
newtype JannoPrimaryContact = JannoPrimaryContact T.Text deriving (JannoPrimaryContact -> JannoPrimaryContact -> Bool
(JannoPrimaryContact -> JannoPrimaryContact -> Bool)
-> (JannoPrimaryContact -> JannoPrimaryContact -> Bool)
-> Eq JannoPrimaryContact
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoPrimaryContact -> JannoPrimaryContact -> Bool
== :: JannoPrimaryContact -> JannoPrimaryContact -> Bool
$c/= :: JannoPrimaryContact -> JannoPrimaryContact -> Bool
/= :: JannoPrimaryContact -> JannoPrimaryContact -> Bool
Eq)
$(makeInstances ''JannoPrimaryContact "Primary_Contact")
newtype JannoPublication = JannoPublication T.Text deriving (JannoPublication -> JannoPublication -> Bool
(JannoPublication -> JannoPublication -> Bool)
-> (JannoPublication -> JannoPublication -> Bool)
-> Eq JannoPublication
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoPublication -> JannoPublication -> Bool
== :: JannoPublication -> JannoPublication -> Bool
$c/= :: JannoPublication -> JannoPublication -> Bool
/= :: JannoPublication -> JannoPublication -> Bool
Eq, Eq JannoPublication
Eq JannoPublication
-> (JannoPublication -> JannoPublication -> Ordering)
-> (JannoPublication -> JannoPublication -> Bool)
-> (JannoPublication -> JannoPublication -> Bool)
-> (JannoPublication -> JannoPublication -> Bool)
-> (JannoPublication -> JannoPublication -> Bool)
-> (JannoPublication -> JannoPublication -> JannoPublication)
-> (JannoPublication -> JannoPublication -> JannoPublication)
-> Ord JannoPublication
JannoPublication -> JannoPublication -> Bool
JannoPublication -> JannoPublication -> Ordering
JannoPublication -> JannoPublication -> JannoPublication
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: JannoPublication -> JannoPublication -> Ordering
compare :: JannoPublication -> JannoPublication -> Ordering
$c< :: JannoPublication -> JannoPublication -> Bool
< :: JannoPublication -> JannoPublication -> Bool
$c<= :: JannoPublication -> JannoPublication -> Bool
<= :: JannoPublication -> JannoPublication -> Bool
$c> :: JannoPublication -> JannoPublication -> Bool
> :: JannoPublication -> JannoPublication -> Bool
$c>= :: JannoPublication -> JannoPublication -> Bool
>= :: JannoPublication -> JannoPublication -> Bool
$cmax :: JannoPublication -> JannoPublication -> JannoPublication
max :: JannoPublication -> JannoPublication -> JannoPublication
$cmin :: JannoPublication -> JannoPublication -> JannoPublication
min :: JannoPublication -> JannoPublication -> JannoPublication
Ord)
$(makeInstances ''JannoPublication "Publication")
newtype = T.Text deriving (JannoComment -> JannoComment -> Bool
(JannoComment -> JannoComment -> Bool)
-> (JannoComment -> JannoComment -> Bool) -> Eq JannoComment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoComment -> JannoComment -> Bool
== :: JannoComment -> JannoComment -> Bool
$c/= :: JannoComment -> JannoComment -> Bool
/= :: JannoComment -> JannoComment -> Bool
Eq)
$(makeInstances ''JannoComment "Note")
newtype JannoKeyword = JannoKeyword T.Text deriving (JannoKeyword -> JannoKeyword -> Bool
(JannoKeyword -> JannoKeyword -> Bool)
-> (JannoKeyword -> JannoKeyword -> Bool) -> Eq JannoKeyword
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JannoKeyword -> JannoKeyword -> Bool
== :: JannoKeyword -> JannoKeyword -> Bool
$c/= :: JannoKeyword -> JannoKeyword -> Bool
/= :: JannoKeyword -> JannoKeyword -> Bool
Eq)
$(makeInstances ''JannoKeyword "Keywords")