Skip to content

Commit

Permalink
Remove manual, unused Shows
Browse files Browse the repository at this point in the history
  • Loading branch information
tbidne committed Mar 13, 2024
1 parent 42f9dce commit 307e9d2
Showing 1 changed file with 1 addition and 47 deletions.
48 changes: 1 addition & 47 deletions src/Shrun/Env/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ module Shrun.Env.Types
)
where

import GHC.Show (appPrec, appPrec1)
import Shrun.Data.Command (CommandP1)
import Shrun.Data.KeyHide (KeyHide)
import Shrun.Data.PollInterval (PollInterval)
Expand All @@ -38,16 +37,12 @@ import Shrun.Notify.Types
NotifyTimeout,
)
import Shrun.Prelude
import Text.Show (showParen, showString)

data CmdLogging = MkCmdLogging
{ stripControl :: StripControl,
lineTrunc :: Maybe (Truncation TCmdLine)
}
deriving stock
( Eq,
Show
)
deriving stock (Eq, Show)

makeFieldLabelsNoPrefix ''CmdLogging

Expand All @@ -58,14 +53,6 @@ data FileLogging = MkFileLogging

makeFieldLabelsNoPrefix ''FileLogging

instance Show FileLogging where
showsPrec p fl =
showParen (p > appPrec)
$ showString "MkFileLogging {stripControl = "
. showsPrec appPrec1 (fl ^. #stripControl)
. showString ", log = <(Handle, LogTextQueue)>"
. showString "}"

-- | Holds logging data.
data Logging r = MkLogging
{ -- | Whether to display the command (key) names or the commands
Expand Down Expand Up @@ -94,26 +81,6 @@ data Logging r = MkLogging

makeFieldLabelsNoPrefix ''Logging

instance Show (Logging r) where
showsPrec p env =
showParen (p > appPrec)
$ showString "MkEnv {keyHide = "
. showsPrec appPrec1 (env ^. #keyHide)
. showString ", pollInterval = "
. showsPrec appPrec1 (env ^. #pollInterval)
. showString ", cmdLogReadSize = "
. showsPrec appPrec1 (env ^. #cmdLogReadSize)
. showString ", timerFormat = "
. showsPrec appPrec1 (env ^. #timerFormat)
. showString ", cmdNameTrunc = "
. showsPrec appPrec1 (env ^. #cmdNameTrunc)
. showString ", cmdLog = "
. showsPrec appPrec1 (env ^. #cmdLog)
. showString ", consoleLog = <TBQueue>"
. showString ", fileLog = "
. showsPrec appPrec1 (env ^. #fileLog)
. showString "}"

-- | Holds notification settings.
data NotifyEnv = MkNotifyEnv
{ -- | Notification system to use.
Expand Down Expand Up @@ -171,19 +138,6 @@ data Env = MkEnv

makeFieldLabelsNoPrefix ''Env

instance Show Env where
showsPrec p env =
showParen (p > appPrec)
$ showString "MkEnv {timeout = "
. showsPrec appPrec1 (env ^. #timeout)
. showString ", logging = "
. showsPrec appPrec1 (env ^. #logging)
. showString ", completedCmds = <TVar>"
. showString ", anyError = <TVar>"
. showString ", commands = "
. showsPrec appPrec1 (env ^. #commands)
. showString "}"

instance HasTimeout Env where
getTimeout = view #timeout

Expand Down

0 comments on commit 307e9d2

Please sign in to comment.