content: -----------------------------------------------------------------
  -- Autogenerated by Thrift
  --
  -- DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  --  @generated
  -----------------------------------------------------------------
  {-# LANGUAGE OverloadedStrings #-}
  {-# LANGUAGE BangPatterns #-}
  {-# OPTIONS_GHC -fno-warn-unused-imports#-}
  {-# OPTIONS_GHC -fno-warn-overlapping-patterns#-}
  {-# OPTIONS_GHC -fno-warn-incomplete-patterns#-}
  {-# OPTIONS_GHC -fno-warn-incomplete-uni-patterns#-}
  {-# OPTIONS_GHC -fno-warn-incomplete-record-updates#-}
  {-# LANGUAGE GeneralizedNewtypeDeriving #-}
  module D.Types
         (Hstypedef, Hsnewtypeann(Hsnewtypeann, unHsnewtypeann),
          HsStruct(HsStruct, hsStruct_strictann, hsStruct_lazyann,
                   hsStruct_inherit),
          HsStrictAnn(HsStrictAnn, hsStrictAnn_strictann,
                      hsStrictAnn_lazyann, hsStrictAnn_inherit),
          HsLazyAnn(HsLazyAnn, hsLazyAnn_strictann, hsLazyAnn_lazyann,
                    hsLazyAnn_inherit),
          HsPrefixAnn(HsPrefixAnn, structprefixstrictann,
                      structprefixlazyann, structprefixinherit),
          HsUnion(HsUnion_EMPTY, HsUnion_left, HsUnion_right),
          HsUnionNonEmptyAnn(HsUnionNonEmptyAnn_left,
                             HsUnionNonEmptyAnn_right),
          HsEnum(HsEnum_ONE, HsEnum_TWO, HsEnum_THREE, HsEnum__UNKNOWN),
          HsEnumEmpty(HsEnumEmpty__UNKNOWN),
          HsEnumNoUnknownAnn(HsEnumNoUnknownAnn_ONE, HsEnumNoUnknownAnn_TWO,
                             HsEnumNoUnknownAnn_THREE),
          HsEnumEmptyNoUnknownAnn(),
          HsEnumPseudoenumAnn(HsEnumPseudoenumAnn, unHsEnumPseudoenumAnn),
          hsEnumPseudoenumAnn_ONE, hsEnumPseudoenumAnn_TWO,
          hsEnumPseudoenumAnn_THREE,
          HsEnumDuplicatedPseudoenumAnn(HsEnumDuplicatedPseudoenumAnn,
                                        unHsEnumDuplicatedPseudoenumAnn),
          hsEnumDuplicatedPseudoenumAnn_ONE,
          hsEnumDuplicatedPseudoenumAnn_TWO,
          hsEnumDuplicatedPseudoenumAnn_THREE,
          HsEnumEmptyPseudoenumAnn(HsEnumEmptyPseudoenumAnn,
                                   unHsEnumEmptyPseudoenumAnn),
          HsEnumPseudoenumThriftAnn(HsEnumPseudoenumThriftAnn,
                                    unHsEnumPseudoenumThriftAnn),
          hsEnumPseudoenumThriftAnn_ONE, hsEnumPseudoenumThriftAnn_TWO,
          hsEnumPseudoenumThriftAnn_THREE,
          HsEnumEmptyPseudoenumThriftAnn(HsEnumEmptyPseudoenumThriftAnn,
                                         unHsEnumEmptyPseudoenumThriftAnn),
          HsStructOfComplexTypes(HsStructOfComplexTypes,
                                 hsStructOfComplexTypes_a_struct, hsStructOfComplexTypes_a_union,
                                 hsStructOfComplexTypes_an_enum,
                                 hsStructOfComplexTypes_a_pseudoenum,
                                 hsStructOfComplexTypes_a_thrift_pseudoenum))
         where
  import qualified Control.DeepSeq as DeepSeq
  import qualified Control.Exception as Exception
  import qualified Control.Monad as Monad
  import qualified Control.Monad.ST.Trans as ST
  import qualified Control.Monad.Trans.Class as Trans
  import qualified Data.Aeson as Aeson
  import qualified Data.Aeson.Types as Aeson
  import qualified Data.Default as Default
  import qualified Data.Function as Function
  import qualified Data.HashMap.Strict as HashMap
  import qualified Data.Hashable as Hashable
  import qualified Data.Int as Int
  import qualified Data.List as List
  import qualified Data.Map.Strict as Map
  import qualified Data.Ord as Ord
  import qualified Data.Text as Text
  import qualified Data.Text.Encoding as Text
  import qualified GHC.Magic as GHC
  import qualified Prelude as Prelude
  import qualified Thrift.Binary.Parser as Parser
  import qualified Thrift.CodegenTypesOnly as Thrift
  import Control.Applicative ((<|>), (*>), (<*))
  import Data.Aeson ((.:), (.:?), (.=), (.!=))
  import Data.Aeson ((.:), (.=))
  import Data.Monoid ((<>))
  import Prelude ((.), (++), (>), (==))
  import Prelude ((.), (<$>), (<*>), (>>=), (==), (++))
  import Prelude ((.), (<$>), (<*>), (>>=), (==), (/=), (<), (++))
  
  type Hstypedef = Map.Map Text.Text Text.Text
  
  newtype Hsnewtypeann = Hsnewtypeann{unHsnewtypeann ::
                                      Map.Map Text.Text Text.Text}
                         deriving (Prelude.Eq, Prelude.Show, DeepSeq.NFData, Prelude.Ord)
  
  instance Hashable.Hashable Hsnewtypeann where
    hashWithSalt __salt (Hsnewtypeann __val)
      = Hashable.hashWithSalt __salt
          ((Prelude.map (\ (_k, _v) -> (_k, _v)) . Map.toAscList) __val)
  
  instance Aeson.ToJSON Hsnewtypeann where
    toJSON (Hsnewtypeann __val) = Aeson.toJSON __val
  
  data HsStruct = HsStruct{hsStruct_strictann ::
                           {-# UNPACK #-} !Int.Int32,
                           hsStruct_lazyann :: Int.Int32, hsStruct_inherit :: Int.Int32}
                  deriving (Prelude.Eq, Prelude.Show, Prelude.Ord)
  
  instance Aeson.ToJSON HsStruct where
    toJSON
      (HsStruct __field__strictann __field__lazyann __field__inherit)
      = Aeson.object
          ("strictann" .= __field__strictann :
             "lazyann" .= __field__lazyann :
               "inherit" .= __field__inherit : Prelude.mempty)
  
  instance Thrift.ThriftStruct HsStruct where
    buildStruct _proxy
      (HsStruct __field__strictann __field__lazyann __field__inherit)
      = Thrift.genStruct _proxy
          (Thrift.genFieldPrim _proxy "strictann" (Thrift.getI32Type _proxy)
             1
             0
             (Thrift.genI32Prim _proxy)
             __field__strictann
             :
             Thrift.genFieldPrim _proxy "lazyann" (Thrift.getI32Type _proxy) 2 1
               (Thrift.genI32Prim _proxy)
               __field__lazyann
               :
               Thrift.genFieldPrim _proxy "inherit" (Thrift.getI32Type _proxy) 3 2
                 (Thrift.genI32Prim _proxy)
                 __field__inherit
                 : [])
    parseStruct _proxy
      = ST.runSTT
          (do Prelude.return ()
              __field__strictann <- ST.newSTRef Default.def
              __field__lazyann <- ST.newSTRef Default.def
              __field__inherit <- ST.newSTRef Default.def
              let
                _parse _lastId
                  = do _fieldBegin <- Trans.lift
                                        (Thrift.parseFieldBegin _proxy _lastId _idMap)
                       case _fieldBegin of
                         Thrift.FieldBegin _type _id _bool -> do case _id of
                                                                   1 | _type ==
                                                                         Thrift.getI32Type _proxy
                                                                       ->
                                                                       do !_val <- Trans.lift
                                                                                     (Thrift.parseI32
                                                                                        _proxy)
                                                                          ST.writeSTRef
                                                                            __field__strictann
                                                                            _val
                                                                   2 | _type ==
                                                                         Thrift.getI32Type _proxy
                                                                       ->
                                                                       do !_val <- Trans.lift
                                                                                     (Thrift.parseI32
                                                                                        _proxy)
                                                                          ST.writeSTRef
                                                                            __field__lazyann
                                                                            _val
                                                                   3 | _type ==
                                                                         Thrift.getI32Type _proxy
                                                                       ->
                                                                       do !_val <- Trans.lift
                                                                                     (Thrift.parseI32
                                                                                        _proxy)
                                                                          ST.writeSTRef
                                                                            __field__inherit
                                                                            _val
                                                                   _ -> Trans.lift
                                                                          (Thrift.parseSkip _proxy
                                                                             _type
                                                                             (Prelude.Just _bool))
                                                                 _parse _id
                         Thrift.FieldEnd -> do !__val__strictann <- ST.readSTRef
                                                                      __field__strictann
                                               !__val__lazyann <- ST.readSTRef __field__lazyann
                                               !__val__inherit <- ST.readSTRef __field__inherit
                                               Prelude.pure
                                                 (HsStruct __val__strictann __val__lazyann
                                                    __val__inherit)
                _idMap
                  = HashMap.fromList
                      [("strictann", 1), ("lazyann", 2), ("inherit", 3)]
              _parse 0)
  
  instance DeepSeq.NFData HsStruct where
    rnf (HsStruct __field__strictann __field__lazyann __field__inherit)
      = DeepSeq.rnf __field__strictann `Prelude.seq`
          DeepSeq.rnf __field__lazyann `Prelude.seq`
            DeepSeq.rnf __field__inherit `Prelude.seq` ()
  
  instance Default.Default HsStruct where
    def = HsStruct Default.def Default.def Default.def
  
  instance Hashable.Hashable HsStruct where
    hashWithSalt __salt (HsStruct _strictann _lazyann _inherit)
      = Hashable.hashWithSalt
          (Hashable.hashWithSalt (Hashable.hashWithSalt __salt _strictann)
             _lazyann)
          _inherit
  
  data HsStrictAnn = HsStrictAnn{hsStrictAnn_strictann ::
                                 {-# UNPACK #-} !Int.Int32,
                                 hsStrictAnn_lazyann :: Int.Int32,
                                 hsStrictAnn_inherit :: {-# UNPACK #-} !Int.Int32}
                     deriving (Prelude.Eq, Prelude.Show, Prelude.Ord)
  
  instance Aeson.ToJSON HsStrictAnn where
    toJSON
      (HsStrictAnn __field__strictann __field__lazyann __field__inherit)
      = Aeson.object
          ("strictann" .= __field__strictann :
             "lazyann" .= __field__lazyann :
               "inherit" .= __field__inherit : Prelude.mempty)
  
  instance Thrift.ThriftStruct HsStrictAnn where
    buildStruct _proxy
      (HsStrictAnn __field__strictann __field__lazyann __field__inherit)
      = Thrift.genStruct _proxy
          (Thrift.genFieldPrim _proxy "strictann" (Thrift.getI32Type _proxy)
             1
             0
             (Thrift.genI32Prim _proxy)
             __field__strictann
             :
             Thrift.genFieldPrim _proxy "lazyann" (Thrift.getI32Type _proxy) 2 1
               (Thrift.genI32Prim _proxy)
               __field__lazyann
               :
               Thrift.genFieldPrim _proxy "inherit" (Thrift.getI32Type _proxy) 3 2
                 (Thrift.genI32Prim _proxy)
                 __field__inherit
                 : [])
    parseStruct _proxy
      = ST.runSTT
          (do Prelude.return ()
              __field__strictann <- ST.newSTRef Default.def
              __field__lazyann <- ST.newSTRef Default.def
              __field__inherit <- ST.newSTRef Default.def
              let
                _parse _lastId
                  = do _fieldBegin <- Trans.lift
                                        (Thrift.parseFieldBegin _proxy _lastId _idMap)
                       case _fieldBegin of
                         Thrift.FieldBegin _type _id _bool -> do case _id of
                                                                   1 | _type ==
                                                                         Thrift.getI32Type _proxy
                                                                       ->
                                                                       do !_val <- Trans.lift
                                                                                     (Thrift.parseI32
                                                                                        _proxy)
                                                                          ST.writeSTRef
                                                                            __field__strictann
                                                                            _val
                                                                   2 | _type ==
                                                                         Thrift.getI32Type _proxy
                                                                       ->
                                                                       do !_val <- Trans.lift
                                                                                     (Thrift.parseI32
                                                                                        _proxy)
                                                                          ST.writeSTRef
                                                                            __field__lazyann
                                                                            _val
                                                                   3 | _type ==
                                                                         Thrift.getI32Type _proxy
                                                                       ->
                                                                       do !_val <- Trans.lift
                                                                                     (Thrift.parseI32
                                                                                        _proxy)
                                                                          ST.writeSTRef
                                                                            __field__inherit
                                                                            _val
                                                                   _ -> Trans.lift
                                                                          (Thrift.parseSkip _proxy
                                                                             _type
                                                                             (Prelude.Just _bool))
                                                                 _parse _id
                         Thrift.FieldEnd -> do !__val__strictann <- ST.readSTRef
                                                                      __field__strictann
                                               !__val__lazyann <- ST.readSTRef __field__lazyann
                                               !__val__inherit <- ST.readSTRef __field__inherit
                                               Prelude.pure
                                                 (HsStrictAnn __val__strictann __val__lazyann
                                                    __val__inherit)
                _idMap
                  = HashMap.fromList
                      [("strictann", 1), ("lazyann", 2), ("inherit", 3)]
              _parse 0)
  
  instance DeepSeq.NFData HsStrictAnn where
    rnf
      (HsStrictAnn __field__strictann __field__lazyann __field__inherit)
      = DeepSeq.rnf __field__strictann `Prelude.seq`
          DeepSeq.rnf __field__lazyann `Prelude.seq`
            DeepSeq.rnf __field__inherit `Prelude.seq` ()
  
  instance Default.Default HsStrictAnn where
    def = HsStrictAnn Default.def Default.def Default.def
  
  instance Hashable.Hashable HsStrictAnn where
    hashWithSalt __salt (HsStrictAnn _strictann _lazyann _inherit)
      = Hashable.hashWithSalt
          (Hashable.hashWithSalt (Hashable.hashWithSalt __salt _strictann)
             _lazyann)
          _inherit
  
  data HsLazyAnn = HsLazyAnn{hsLazyAnn_strictann ::
                             {-# UNPACK #-} !Int.Int32,
                             hsLazyAnn_lazyann :: Int.Int32, hsLazyAnn_inherit :: Int.Int32}
                   deriving (Prelude.Eq, Prelude.Show, Prelude.Ord)
  
  instance Aeson.ToJSON HsLazyAnn where
    toJSON
      (HsLazyAnn __field__strictann __field__lazyann __field__inherit)
      = Aeson.object
          ("strictann" .= __field__strictann :
             "lazyann" .= __field__lazyann :
               "inherit" .= __field__inherit : Prelude.mempty)
  
  instance Thrift.ThriftStruct HsLazyAnn where
    buildStruct _proxy
      (HsLazyAnn __field__strictann __field__lazyann __field__inherit)
      = Thrift.genStruct _proxy
          (Thrift.genFieldPrim _proxy "strictann" (Thrift.getI32Type _proxy)
             1
             0
             (Thrift.genI32Prim _proxy)
             __field__strictann
             :
             Thrift.genFieldPrim _proxy "lazyann" (Thrift.getI32Type _proxy) 2 1
               (Thrift.genI32Prim _proxy)
               __field__lazyann
               :
               Thrift.genFieldPrim _proxy "inherit" (Thrift.getI32Type _proxy) 3 2
                 (Thrift.genI32Prim _proxy)
                 __field__inherit
                 : [])
    parseStruct _proxy
      = ST.runSTT
          (do Prelude.return ()
              __field__strictann <- ST.newSTRef Default.def
              __field__lazyann <- ST.newSTRef Default.def
              __field__inherit <- ST.newSTRef Default.def
              let
                _parse _lastId
                  = do _fieldBegin <- Trans.lift
                                        (Thrift.parseFieldBegin _proxy _lastId _idMap)
                       case _fieldBegin of
                         Thrift.FieldBegin _type _id _bool -> do case _id of
                                                                   1 | _type ==
                                                                         Thrift.getI32Type _proxy
                                                                       ->
                                                                       do !_val <- Trans.lift
                                                                                     (Thrift.parseI32
                                                                                        _proxy)
                                                                          ST.writeSTRef
                                                                            __field__strictann
                                                                            _val
                                                                   2 | _type ==
                                                                         Thrift.getI32Type _proxy
                                                                       ->
                                                                       do !_val <- Trans.lift
                                                                                     (Thrift.parseI32
                                                                                        _proxy)
                                                                          ST.writeSTRef
                                                                            __field__lazyann
                                                                            _val
                                                                   3 | _type ==
                                                                         Thrift.getI32Type _proxy
                                                                       ->
                                                                       do !_val <- Trans.lift
                                                                                     (Thrift.parseI32
                                                                                        _proxy)
                                                                          ST.writeSTRef
                                                                            __field__inherit
                                                                            _val
                                                                   _ -> Trans.lift
                                                                          (Thrift.parseSkip _proxy
                                                                             _type
                                                                             (Prelude.Just _bool))
                                                                 _parse _id
                         Thrift.FieldEnd -> do !__val__strictann <- ST.readSTRef
                                                                      __field__strictann
                                               !__val__lazyann <- ST.readSTRef __field__lazyann
                                               !__val__inherit <- ST.readSTRef __field__inherit
                                               Prelude.pure
                                                 (HsLazyAnn __val__strictann __val__lazyann
                                                    __val__inherit)
                _idMap
                  = HashMap.fromList
                      [("strictann", 1), ("lazyann", 2), ("inherit", 3)]
              _parse 0)
  
  instance DeepSeq.NFData HsLazyAnn where
    rnf
      (HsLazyAnn __field__strictann __field__lazyann __field__inherit)
      = DeepSeq.rnf __field__strictann `Prelude.seq`
          DeepSeq.rnf __field__lazyann `Prelude.seq`
            DeepSeq.rnf __field__inherit `Prelude.seq` ()
  
  instance Default.Default HsLazyAnn where
    def = HsLazyAnn Default.def Default.def Default.def
  
  instance Hashable.Hashable HsLazyAnn where
    hashWithSalt __salt (HsLazyAnn _strictann _lazyann _inherit)
      = Hashable.hashWithSalt
          (Hashable.hashWithSalt (Hashable.hashWithSalt __salt _strictann)
             _lazyann)
          _inherit
  
  data HsPrefixAnn = HsPrefixAnn{structprefixstrictann ::
                                 {-# UNPACK #-} !Int.Int32,
                                 structprefixlazyann :: Int.Int32, structprefixinherit :: Int.Int32}
                     deriving (Prelude.Eq, Prelude.Show, Prelude.Ord)
  
  instance Aeson.ToJSON HsPrefixAnn where
    toJSON
      (HsPrefixAnn __field__strictann __field__lazyann __field__inherit)
      = Aeson.object
          ("strictann" .= __field__strictann :
             "lazyann" .= __field__lazyann :
               "inherit" .= __field__inherit : Prelude.mempty)
  
  instance Thrift.ThriftStruct HsPrefixAnn where
    buildStruct _proxy
      (HsPrefixAnn __field__strictann __field__lazyann __field__inherit)
      = Thrift.genStruct _proxy
          (Thrift.genFieldPrim _proxy "strictann" (Thrift.getI32Type _proxy)
             1
             0
             (Thrift.genI32Prim _proxy)
             __field__strictann
             :
             Thrift.genFieldPrim _proxy "lazyann" (Thrift.getI32Type _proxy) 2 1
               (Thrift.genI32Prim _proxy)
               __field__lazyann
               :
               Thrift.genFieldPrim _proxy "inherit" (Thrift.getI32Type _proxy) 3 2
                 (Thrift.genI32Prim _proxy)
                 __field__inherit
                 : [])
    parseStruct _proxy
      = ST.runSTT
          (do Prelude.return ()
              __field__strictann <- ST.newSTRef Default.def
              __field__lazyann <- ST.newSTRef Default.def
              __field__inherit <- ST.newSTRef Default.def
              let
                _parse _lastId
                  = do _fieldBegin <- Trans.lift
                                        (Thrift.parseFieldBegin _proxy _lastId _idMap)
                       case _fieldBegin of
                         Thrift.FieldBegin _type _id _bool -> do case _id of
                                                                   1 | _type ==
                                                                         Thrift.getI32Type _proxy
                                                                       ->
                                                                       do !_val <- Trans.lift
                                                                                     (Thrift.parseI32
                                                                                        _proxy)
                                                                          ST.writeSTRef
                                                                            __field__strictann
                                                                            _val
                                                                   2 | _type ==
                                                                         Thrift.getI32Type _proxy
                                                                       ->
                                                                       do !_val <- Trans.lift
                                                                                     (Thrift.parseI32
                                                                                        _proxy)
                                                                          ST.writeSTRef
                                                                            __field__lazyann
                                                                            _val
                                                                   3 | _type ==
                                                                         Thrift.getI32Type _proxy
                                                                       ->
                                                                       do !_val <- Trans.lift
                                                                                     (Thrift.parseI32
                                                                                        _proxy)
                                                                          ST.writeSTRef
                                                                            __field__inherit
                                                                            _val
                                                                   _ -> Trans.lift
                                                                          (Thrift.parseSkip _proxy
                                                                             _type
                                                                             (Prelude.Just _bool))
                                                                 _parse _id
                         Thrift.FieldEnd -> do !__val__strictann <- ST.readSTRef
                                                                      __field__strictann
                                               !__val__lazyann <- ST.readSTRef __field__lazyann
                                               !__val__inherit <- ST.readSTRef __field__inherit
                                               Prelude.pure
                                                 (HsPrefixAnn __val__strictann __val__lazyann
                                                    __val__inherit)
                _idMap
                  = HashMap.fromList
                      [("strictann", 1), ("lazyann", 2), ("inherit", 3)]
              _parse 0)
  
  instance DeepSeq.NFData HsPrefixAnn where
    rnf
      (HsPrefixAnn __field__strictann __field__lazyann __field__inherit)
      = DeepSeq.rnf __field__strictann `Prelude.seq`
          DeepSeq.rnf __field__lazyann `Prelude.seq`
            DeepSeq.rnf __field__inherit `Prelude.seq` ()
  
  instance Default.Default HsPrefixAnn where
    def = HsPrefixAnn Default.def Default.def Default.def
  
  instance Hashable.Hashable HsPrefixAnn where
    hashWithSalt __salt (HsPrefixAnn _strictann _lazyann _inherit)
      = Hashable.hashWithSalt
          (Hashable.hashWithSalt (Hashable.hashWithSalt __salt _strictann)
             _lazyann)
          _inherit
  
  data HsUnion = HsUnion_left Int.Int32
               | HsUnion_right Int.Int32
               | HsUnion_EMPTY
                 deriving (Prelude.Eq, Prelude.Show, Prelude.Ord)
  
  instance Aeson.ToJSON HsUnion where
    toJSON (HsUnion_left __left) = Aeson.object ["left" .= __left]
    toJSON (HsUnion_right __right) = Aeson.object ["right" .= __right]
    toJSON HsUnion_EMPTY = Aeson.object []
  
  instance Thrift.ThriftStruct HsUnion where
    buildStruct _proxy (HsUnion_left __left)
      = Thrift.genStruct _proxy
          [Thrift.genFieldPrim _proxy "left" (Thrift.getI32Type _proxy) 1 0
             (Thrift.genI32Prim _proxy)
             __left]
    buildStruct _proxy (HsUnion_right __right)
      = Thrift.genStruct _proxy
          [Thrift.genFieldPrim _proxy "right" (Thrift.getI32Type _proxy) 2 0
             (Thrift.genI32Prim _proxy)
             __right]
    buildStruct _proxy HsUnion_EMPTY = Thrift.genStruct _proxy []
    parseStruct _proxy
      = do _fieldBegin <- Thrift.parseFieldBegin _proxy 0 _idMap
           case _fieldBegin of
             Thrift.FieldBegin _type _id _bool -> do case _id of
                                                       1 | _type == Thrift.getI32Type _proxy ->
                                                           do _val <- Thrift.parseI32 _proxy
                                                              Thrift.parseStop _proxy
                                                              Prelude.return (HsUnion_left _val)
                                                       2 | _type == Thrift.getI32Type _proxy ->
                                                           do _val <- Thrift.parseI32 _proxy
                                                              Thrift.parseStop _proxy
                                                              Prelude.return (HsUnion_right _val)
                                                       _ -> do Thrift.parseSkip _proxy _type
                                                                 Prelude.Nothing
                                                               Thrift.parseStop _proxy
                                                               Prelude.return HsUnion_EMPTY
             Thrift.FieldEnd -> Prelude.return HsUnion_EMPTY
      where
        _idMap = HashMap.fromList [("left", 1), ("right", 2)]
  
  instance DeepSeq.NFData HsUnion where
    rnf (HsUnion_left __left) = DeepSeq.rnf __left
    rnf (HsUnion_right __right) = DeepSeq.rnf __right
    rnf HsUnion_EMPTY = ()
  
  instance Default.Default HsUnion where
    def = HsUnion_EMPTY
  
  instance Hashable.Hashable HsUnion where
    hashWithSalt __salt (HsUnion_left _left)
      = Hashable.hashWithSalt __salt (Hashable.hashWithSalt 1 _left)
    hashWithSalt __salt (HsUnion_right _right)
      = Hashable.hashWithSalt __salt (Hashable.hashWithSalt 2 _right)
    hashWithSalt __salt HsUnion_EMPTY
      = Hashable.hashWithSalt __salt (0 :: Prelude.Int)
  
  data HsUnionNonEmptyAnn = HsUnionNonEmptyAnn_left Int.Int32
                          | HsUnionNonEmptyAnn_right Int.Int32
                            deriving (Prelude.Eq, Prelude.Show, Prelude.Ord)
  
  instance Aeson.ToJSON HsUnionNonEmptyAnn where
    toJSON (HsUnionNonEmptyAnn_left __left)
      = Aeson.object ["left" .= __left]
    toJSON (HsUnionNonEmptyAnn_right __right)
      = Aeson.object ["right" .= __right]
  
  instance Thrift.ThriftStruct HsUnionNonEmptyAnn where
    buildStruct _proxy (HsUnionNonEmptyAnn_left __left)
      = Thrift.genStruct _proxy
          [Thrift.genFieldPrim _proxy "left" (Thrift.getI32Type _proxy) 1 0
             (Thrift.genI32Prim _proxy)
             __left]
    buildStruct _proxy (HsUnionNonEmptyAnn_right __right)
      = Thrift.genStruct _proxy
          [Thrift.genFieldPrim _proxy "right" (Thrift.getI32Type _proxy) 2 0
             (Thrift.genI32Prim _proxy)
             __right]
    parseStruct _proxy
      = do _fieldBegin <- Thrift.parseFieldBegin _proxy 0 _idMap
           case _fieldBegin of
             Thrift.FieldBegin _type _id _bool -> do case _id of
                                                       1 | _type == Thrift.getI32Type _proxy ->
                                                           do _val <- Thrift.parseI32 _proxy
                                                              Thrift.parseStop _proxy
                                                              Prelude.return
                                                                (HsUnionNonEmptyAnn_left _val)
                                                       2 | _type == Thrift.getI32Type _proxy ->
                                                           do _val <- Thrift.parseI32 _proxy
                                                              Thrift.parseStop _proxy
                                                              Prelude.return
                                                                (HsUnionNonEmptyAnn_right _val)
                                                       _ -> Prelude.fail
                                                              ("unrecognized alternative for union 'HsUnionNonEmptyAnn': "
                                                                 ++ Prelude.show _id)
             Thrift.FieldEnd -> Prelude.fail
                                  "union 'HsUnionNonEmptyAnn' is empty"
      where
        _idMap = HashMap.fromList [("left", 1), ("right", 2)]
  
  instance DeepSeq.NFData HsUnionNonEmptyAnn where
    rnf (HsUnionNonEmptyAnn_left __left) = DeepSeq.rnf __left
    rnf (HsUnionNonEmptyAnn_right __right) = DeepSeq.rnf __right
  
  instance Default.Default HsUnionNonEmptyAnn where
    def = HsUnionNonEmptyAnn_left Default.def
  
  instance Hashable.Hashable HsUnionNonEmptyAnn where
    hashWithSalt __salt (HsUnionNonEmptyAnn_left _left)
      = Hashable.hashWithSalt __salt (Hashable.hashWithSalt 1 _left)
    hashWithSalt __salt (HsUnionNonEmptyAnn_right _right)
      = Hashable.hashWithSalt __salt (Hashable.hashWithSalt 2 _right)
  
  data HsEnum = HsEnum_ONE
              | HsEnum_TWO
              | HsEnum_THREE
              | HsEnum__UNKNOWN Prelude.Int
                deriving (Prelude.Eq, Prelude.Show)
  
  instance Aeson.ToJSON HsEnum where
    toJSON = Aeson.toJSON . Thrift.fromThriftEnum
  
  instance DeepSeq.NFData HsEnum where
    rnf __HsEnum = Prelude.seq __HsEnum ()
  
  instance Default.Default HsEnum where
    def = HsEnum_ONE
  
  instance Hashable.Hashable HsEnum where
    hashWithSalt _salt _val
      = Hashable.hashWithSalt _salt (Thrift.fromThriftEnum _val)
  
  instance Thrift.ThriftEnum HsEnum where
    toThriftEnum 1 = HsEnum_ONE
    toThriftEnum 2 = HsEnum_TWO
    toThriftEnum 3 = HsEnum_THREE
    toThriftEnum val = HsEnum__UNKNOWN val
    fromThriftEnum HsEnum_ONE = 1
    fromThriftEnum HsEnum_TWO = 2
    fromThriftEnum HsEnum_THREE = 3
    fromThriftEnum (HsEnum__UNKNOWN val) = val
    allThriftEnumValues = [HsEnum_ONE, HsEnum_TWO, HsEnum_THREE]
    toThriftEnumEither 1 = Prelude.Right HsEnum_ONE
    toThriftEnumEither 2 = Prelude.Right HsEnum_TWO
    toThriftEnumEither 3 = Prelude.Right HsEnum_THREE
    toThriftEnumEither val
      = Prelude.Left
          ("toThriftEnumEither: not a valid identifier for enum HsEnum: " ++
             Prelude.show val)
  
  instance Prelude.Ord HsEnum where
    compare = Function.on Prelude.compare Thrift.fromThriftEnum
  
  data HsEnumEmpty = HsEnumEmpty__UNKNOWN Prelude.Int
                     deriving (Prelude.Eq, Prelude.Show, Prelude.Ord)
  
  instance Aeson.ToJSON HsEnumEmpty where
    toJSON = Aeson.toJSON . Thrift.fromThriftEnum
  
  instance DeepSeq.NFData HsEnumEmpty where
    rnf __HsEnumEmpty = Prelude.seq __HsEnumEmpty ()
  
  instance Default.Default HsEnumEmpty where
    def
      = Exception.throw
          (Thrift.ProtocolException
             "def: enum HsEnumEmpty has no constructors")
  
  instance Hashable.Hashable HsEnumEmpty where
    hashWithSalt _salt _val
      = Hashable.hashWithSalt _salt (Thrift.fromThriftEnum _val)
  
  instance Thrift.ThriftEnum HsEnumEmpty where
    toThriftEnum val = HsEnumEmpty__UNKNOWN val
    fromThriftEnum (HsEnumEmpty__UNKNOWN val) = val
    allThriftEnumValues = []
    toThriftEnumEither val
      = Prelude.Left
          ("toThriftEnumEither: not a valid identifier for enum HsEnumEmpty: "
             ++ Prelude.show val)
  
  data HsEnumNoUnknownAnn = HsEnumNoUnknownAnn_ONE
                          | HsEnumNoUnknownAnn_TWO
                          | HsEnumNoUnknownAnn_THREE
                            deriving (Prelude.Eq, Prelude.Show)
  
  instance Aeson.ToJSON HsEnumNoUnknownAnn where
    toJSON = Aeson.toJSON . Thrift.fromThriftEnum
  
  instance DeepSeq.NFData HsEnumNoUnknownAnn where
    rnf __HsEnumNoUnknownAnn = Prelude.seq __HsEnumNoUnknownAnn ()
  
  instance Default.Default HsEnumNoUnknownAnn where
    def = HsEnumNoUnknownAnn_ONE
  
  instance Hashable.Hashable HsEnumNoUnknownAnn where
    hashWithSalt _salt _val
      = Hashable.hashWithSalt _salt (Thrift.fromThriftEnum _val)
  
  instance Thrift.ThriftEnum HsEnumNoUnknownAnn where
    toThriftEnum 1 = HsEnumNoUnknownAnn_ONE
    toThriftEnum 2 = HsEnumNoUnknownAnn_TWO
    toThriftEnum 3 = HsEnumNoUnknownAnn_THREE
    toThriftEnum _val
      = Exception.throw
          (Thrift.ProtocolException
             ("toThriftEnum: not a valid identifier for enum HsEnumNoUnknownAnn: "
                ++ Prelude.show _val))
    fromThriftEnum HsEnumNoUnknownAnn_ONE = 1
    fromThriftEnum HsEnumNoUnknownAnn_TWO = 2
    fromThriftEnum HsEnumNoUnknownAnn_THREE = 3
    fromThriftEnum _val
      = Exception.throw
          (Thrift.ProtocolException
             ("fromThriftEnum: not a valid identifier for enum HsEnumNoUnknownAnn: "
                ++ Prelude.show _val))
    allThriftEnumValues
      = [HsEnumNoUnknownAnn_ONE, HsEnumNoUnknownAnn_TWO,
         HsEnumNoUnknownAnn_THREE]
    toThriftEnumEither 1 = Prelude.Right HsEnumNoUnknownAnn_ONE
    toThriftEnumEither 2 = Prelude.Right HsEnumNoUnknownAnn_TWO
    toThriftEnumEither 3 = Prelude.Right HsEnumNoUnknownAnn_THREE
    toThriftEnumEither val
      = Prelude.Left
          ("toThriftEnumEither: not a valid identifier for enum HsEnumNoUnknownAnn: "
             ++ Prelude.show val)
  
  instance Prelude.Ord HsEnumNoUnknownAnn where
    compare = Function.on Prelude.compare Thrift.fromThriftEnum
  
  data HsEnumEmptyNoUnknownAnn
  
  instance Prelude.Eq HsEnumEmptyNoUnknownAnn where
    (==)
      = Exception.throw
          (Thrift.ProtocolException
             "(==): Thrift enum 'HsEnumEmptyNoUnknownAnn' is uninhabited")
  
  instance Prelude.Show HsEnumEmptyNoUnknownAnn where
    show
      = Exception.throw
          (Thrift.ProtocolException
             "show: Thrift enum 'HsEnumEmptyNoUnknownAnn' is uninhabited")
  
  instance Prelude.Ord HsEnumEmptyNoUnknownAnn where
    compare
      = Exception.throw
          (Thrift.ProtocolException
             "compare: Thrift enum 'HsEnumEmptyNoUnknownAnn' is uninhabited")
  
  instance Aeson.ToJSON HsEnumEmptyNoUnknownAnn where
    toJSON
      = Exception.throw
          (Thrift.ProtocolException
             "toJSON: Thrift enum 'HsEnumEmptyNoUnknownAnn' is uninhabited")
  
  instance Default.Default HsEnumEmptyNoUnknownAnn where
    def
      = Exception.throw
          (Thrift.ProtocolException
             "def: Thrift enum 'HsEnumEmptyNoUnknownAnn' is uninhabited")
  
  instance Hashable.Hashable HsEnumEmptyNoUnknownAnn where
    hashWithSalt
      = Exception.throw
          (Thrift.ProtocolException
             "hashWithSalt: Thrift enum 'HsEnumEmptyNoUnknownAnn' is uninhabited")
  
  instance DeepSeq.NFData HsEnumEmptyNoUnknownAnn where
    rnf
      = Exception.throw
          (Thrift.ProtocolException
             "rnf: Thrift enum 'HsEnumEmptyNoUnknownAnn' is uninhabited")
  
  instance Thrift.ThriftEnum HsEnumEmptyNoUnknownAnn where
    toThriftEnum
      = Exception.throw
          (Thrift.ProtocolException
             "toThriftEnum: Thrift enum 'HsEnumEmptyNoUnknownAnn' is uninhabited")
    fromThriftEnum
      = Exception.throw
          (Thrift.ProtocolException
             "fromThriftEnum: Thrift enum 'HsEnumEmptyNoUnknownAnn' is uninhabited")
    allThriftEnumValues = []
    toThriftEnumEither val
      = Prelude.Left
          ("toThriftEnumEither: not a valid identifier for enum HsEnumEmptyNoUnknownAnn: "
             ++ Prelude.show val)
  
  newtype HsEnumPseudoenumAnn = HsEnumPseudoenumAnn{unHsEnumPseudoenumAnn
                                                    :: Int.Int32}
                                deriving (Prelude.Eq, Prelude.Show, DeepSeq.NFData, Prelude.Ord)
  
  instance Hashable.Hashable HsEnumPseudoenumAnn where
    hashWithSalt __salt (HsEnumPseudoenumAnn __val)
      = Hashable.hashWithSalt __salt __val
  
  instance Aeson.ToJSON HsEnumPseudoenumAnn where
    toJSON (HsEnumPseudoenumAnn __val) = Aeson.toJSON __val
  
  hsEnumPseudoenumAnn_ONE :: HsEnumPseudoenumAnn
  hsEnumPseudoenumAnn_ONE = HsEnumPseudoenumAnn 1
  
  hsEnumPseudoenumAnn_TWO :: HsEnumPseudoenumAnn
  hsEnumPseudoenumAnn_TWO = HsEnumPseudoenumAnn 2
  
  hsEnumPseudoenumAnn_THREE :: HsEnumPseudoenumAnn
  hsEnumPseudoenumAnn_THREE = HsEnumPseudoenumAnn 3
  
  newtype HsEnumDuplicatedPseudoenumAnn = HsEnumDuplicatedPseudoenumAnn{unHsEnumDuplicatedPseudoenumAnn
                                                                        :: Int.Int32}
                                          deriving (Prelude.Eq, Prelude.Show, DeepSeq.NFData,
                                                    Prelude.Ord)
  
  instance Hashable.Hashable HsEnumDuplicatedPseudoenumAnn where
    hashWithSalt __salt (HsEnumDuplicatedPseudoenumAnn __val)
      = Hashable.hashWithSalt __salt __val
  
  instance Aeson.ToJSON HsEnumDuplicatedPseudoenumAnn where
    toJSON (HsEnumDuplicatedPseudoenumAnn __val) = Aeson.toJSON __val
  
  hsEnumDuplicatedPseudoenumAnn_ONE :: HsEnumDuplicatedPseudoenumAnn
  hsEnumDuplicatedPseudoenumAnn_ONE = HsEnumDuplicatedPseudoenumAnn 1
  
  hsEnumDuplicatedPseudoenumAnn_TWO :: HsEnumDuplicatedPseudoenumAnn
  hsEnumDuplicatedPseudoenumAnn_TWO = HsEnumDuplicatedPseudoenumAnn 2
  
  hsEnumDuplicatedPseudoenumAnn_THREE ::
                                      HsEnumDuplicatedPseudoenumAnn
  hsEnumDuplicatedPseudoenumAnn_THREE
    = HsEnumDuplicatedPseudoenumAnn 3
  
  newtype HsEnumEmptyPseudoenumAnn = HsEnumEmptyPseudoenumAnn{unHsEnumEmptyPseudoenumAnn
                                                              :: Int.Int32}
                                     deriving (Prelude.Eq, Prelude.Show, DeepSeq.NFData, Prelude.Ord)
  
  instance Hashable.Hashable HsEnumEmptyPseudoenumAnn where
    hashWithSalt __salt (HsEnumEmptyPseudoenumAnn __val)
      = Hashable.hashWithSalt __salt __val
  
  instance Aeson.ToJSON HsEnumEmptyPseudoenumAnn where
    toJSON (HsEnumEmptyPseudoenumAnn __val) = Aeson.toJSON __val
  
  newtype HsEnumPseudoenumThriftAnn = HsEnumPseudoenumThriftAnn{unHsEnumPseudoenumThriftAnn
                                                                :: Int.Int32}
                                      deriving (Prelude.Eq, DeepSeq.NFData, Prelude.Ord)
  
  instance Hashable.Hashable HsEnumPseudoenumThriftAnn where
    hashWithSalt __salt (HsEnumPseudoenumThriftAnn __val)
      = Hashable.hashWithSalt __salt __val
  
  instance Aeson.ToJSON HsEnumPseudoenumThriftAnn where
    toJSON (HsEnumPseudoenumThriftAnn __val) = Aeson.toJSON __val
  
  hsEnumPseudoenumThriftAnn_ONE :: HsEnumPseudoenumThriftAnn
  hsEnumPseudoenumThriftAnn_ONE = HsEnumPseudoenumThriftAnn 1
  
  hsEnumPseudoenumThriftAnn_TWO :: HsEnumPseudoenumThriftAnn
  hsEnumPseudoenumThriftAnn_TWO = HsEnumPseudoenumThriftAnn 2
  
  hsEnumPseudoenumThriftAnn_THREE :: HsEnumPseudoenumThriftAnn
  hsEnumPseudoenumThriftAnn_THREE = HsEnumPseudoenumThriftAnn 3
  
  instance Default.Default HsEnumPseudoenumThriftAnn where
    def = hsEnumPseudoenumThriftAnn_ONE
  
  instance Prelude.Show HsEnumPseudoenumThriftAnn where
    showsPrec __d (HsEnumPseudoenumThriftAnn __val)
      = case HashMap.lookup __val __m of
          Prelude.Just __s -> Prelude.showString __s
          Prelude.Nothing -> Prelude.showParen (__d > 10)
                               (Prelude.showString "HsEnumPseudoenumThriftAnn__UNKNOWN " .
                                  Prelude.showsPrec 11 __val)
      where
        __m
          = HashMap.fromList
              [(1, "HsEnumPseudoenumThriftAnn_ONE"),
               (2, "HsEnumPseudoenumThriftAnn_TWO"),
               (3, "HsEnumPseudoenumThriftAnn_THREE")]
  
  instance Thrift.ThriftEnum HsEnumPseudoenumThriftAnn where
    toThriftEnum __val
      = HsEnumPseudoenumThriftAnn (Prelude.fromIntegral __val)
    fromThriftEnum (HsEnumPseudoenumThriftAnn __val)
      = Prelude.fromIntegral __val
    allThriftEnumValues
      = [hsEnumPseudoenumThriftAnn_ONE, hsEnumPseudoenumThriftAnn_TWO,
         hsEnumPseudoenumThriftAnn_THREE]
    toThriftEnumEither val
      = if Prelude.elem __val Thrift.allThriftEnumValues then
          Prelude.Right __val else
          Prelude.Left
            ("toThriftEnumEither: not a valid identifier for enum HsEnumPseudoenumThriftAnn: "
               ++ Prelude.show val)
      where
        __val = HsEnumPseudoenumThriftAnn (Prelude.fromIntegral val)
  
  newtype HsEnumEmptyPseudoenumThriftAnn = HsEnumEmptyPseudoenumThriftAnn{unHsEnumEmptyPseudoenumThriftAnn
                                                                          :: Int.Int32}
                                           deriving (Prelude.Eq, DeepSeq.NFData, Prelude.Ord)
  
  instance Hashable.Hashable HsEnumEmptyPseudoenumThriftAnn where
    hashWithSalt __salt (HsEnumEmptyPseudoenumThriftAnn __val)
      = Hashable.hashWithSalt __salt __val
  
  instance Aeson.ToJSON HsEnumEmptyPseudoenumThriftAnn where
    toJSON (HsEnumEmptyPseudoenumThriftAnn __val) = Aeson.toJSON __val
  
  instance Default.Default HsEnumEmptyPseudoenumThriftAnn where
    def
      = Exception.throw
          (Thrift.ProtocolException
             "def: enum HsEnumEmptyPseudoenumThriftAnn has no constructors")
  
  instance Prelude.Show HsEnumEmptyPseudoenumThriftAnn where
    showsPrec __d (HsEnumEmptyPseudoenumThriftAnn __val)
      = case HashMap.lookup __val __m of
          Prelude.Just __s -> Prelude.showString __s
          Prelude.Nothing -> Prelude.showParen (__d > 10)
                               (Prelude.showString "HsEnumEmptyPseudoenumThriftAnn__UNKNOWN " .
                                  Prelude.showsPrec 11 __val)
      where
        __m = HashMap.fromList []
  
  instance Thrift.ThriftEnum HsEnumEmptyPseudoenumThriftAnn where
    toThriftEnum __val
      = HsEnumEmptyPseudoenumThriftAnn (Prelude.fromIntegral __val)
    fromThriftEnum (HsEnumEmptyPseudoenumThriftAnn __val)
      = Prelude.fromIntegral __val
    allThriftEnumValues = []
    toThriftEnumEither val
      = if Prelude.elem __val Thrift.allThriftEnumValues then
          Prelude.Right __val else
          Prelude.Left
            ("toThriftEnumEither: not a valid identifier for enum HsEnumEmptyPseudoenumThriftAnn: "
               ++ Prelude.show val)
      where
        __val = HsEnumEmptyPseudoenumThriftAnn (Prelude.fromIntegral val)
  
  data HsStructOfComplexTypes = HsStructOfComplexTypes{hsStructOfComplexTypes_a_struct
                                                       :: HsStruct,
                                                       hsStructOfComplexTypes_a_union :: HsUnion,
                                                       hsStructOfComplexTypes_an_enum :: HsEnum,
                                                       hsStructOfComplexTypes_a_pseudoenum ::
                                                       HsEnumPseudoenumAnn,
                                                       hsStructOfComplexTypes_a_thrift_pseudoenum ::
                                                       HsEnumPseudoenumThriftAnn}
                                deriving (Prelude.Eq, Prelude.Show, Prelude.Ord)
  
  instance Aeson.ToJSON HsStructOfComplexTypes where
    toJSON
      (HsStructOfComplexTypes __field__a_struct __field__a_union
         __field__an_enum __field__a_pseudoenum
         __field__a_thrift_pseudoenum)
      = Aeson.object
          ("a_struct" .= __field__a_struct :
             "a_union" .= __field__a_union :
               "an_enum" .= __field__an_enum :
                 "a_pseudoenum" .= unHsEnumPseudoenumAnn __field__a_pseudoenum :
                   "a_thrift_pseudoenum" .=
                     unHsEnumPseudoenumThriftAnn __field__a_thrift_pseudoenum
                     : Prelude.mempty)
  
  instance Thrift.ThriftStruct HsStructOfComplexTypes where
    buildStruct _proxy
      (HsStructOfComplexTypes __field__a_struct __field__a_union
         __field__an_enum __field__a_pseudoenum
         __field__a_thrift_pseudoenum)
      = Thrift.genStruct _proxy
          (Thrift.genField _proxy "a_struct" (Thrift.getStructType _proxy) 1
             0
             (Thrift.buildStruct _proxy __field__a_struct)
             :
             Thrift.genField _proxy "a_union" (Thrift.getStructType _proxy) 2 1
               (Thrift.buildStruct _proxy __field__a_union)
               :
               Thrift.genField _proxy "an_enum" (Thrift.getI32Type _proxy) 3 2
                 ((Thrift.genI32 _proxy . Prelude.fromIntegral .
                     Thrift.fromThriftEnum)
                    __field__an_enum)
                 :
                 Thrift.genField _proxy "a_pseudoenum" (Thrift.getI32Type _proxy) 4
                   3
                   ((Thrift.genI32 _proxy . unHsEnumPseudoenumAnn)
                      __field__a_pseudoenum)
                   :
                   Thrift.genField _proxy "a_thrift_pseudoenum"
                     (Thrift.getI32Type _proxy)
                     5
                     4
                     ((Thrift.genI32 _proxy . unHsEnumPseudoenumThriftAnn)
                        __field__a_thrift_pseudoenum)
                     : [])
    parseStruct _proxy
      = ST.runSTT
          (do Prelude.return ()
              __field__a_struct <- ST.newSTRef Default.def
              __field__a_union <- ST.newSTRef Default.def
              __field__an_enum <- ST.newSTRef Default.def
              __field__a_pseudoenum <- ST.newSTRef
                                         (HsEnumPseudoenumAnn Default.def)
              __field__a_thrift_pseudoenum <- ST.newSTRef
                                                (HsEnumPseudoenumThriftAnn Default.def)
              let
                _parse _lastId
                  = do _fieldBegin <- Trans.lift
                                        (Thrift.parseFieldBegin _proxy _lastId _idMap)
                       case _fieldBegin of
                         Thrift.FieldBegin _type _id _bool -> do case _id of
                                                                   1 | _type ==
                                                                         Thrift.getStructType _proxy
                                                                       ->
                                                                       do !_val <- Trans.lift
                                                                                     (Thrift.parseStruct
                                                                                        _proxy)
                                                                          ST.writeSTRef
                                                                            __field__a_struct
                                                                            _val
                                                                   2 | _type ==
                                                                         Thrift.getStructType _proxy
                                                                       ->
                                                                       do !_val <- Trans.lift
                                                                                     (Thrift.parseStruct
                                                                                        _proxy)
                                                                          ST.writeSTRef
                                                                            __field__a_union
                                                                            _val
                                                                   3 | _type ==
                                                                         Thrift.getI32Type _proxy
                                                                       ->
                                                                       do !_val <- Trans.lift
                                                                                     (Thrift.parseEnum
                                                                                        _proxy
                                                                                        "HsEnum")
                                                                          ST.writeSTRef
                                                                            __field__an_enum
                                                                            _val
                                                                   4 | _type ==
                                                                         Thrift.getI32Type _proxy
                                                                       ->
                                                                       do !_val <- Trans.lift
                                                                                     (Prelude.fmap
                                                                                        HsEnumPseudoenumAnn
                                                                                        (Thrift.parseI32
                                                                                           _proxy))
                                                                          ST.writeSTRef
                                                                            __field__a_pseudoenum
                                                                            _val
                                                                   5 | _type ==
                                                                         Thrift.getI32Type _proxy
                                                                       ->
                                                                       do !_val <- Trans.lift
                                                                                     (Prelude.fmap
                                                                                        HsEnumPseudoenumThriftAnn
                                                                                        (Thrift.parseI32
                                                                                           _proxy))
                                                                          ST.writeSTRef
                                                                            __field__a_thrift_pseudoenum
                                                                            _val
                                                                   _ -> Trans.lift
                                                                          (Thrift.parseSkip _proxy
                                                                             _type
                                                                             (Prelude.Just _bool))
                                                                 _parse _id
                         Thrift.FieldEnd -> do !__val__a_struct <- ST.readSTRef
                                                                     __field__a_struct
                                               !__val__a_union <- ST.readSTRef __field__a_union
                                               !__val__an_enum <- ST.readSTRef __field__an_enum
                                               !__val__a_pseudoenum <- ST.readSTRef
                                                                         __field__a_pseudoenum
                                               !__val__a_thrift_pseudoenum <- ST.readSTRef
                                                                                __field__a_thrift_pseudoenum
                                               Prelude.pure
                                                 (HsStructOfComplexTypes __val__a_struct
                                                    __val__a_union
                                                    __val__an_enum
                                                    __val__a_pseudoenum
                                                    __val__a_thrift_pseudoenum)
                _idMap
                  = HashMap.fromList
                      [("a_struct", 1), ("a_union", 2), ("an_enum", 3),
                       ("a_pseudoenum", 4), ("a_thrift_pseudoenum", 5)]
              _parse 0)
  
  instance DeepSeq.NFData HsStructOfComplexTypes where
    rnf
      (HsStructOfComplexTypes __field__a_struct __field__a_union
         __field__an_enum __field__a_pseudoenum
         __field__a_thrift_pseudoenum)
      = DeepSeq.rnf __field__a_struct `Prelude.seq`
          DeepSeq.rnf __field__a_union `Prelude.seq`
            DeepSeq.rnf __field__an_enum `Prelude.seq`
              DeepSeq.rnf __field__a_pseudoenum `Prelude.seq`
                DeepSeq.rnf __field__a_thrift_pseudoenum `Prelude.seq` ()
  
  instance Default.Default HsStructOfComplexTypes where
    def
      = HsStructOfComplexTypes Default.def Default.def Default.def
          (HsEnumPseudoenumAnn Default.def)
          (HsEnumPseudoenumThriftAnn Default.def)
  
  instance Hashable.Hashable HsStructOfComplexTypes where
    hashWithSalt __salt
      (HsStructOfComplexTypes _a_struct _a_union _an_enum _a_pseudoenum
         _a_thrift_pseudoenum)
      = Hashable.hashWithSalt
          (Hashable.hashWithSalt
             (Hashable.hashWithSalt
                (Hashable.hashWithSalt (Hashable.hashWithSalt __salt _a_struct)
                   _a_union)
                _an_enum)
             _a_pseudoenum)
          _a_thrift_pseudoenum