summaryrefslogtreecommitdiff
path: root/compiler/utils/OutputableAnnotation.hs
blob: 1ad2d83e16e030443aeff60828b41688cde93411 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{-# LANGUAGE GADTs #-}
module OutputableAnnotation (PExpr(..), BindType, varBinder, varReference) where

import CoreSyn
import Outputable ( OutputableBndr(..))

data PExpr where
  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