Move the Show deriving for Core types to a new CoreShow module.
[matthijs/master-project/cλash.git] / CoreShow.hs
1 {-# LANGUAGE StandaloneDeriving #-}
2 module CoreShow where
3
4 -- This module derives Show instances for CoreSyn types.
5
6 import qualified CoreSyn
7 import qualified TypeRep
8
9 import Outputable ( showSDoc, ppr)
10
11
12 -- Derive Show for core expressions and binders, so we can see the actual
13 -- structure.
14 deriving instance (Show b) => Show (CoreSyn.Expr b)
15 deriving instance (Show b) => Show (CoreSyn.Bind b)
16
17 -- Implement dummy shows for Note and Type, so we can at least use show on
18 -- expressions.
19 instance Show CoreSyn.Note where
20   show n = "<note>"
21 instance Show TypeRep.Type where
22   show t = "_type:(" ++ (showSDoc $ ppr t) ++ ")"