{-# OPTIONS_GHC -fno-warn-orphans #-}

{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE DeriveDataTypeable #-}


module Language.Haskell.Brittany.Internal.Config.Types.Instances2 where

import Language.Haskell.Brittany.Internal.Config.Types
import Language.Haskell.Brittany.Internal.Prelude
import qualified Data.Semigroup as Semigroup
import Data.Semigroup.Generic
import Data.CZipWith
import Data.Data(Data)



-- i wonder if any Show1 stuff could be leveraged.
deriving instance Show (CDebugConfig Identity)
deriving instance Show (CLayoutConfig Identity)
deriving instance Show (CErrorHandlingConfig Identity)
deriving instance Show (CForwardOptions Identity)
deriving instance Show (CPreProcessorConfig Identity)
deriving instance Show (CConfig Identity)

deriving instance Show (CDebugConfig Maybe)
deriving instance Show (CLayoutConfig Maybe)
deriving instance Show (CErrorHandlingConfig Maybe)
deriving instance Show (CForwardOptions Maybe)
deriving instance Show (CPreProcessorConfig Maybe)
deriving instance Show (CConfig Maybe)

instance Semigroup.Semigroup (CDebugConfig Maybe) where
  (<>) = gmappend
instance Semigroup.Semigroup (CLayoutConfig Maybe) where
  (<>) = gmappend
instance Semigroup.Semigroup (CErrorHandlingConfig Maybe) where
  (<>) = gmappend
instance Semigroup.Semigroup (CForwardOptions Maybe) where
  (<>) = gmappend
instance Semigroup.Semigroup (CPreProcessorConfig Maybe) where
  (<>) = gmappend
instance Semigroup.Semigroup (CConfig Maybe) where
  (<>) = gmappend

instance Semigroup.Semigroup (CDebugConfig Identity) where
  (<>) = gmappend
instance Semigroup.Semigroup (CLayoutConfig Identity) where
  (<>) = gmappend
instance Semigroup.Semigroup (CErrorHandlingConfig Identity) where
  (<>) = gmappend
instance Semigroup.Semigroup (CForwardOptions Identity) where
  (<>) = gmappend
instance Semigroup.Semigroup (CPreProcessorConfig Identity) where
  (<>) = gmappend
instance Semigroup.Semigroup (CConfig Identity) where
  (<>) = gmappend

instance Monoid (CDebugConfig Maybe) where
  mempty = gmempty
instance Monoid (CLayoutConfig Maybe) where
  mempty = gmempty
instance Monoid (CErrorHandlingConfig Maybe) where
  mempty = gmempty
instance Monoid (CForwardOptions Maybe) where
  mempty = gmempty
instance Monoid (CPreProcessorConfig Maybe) where
  mempty = gmempty
instance Monoid (CConfig Maybe) where
  mempty = gmempty

deriveCZipWith ''CDebugConfig
deriveCZipWith ''CLayoutConfig
deriveCZipWith ''CErrorHandlingConfig
deriveCZipWith ''CForwardOptions
deriveCZipWith ''CPreProcessorConfig
deriveCZipWith ''CConfig

instance CFunctor CDebugConfig
instance CFunctor CLayoutConfig
instance CFunctor CErrorHandlingConfig
instance CFunctor CForwardOptions
instance CFunctor CPreProcessorConfig
instance CFunctor CConfig

deriving instance Data PerItemConfig

deriving instance Data (CDebugConfig Identity)
deriving instance Data (CLayoutConfig Identity)
deriving instance Data (CErrorHandlingConfig Identity)
deriving instance Data (CForwardOptions Identity)
deriving instance Data (CPreProcessorConfig Identity)
deriving instance Data (CConfig Identity)

deriving instance Data (CDebugConfig Maybe)
deriving instance Data (CLayoutConfig Maybe)
deriving instance Data (CErrorHandlingConfig Maybe)
deriving instance Data (CForwardOptions Maybe)
deriving instance Data (CPreProcessorConfig Maybe)
deriving instance Data (CConfig Maybe)
