1
1
mirror of https://github.com/github/semantic.git synced 2025-01-03 13:02:37 +03:00

Use StandaloneDeriving for Arguments

This commit is contained in:
Timothy Clem 2017-04-24 09:42:58 -07:00
parent 196a0d28e8
commit 5181a11455

View File

@ -1,4 +1,4 @@
{-# LANGUAGE GADTs, DuplicateRecordFields, RankNTypes #-}
{-# LANGUAGE GADTs, DuplicateRecordFields, RankNTypes, StandaloneDeriving, UndecidableInstances #-}
{-# OPTIONS_GHC -funbox-strict-fields #-}
module Arguments where
@ -21,6 +21,8 @@ data DiffArguments where
, alternateObjectDirs :: [FilePath]
} -> DiffArguments
deriving instance Show DiffArguments
patchDiff :: DiffMode -> FilePath -> [FilePath] -> DiffArguments
patchDiff = DiffArguments PatchRenderer
@ -51,6 +53,8 @@ data ParseArguments where
, alternateObjectDirs :: [FilePath]
} -> ParseArguments
deriving instance Show ParseArguments
sExpressionParseTree :: ParseMode -> FilePath -> [FilePath] -> ParseArguments
sExpressionParseTree = ParseArguments (SExpressionParseTreeRenderer TreeOnly)
@ -67,18 +71,3 @@ data Arguments = Arguments
{ programMode :: ProgramMode
, outputFilePath :: Maybe FilePath
} deriving Show
instance Show DiffArguments where
showsPrec d (DiffArguments renderer mode gitDir alternateObjectDirs) = showParen (d >= 10) $ showString "DiffArguments "
. showString "diffRenderer = " . shows renderer . showString ", "
. showString "diffMode = " . shows mode . showString ", "
. showString "gitDir = " . shows gitDir . showString ", "
. showString "alternateObjectDirs = " . shows alternateObjectDirs
instance Show ParseArguments where
showsPrec d (ParseArguments renderer mode gitDir alternateObjectDirs) = showParen (d >= 10) $ showString "ParseArguments "
. showString "parseTreeRenderer = " . shows renderer . showString ", "
. showString "parseMode = " . shows mode . showString ", "
. showString "gitDir = " . shows gitDir . showString ", "
. showString "alternateObjectDirs = " . shows alternateObjectDirs