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

import CoreSyn
import Outputable ( OutputableBndr(..))
import Name (NamedThing)

data PExpr where
  PCoreExpr :: NamedThing a => Expr a -> PExpr
  PBind :: NamedThing a => Bind a -> PExpr
  PVar :: NamedThing a => BindType -> a -> PExpr

data BindType = Binder | Reference

varBinder :: NamedThing a => a -> PExpr
varBinder a = PVar Binder a

varReference :: NamedThing a => a -> PExpr
varReference a = PVar Reference a