X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=CoreShow.hs;fp=CoreShow.hs;h=522fd39cb5c7277e817d50afc355ec5e2dd92da3;hb=19b34adb91120fef34160874620f0d3c6b14e7b8;hp=0000000000000000000000000000000000000000;hpb=d9768d874c3b4ebb113b6fd3cc30234725c59279;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git diff --git a/CoreShow.hs b/CoreShow.hs new file mode 100644 index 0000000..522fd39 --- /dev/null +++ b/CoreShow.hs @@ -0,0 +1,22 @@ +{-# LANGUAGE StandaloneDeriving #-} +module CoreShow where + +-- This module derives Show instances for CoreSyn types. + +import qualified CoreSyn +import qualified TypeRep + +import Outputable ( showSDoc, ppr) + + +-- Derive Show for core expressions and binders, so we can see the actual +-- structure. +deriving instance (Show b) => Show (CoreSyn.Expr b) +deriving instance (Show b) => Show (CoreSyn.Bind b) + +-- Implement dummy shows for Note and Type, so we can at least use show on +-- expressions. +instance Show CoreSyn.Note where + show n = "" +instance Show TypeRep.Type where + show t = "_type:(" ++ (showSDoc $ ppr t) ++ ")"