summaryrefslogtreecommitdiff
path: root/compiler/utils/OutputableAnnotation.hs
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2017-07-26 16:42:23 +0000
committerMatthew Pickering <matthewtpickering@gmail.com>2017-07-26 16:42:23 +0000
commit48889bcd2371facda52e01bd7a7017c57bbe8159 (patch)
tree2348ef718d4cfdc25c8f5486e6d81bed0820a231 /compiler/utils/OutputableAnnotation.hs
parent184020739f0dda48fa4f3a3a65f58f6dd710d369 (diff)
downloadhaskell-48889bcd2371facda52e01bd7a7017c57bbe8159.tar.gz
More refined annotations + binders + bindings
Diffstat (limited to 'compiler/utils/OutputableAnnotation.hs')
-rw-r--r--compiler/utils/OutputableAnnotation.hs16
1 files changed, 14 insertions, 2 deletions
diff --git a/compiler/utils/OutputableAnnotation.hs b/compiler/utils/OutputableAnnotation.hs
index f506a0b20b..1ad2d83e16 100644
--- a/compiler/utils/OutputableAnnotation.hs
+++ b/compiler/utils/OutputableAnnotation.hs
@@ -1,9 +1,21 @@
{-# LANGUAGE GADTs #-}
-module OutputableAnnotation (PExpr(..)) where
+module OutputableAnnotation (PExpr(..), BindType, varBinder, varReference) where
import CoreSyn
+import Outputable ( OutputableBndr(..))
data PExpr where
- PCoreExpr :: CoreExpr -> PExpr
+ PCoreExpr :: OutputableBndr a => Expr a -> PExpr
+ PBind :: OutputableBndr a => Bind a -> PExpr
+ PVar :: OutputableBndr a => BindType -> a -> PExpr
+
+data BindType = Binder | Reference
+
+varBinder :: OutputableBndr a => a -> PExpr
+varBinder a = PVar Binder a
+
+varReference :: OutputableBndr a => a -> PExpr
+varReference a = PVar Reference a
+