{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StandaloneDeriving #-}
module GhcTags.CTag.Header
( Header (..)
, HeaderType (..)
, SomeHeaderType (..)
, SingHeaderType (..)
, headerTypeSing
) where
import Control.DeepSeq (NFData (..))
import Data.Text (Text)
data where
:: forall ty. (NFData ty, Show ty) =>
{ :: HeaderType ty
, :: Maybe Text
, :: ty
, :: Text
}
-> Header
instance Eq Header where
Header { headerType :: ()
headerType = HeaderType ty
headerType0
, headerLanguage :: Header -> Maybe Text
headerLanguage = Maybe Text
headerLanguage0
, headerArg :: ()
headerArg = ty
headerArg0
, headerComment :: Header -> Text
headerComment = Text
headerComment0
}
== :: Header -> Header -> Bool
==
Header { headerType :: ()
headerType = HeaderType ty
headerType1
, headerLanguage :: Header -> Maybe Text
headerLanguage = Maybe Text
headerLanguage1
, headerArg :: ()
headerArg = ty
headerArg1
, headerComment :: Header -> Text
headerComment = Text
headerComment1
} =
case (HeaderType ty
headerType0, HeaderType ty
headerType1) of
(HeaderType ty
FileEncoding, HeaderType ty
FileEncoding) ->
ty
headerArg0 ty -> ty -> Bool
forall a. Eq a => a -> a -> Bool
== ty
ty
headerArg1 Bool -> Bool -> Bool
&&
Maybe Text
headerLanguage0 Maybe Text -> Maybe Text -> Bool
forall a. Eq a => a -> a -> Bool
== Maybe Text
headerLanguage1 Bool -> Bool -> Bool
&&
Text
headerComment0 Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
headerComment1
(HeaderType ty
FileFormat, HeaderType ty
FileFormat) ->
ty
headerArg0 ty -> ty -> Bool
forall a. Eq a => a -> a -> Bool
== ty
ty
headerArg1 Bool -> Bool -> Bool
&&
Maybe Text
headerLanguage0 Maybe Text -> Maybe Text -> Bool
forall a. Eq a => a -> a -> Bool
== Maybe Text
headerLanguage1 Bool -> Bool -> Bool
&&
Text
headerComment0 Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
headerComment1
(HeaderType ty
FileSorted, HeaderType ty
FileSorted) ->
ty
headerArg0 ty -> ty -> Bool
forall a. Eq a => a -> a -> Bool
== ty
ty
headerArg1 Bool -> Bool -> Bool
&&
Maybe Text
headerLanguage0 Maybe Text -> Maybe Text -> Bool
forall a. Eq a => a -> a -> Bool
== Maybe Text
headerLanguage1 Bool -> Bool -> Bool
&&
Text
headerComment0 Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
headerComment1
(HeaderType ty
OutputMode, HeaderType ty
OutputMode) ->
ty
headerArg0 ty -> ty -> Bool
forall a. Eq a => a -> a -> Bool
== ty
ty
headerArg1 Bool -> Bool -> Bool
&&
Maybe Text
headerLanguage0 Maybe Text -> Maybe Text -> Bool
forall a. Eq a => a -> a -> Bool
== Maybe Text
headerLanguage1 Bool -> Bool -> Bool
&&
Text
headerComment0 Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
headerComment1
(HeaderType ty
KindDescription, HeaderType ty
KindDescription) ->
ty
headerArg0 ty -> ty -> Bool
forall a. Eq a => a -> a -> Bool
== ty
ty
headerArg1 Bool -> Bool -> Bool
&&
Maybe Text
headerLanguage0 Maybe Text -> Maybe Text -> Bool
forall a. Eq a => a -> a -> Bool
== Maybe Text
headerLanguage1 Bool -> Bool -> Bool
&&
Text
headerComment0 Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
headerComment1
(HeaderType ty
KindSeparator, HeaderType ty
KindSeparator) ->
ty
headerArg0 ty -> ty -> Bool
forall a. Eq a => a -> a -> Bool
== ty
ty
headerArg1 Bool -> Bool -> Bool
&&
Maybe Text
headerLanguage0 Maybe Text -> Maybe Text -> Bool
forall a. Eq a => a -> a -> Bool
== Maybe Text
headerLanguage1 Bool -> Bool -> Bool
&&
Text
headerComment0 Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
headerComment1
(HeaderType ty
ProgramAuthor, HeaderType ty
ProgramAuthor) ->
ty
headerArg0 ty -> ty -> Bool
forall a. Eq a => a -> a -> Bool
== ty
ty
headerArg1 Bool -> Bool -> Bool
&&
Maybe Text
headerLanguage0 Maybe Text -> Maybe Text -> Bool
forall a. Eq a => a -> a -> Bool
== Maybe Text
headerLanguage1 Bool -> Bool -> Bool
&&
Text
headerComment0 Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
headerComment1
(HeaderType ty
ProgramName, HeaderType ty
ProgramName) ->
ty
headerArg0 ty -> ty -> Bool
forall a. Eq a => a -> a -> Bool
== ty
ty
headerArg1 Bool -> Bool -> Bool
&&
Maybe Text
headerLanguage0 Maybe Text -> Maybe Text -> Bool
forall a. Eq a => a -> a -> Bool
== Maybe Text
headerLanguage1 Bool -> Bool -> Bool
&&
Text
headerComment0 Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
headerComment1
(HeaderType ty
ProgramUrl, HeaderType ty
ProgramUrl) ->
ty
headerArg0 ty -> ty -> Bool
forall a. Eq a => a -> a -> Bool
== ty
ty
headerArg1 Bool -> Bool -> Bool
&&
Maybe Text
headerLanguage0 Maybe Text -> Maybe Text -> Bool
forall a. Eq a => a -> a -> Bool
== Maybe Text
headerLanguage1 Bool -> Bool -> Bool
&&
Text
headerComment0 Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
headerComment1
(HeaderType ty
ProgramVersion, HeaderType ty
ProgramVersion) ->
ty
headerArg0 ty -> ty -> Bool
forall a. Eq a => a -> a -> Bool
== ty
ty
headerArg1 Bool -> Bool -> Bool
&&
Maybe Text
headerLanguage0 Maybe Text -> Maybe Text -> Bool
forall a. Eq a => a -> a -> Bool
== Maybe Text
headerLanguage1 Bool -> Bool -> Bool
&&
Text
headerComment0 Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
headerComment1
(HeaderType ty
ExtraDescription, HeaderType ty
ExtraDescription) ->
ty
headerArg0 ty -> ty -> Bool
forall a. Eq a => a -> a -> Bool
== ty
ty
headerArg1 Bool -> Bool -> Bool
&&
Maybe Text
headerLanguage0 Maybe Text -> Maybe Text -> Bool
forall a. Eq a => a -> a -> Bool
== Maybe Text
headerLanguage1 Bool -> Bool -> Bool
&&
Text
headerComment0 Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
headerComment1
(HeaderType ty
FieldDescription, HeaderType ty
FieldDescription) ->
ty
headerArg0 ty -> ty -> Bool
forall a. Eq a => a -> a -> Bool
== ty
ty
headerArg1 Bool -> Bool -> Bool
&&
Maybe Text
headerLanguage0 Maybe Text -> Maybe Text -> Bool
forall a. Eq a => a -> a -> Bool
== Maybe Text
headerLanguage1 Bool -> Bool -> Bool
&&
Text
headerComment0 Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
headerComment1
(PseudoTag Text
name0, PseudoTag Text
name1) ->
Text
name0 Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
name1 Bool -> Bool -> Bool
&&
Maybe Text
headerLanguage0 Maybe Text -> Maybe Text -> Bool
forall a. Eq a => a -> a -> Bool
== Maybe Text
headerLanguage1 Bool -> Bool -> Bool
&&
ty
headerArg0 ty -> ty -> Bool
forall a. Eq a => a -> a -> Bool
== ty
ty
headerArg1 Bool -> Bool -> Bool
&&
Text
headerComment0 Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text
headerComment1
(HeaderType ty, HeaderType ty)
_ -> Bool
False
deriving instance Show Header
instance NFData Header where
rnf :: Header -> ()
rnf Header {ty
Maybe Text
Text
HeaderType ty
headerType :: ()
headerLanguage :: Header -> Maybe Text
headerArg :: ()
headerComment :: Header -> Text
headerType :: HeaderType ty
headerLanguage :: Maybe Text
headerArg :: ty
headerComment :: Text
..} = HeaderType ty -> ()
forall a. NFData a => a -> ()
rnf HeaderType ty
headerType
() -> () -> ()
forall a b. a -> b -> b
`seq` Maybe Text -> ()
forall a. NFData a => a -> ()
rnf Maybe Text
headerLanguage
() -> () -> ()
forall a b. a -> b -> b
`seq` ty -> ()
forall a. NFData a => a -> ()
rnf ty
headerArg
() -> () -> ()
forall a b. a -> b -> b
`seq` Text -> ()
forall a. NFData a => a -> ()
rnf Text
headerComment
data ty where
FileEncoding :: HeaderType Text
FileFormat :: HeaderType Int
FileSorted :: HeaderType Int
OutputMode :: HeaderType Text
KindDescription :: HeaderType Text
KindSeparator :: HeaderType Text
ProgramAuthor :: HeaderType Text
ProgramName :: HeaderType Text
ProgramUrl :: HeaderType Text
ProgramVersion :: HeaderType Text
:: HeaderType Text
FieldDescription :: HeaderType Text
PseudoTag :: Text -> HeaderType Text
deriving instance Eq (HeaderType ty)
deriving instance Ord (HeaderType ty)
deriving instance Show (HeaderType ty)
instance NFData (HeaderType ty) where
rnf :: HeaderType ty -> ()
rnf HeaderType ty
a = HeaderType ty
a HeaderType ty -> () -> ()
forall a b. a -> b -> b
`seq` ()
data where
:: forall ty. HeaderType ty -> SomeHeaderType
data ty where
:: SingHeaderType Text
:: SingHeaderType Int
headerTypeSing :: HeaderType ty -> SingHeaderType ty
= \case
HeaderType ty
FileEncoding -> SingHeaderType ty
SingHeaderType Text
SingHeaderTypeText
HeaderType ty
FileFormat -> SingHeaderType ty
SingHeaderType Int
SingHeaderTypeInt
HeaderType ty
FileSorted -> SingHeaderType ty
SingHeaderType Int
SingHeaderTypeInt
HeaderType ty
OutputMode -> SingHeaderType ty
SingHeaderType Text
SingHeaderTypeText
HeaderType ty
KindDescription -> SingHeaderType ty
SingHeaderType Text
SingHeaderTypeText
HeaderType ty
KindSeparator -> SingHeaderType ty
SingHeaderType Text
SingHeaderTypeText
HeaderType ty
ProgramAuthor -> SingHeaderType ty
SingHeaderType Text
SingHeaderTypeText
HeaderType ty
ProgramName -> SingHeaderType ty
SingHeaderType Text
SingHeaderTypeText
HeaderType ty
ProgramUrl -> SingHeaderType ty
SingHeaderType Text
SingHeaderTypeText
HeaderType ty
ProgramVersion -> SingHeaderType ty
SingHeaderType Text
SingHeaderTypeText
HeaderType ty
ExtraDescription -> SingHeaderType ty
SingHeaderType Text
SingHeaderTypeText
HeaderType ty
FieldDescription -> SingHeaderType ty
SingHeaderType Text
SingHeaderTypeText
PseudoTag {} -> SingHeaderType ty
SingHeaderType Text
SingHeaderTypeText