From: Matthijs Kooijman Date: Fri, 6 Mar 2009 10:22:47 +0000 (+0100) Subject: Derive Show for a bunch of types. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=d848abec1bd08f24dd4d1c24ff694101c9ded360;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git Derive Show for a bunch of types. --- diff --git a/FlattenTypes.hs b/FlattenTypes.hs index ecad1ba..785704d 100644 --- a/FlattenTypes.hs +++ b/FlattenTypes.hs @@ -9,6 +9,7 @@ import CoreSyn import qualified Type import HsValueMap +import CoreShow -- | A signal identifier type SignalId = Int @@ -135,6 +136,7 @@ data SigUse = | SigStateOld StateId -- | Use as the current internal state | SigStateNew StateId -- | Use as the new internal state | SigSubState -- | Do not use, state variable is used in a subcircuit + deriving (Show) -- | Is this a port signal use? isPortSigUse :: SigUse -> Bool @@ -167,7 +169,7 @@ data SignalInfo = SignalInfo { sigUse :: SigUse, sigTy :: Type.Type, nameHints :: [String] -} +} deriving (Show) -- | A flattened function data FlatFunction = FlatFunction { @@ -175,7 +177,7 @@ data FlatFunction = FlatFunction { flat_res :: SignalMap, flat_defs :: [SigDef], flat_sigs :: [(SignalId, SignalInfo)] -} +} deriving (Show) -- | Lookup a given signal id in a signal map, and return the associated -- SignalInfo. Errors out if the signal was not found. diff --git a/TranslatorTypes.hs b/TranslatorTypes.hs index 9a521b8..d508816 100644 --- a/TranslatorTypes.hs +++ b/TranslatorTypes.hs @@ -25,7 +25,7 @@ data FuncData = FuncData { flatFunc :: Maybe FlatFunction, funcEntity :: Maybe Entity, funcArch :: Maybe AST.ArchBody -} +} deriving (Show) data VHDLSession = VHDLSession { coreMod :: HscTypes.CoreModule, -- The current module diff --git a/VHDLTypes.hs b/VHDLTypes.hs index 9fdfbf1..7408486 100644 --- a/VHDLTypes.hs +++ b/VHDLTypes.hs @@ -21,4 +21,4 @@ data Entity = Entity { ent_res :: VHDLSignalMap, -- A mapping of the function result to port names ent_decl :: Maybe AST.EntityDec, -- The actual entity declaration. Can be empty for builtin functions. ent_pkg_decl :: Maybe AST.PackageDec -- A package declaration with types for this entity -} +} deriving (Show);