CoreSyn.lhs 18 KB
Newer Older
1
%
2
% (c) The GRASP/AQUA Project, Glasgow University, 1992-1996
3 4 5 6 7 8 9
%
\section[CoreSyn]{A data type for the Haskell compiler midsection}

\begin{code}
#include "HsVersions.h"

module CoreSyn (
10
	GenCoreBinding(..), GenCoreExpr(..),
11
	GenCoreArg(..), GenCoreBinder(..), GenCoreCaseAlts(..),
12
	GenCoreCaseDefault(..),
13
	Coercion(..),
14 15 16 17 18 19 20

	bindersOf, pairsFromCoreBinds, rhssOfBind,

	mkGenApp, mkValApp, mkTyApp, mkUseApp,
	mkApp, mkCon, mkPrim,
	mkValLam, mkTyLam, mkUseLam,
	mkLam,
21
	collectBinders, isValBinder, notValBinder,
22
	
23
	collectArgs, isValArg, notValArg, numValArgs,
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52

	mkCoLetAny, mkCoLetNoUnboxed, mkCoLetUnboxedToCase,
	mkCoLetsAny, mkCoLetsNoUnboxed, mkCoLetsUnboxedToCase,
	mkCoLetrecAny, mkCoLetrecNoUnboxed,

	rhssOfAlts,

	-- Common type instantiation...
	CoreBinding(..),
	CoreExpr(..),
	CoreBinder(..),
	CoreArg(..),
	CoreCaseAlts(..),
	CoreCaseDefault(..),

	-- And not-so-common type instantiations...
	TaggedCoreBinding(..),
	TaggedCoreExpr(..),
	TaggedCoreBinder(..),
	TaggedCoreArg(..),
	TaggedCoreCaseAlts(..),
	TaggedCoreCaseDefault(..),

	SimplifiableCoreBinding(..),
	SimplifiableCoreExpr(..),
	SimplifiableCoreBinder(..),
	SimplifiableCoreArg(..),
	SimplifiableCoreCaseAlts(..),
	SimplifiableCoreCaseDefault(..)
53 54

	-- and to make the interface self-sufficient ...
55

56 57
    ) where

58 59
import Ubiq{-uitous-}

60 61 62 63
-- ToDo:rm:
--import PprCore		( GenCoreExpr{-instance-} )
--import PprStyle		( PprStyle(..) )

64
import CostCentre	( showCostCentre, CostCentre )
65 66
import Id		( idType, GenId{-instance Eq-} )
import Type		( isUnboxedType )
67
import Usage		( UVar(..) )
68
import Util		( panic, assertPanic {-pprTrace:ToDo:rm-} )
69 70 71 72
\end{code}

%************************************************************************
%*									*
dnt's avatar
dnt committed
73
\subsection[CoreTopBinding_and_CoreBinding]{@CoreTopBinding@ and @GenCoreBinding@}
74 75 76 77 78
%*									*
%************************************************************************

Core programs, bindings, expressions, etc., are parameterised with
respect to the information kept about binding and bound occurrences of
dnt's avatar
dnt committed
79
variables, called {\em binders} and {\em val_occ tyvar uvars}, respectively.  [I
80 81 82
don't really like the pair of names; I prefer {\em binder} and {\em
bounder}.  Or {\em binder} and {\em var}.]

dnt's avatar
dnt committed
83
A @GenCoreBinding@ is either a single non-recursive binding of a
84 85
``binder'' to an expression, or a mutually-recursive blob of same.
\begin{code}
dnt's avatar
dnt committed
86 87 88
data GenCoreBinding val_bdr val_occ tyvar uvar
  = NonRec	val_bdr (GenCoreExpr val_bdr val_occ tyvar uvar)
  | Rec		[(val_bdr, GenCoreExpr val_bdr val_occ tyvar uvar)]
89 90
\end{code}

91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
\begin{code}
bindersOf :: GenCoreBinding val_bdr val_occ tyvar uvar -> [val_bdr]

pairsFromCoreBinds ::
  [GenCoreBinding val_bdr val_occ tyvar uvar] ->
  [(val_bdr, GenCoreExpr val_bdr val_occ tyvar uvar)]

rhssOfBind :: GenCoreBinding val_bdr val_occ tyvar uvar -> [GenCoreExpr val_bdr val_occ tyvar uvar]

bindersOf (NonRec binder _) = [binder]
bindersOf (Rec pairs)       = [binder | (binder, _) <- pairs]

pairsFromCoreBinds []		       = []
pairsFromCoreBinds ((NonRec b e) : bs) = (b,e) :  pairsFromCoreBinds bs
pairsFromCoreBinds ((Rec  pairs) : bs) = pairs ++ pairsFromCoreBinds bs

rhssOfBind (NonRec _ rhs) = [rhs]
rhssOfBind (Rec pairs)    = [rhs | (_,rhs) <- pairs]
\end{code}
110 111 112

%************************************************************************
%*									*
dnt's avatar
dnt committed
113
\subsection[GenCoreExpr]{Core expressions: @GenCoreExpr@}
114 115 116
%*									*
%************************************************************************

dnt's avatar
dnt committed
117
@GenCoreExpr@ is the heart of the ``core'' data types; it is
118
(more-or-less) boiled-down second-order polymorphic lambda calculus.
dnt's avatar
dnt committed
119
For types in the core world, we just keep using @Types@.
120
\begin{code}
dnt's avatar
dnt committed
121 122 123
data GenCoreExpr val_bdr val_occ tyvar uvar
     = Var    val_occ
     | Lit    Literal	-- literal constants
124 125
\end{code}

dnt's avatar
dnt committed
126 127
@Cons@ and @Prims@ are saturated constructor and primitive-op
applications (see the comment).  Note: @Con@s are only set up by the
128
simplifier (and by the desugarer when it knows what it's doing).  The
dnt's avatar
dnt committed
129 130
desugarer sets up constructors as applications of global @Vars@s.

131
\begin{code}
132
     | Con	Id [GenCoreArg val_occ tyvar uvar]
dnt's avatar
dnt committed
133 134 135 136 137 138 139
		-- Saturated constructor application:
		-- The constructor is a function of the form:
		--	/\ a1 -> ... /\ am -> \ b1 -> ... \ bn ->
		-- <expr> where "/\" is a type lambda and "\" the
		-- regular kind; there will be "m" Types and
		-- "n" bindees in the Con args.

140
     | Prim	PrimOp [GenCoreArg val_occ tyvar uvar]
dnt's avatar
dnt committed
141 142
		-- saturated primitive operation;
		-- comment on Cons applies here, too.
143 144
\end{code}

dnt's avatar
dnt committed
145
Ye olde abstraction and application operators.
146
\begin{code}
dnt's avatar
dnt committed
147
     | Lam	(GenCoreBinder val_bdr tyvar uvar)
148
		(GenCoreExpr   val_bdr val_occ tyvar uvar)
dnt's avatar
dnt committed
149 150

     | App	(GenCoreExpr val_bdr val_occ tyvar uvar)
151
		(GenCoreArg  val_occ tyvar uvar)
152 153
\end{code}

dnt's avatar
dnt committed
154
Case expressions (\tr{case <expr> of <List of alternatives>}): there
155 156
are really two flavours masquerading here---those for scrutinising
{\em algebraic} types and those for {\em primitive} types.  Please see
157
under @GenCoreCaseAlts@.
158
\begin{code}
dnt's avatar
dnt committed
159
     | Case	(GenCoreExpr val_bdr val_occ tyvar uvar)
160
		(GenCoreCaseAlts val_bdr val_occ tyvar uvar)
161 162 163 164 165 166
\end{code}

A Core case expression \tr{case e of v -> ...} implies evaluation of
\tr{e}; it is not equivalent to \tr{let v = in ...} (as with a Haskell
\tr{case}).

dnt's avatar
dnt committed
167
Non-recursive @Lets@ only have one binding; having more than one
168 169 170
doesn't buy you much, and it is an easy way to mess up variable
scoping.
\begin{code}
dnt's avatar
dnt committed
171
     | Let	(GenCoreBinding val_bdr val_occ tyvar uvar)
172
		(GenCoreExpr val_bdr val_occ tyvar uvar)
dnt's avatar
dnt committed
173 174
		-- both recursive and non-.
		-- The "GenCoreBinding" records that information
175 176 177
\end{code}

For cost centre scc expressions we introduce a new core construct
dnt's avatar
dnt committed
178
@SCC@ so transforming passes have to deal with it explicitly. The
179 180 181
alternative of using a new PrimativeOp may result in a bad
transformations of which we are unaware.
\begin{code}
dnt's avatar
dnt committed
182 183
     | SCC	CostCentre				    -- label of scc
		(GenCoreExpr val_bdr val_occ tyvar uvar)    -- scc expression
184 185
\end{code}

186 187 188 189 190 191 192 193 194 195 196 197 198 199 200
Coercions arise from uses of the constructor of a @newtype@
declaration, either in construction (resulting in a @CoreceIn@) or
pattern matching (resulting in a @CoerceOut@).

\begin{code}
    | Coerce	Coercion
		(GenType tyvar uvar)		-- Type of the whole expression
		(GenCoreExpr val_bdr val_occ tyvar uvar)
\end{code}

\begin{code}
data Coercion	= CoerceIn Id		-- Apply this constructor
		| CoerceOut Id		-- Strip this constructor
\end{code}

201

202 203 204 205 206 207 208 209 210 211 212 213 214 215 216
%************************************************************************
%*									*
\subsection{Core-constructing functions with checking}
%*									*
%************************************************************************

When making @Lets@, we may want to take evasive action if the thing
being bound has unboxed type. We have different variants ...

@mkCoLet(s|rec)Any@ 		let-binds any binding, regardless of type
@mkCoLet(s|rec)NoUnboxed@ 	prohibits unboxed bindings
@mkCoLet(s)UnboxedToCase@ 	converts an unboxed binding to a case
				(unboxed bindings in a letrec are still prohibited)

\begin{code}
217 218 219 220 221 222 223
mkCoLetAny :: GenCoreBinding Id Id tyvar uvar
	   -> GenCoreExpr    Id Id tyvar uvar
	   -> GenCoreExpr    Id Id tyvar uvar
mkCoLetsAny :: [GenCoreBinding Id Id tyvar uvar] ->
		GenCoreExpr Id Id tyvar uvar ->
		GenCoreExpr Id Id tyvar uvar

224 225 226 227 228 229 230 231 232 233 234 235 236
mkCoLetrecAny :: [(val_bdr, GenCoreExpr val_bdr val_occ tyvar uvar)]
	      -> GenCoreExpr val_bdr val_occ tyvar uvar
	      -> GenCoreExpr val_bdr val_occ tyvar uvar

mkCoLetrecAny []    body = body
mkCoLetrecAny binds body = Let (Rec binds) body

mkCoLetsAny []    expr = expr
mkCoLetsAny binds expr = foldr mkCoLetAny expr binds

mkCoLetAny bind@(Rec binds) body = mkCoLetrecAny binds body
mkCoLetAny bind@(NonRec binder rhs) body
  = case body of
237
      Var binder2 | binder == binder2
238 239 240 241 242 243 244 245 246 247 248 249 250 251
	 -> rhs   -- hey, I have the rhs
      other
	 -> Let bind body
\end{code}

\begin{code}
--mkCoLetNoUnboxed ::
--  GenCoreBinding val_bdr val_occ tyvar uvar ->
--  GenCoreExpr val_bdr val_occ tyvar uvar ->
--  GenCoreExpr val_bdr val_occ tyvar uvar

mkCoLetNoUnboxed bind@(Rec binds) body
  = mkCoLetrecNoUnboxed binds body
mkCoLetNoUnboxed bind@(NonRec binder rhs) body
252
  = --ASSERT (not (isUnboxedType (idType binder)))
253
    case body of
254
      Var binder2 | binder == binder2
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271
	 -> rhs   -- hey, I have the rhs
      other
	 -> Let bind body

mkCoLetsNoUnboxed []    expr = expr
mkCoLetsNoUnboxed binds expr = foldr mkCoLetNoUnboxed expr binds

--mkCoLetrecNoUnboxed :: [(Id, CoreExpr)]	-- bindings
--  	            -> CoreExpr		-- body
--		    -> CoreExpr 		-- result

mkCoLetrecNoUnboxed []    body = body
mkCoLetrecNoUnboxed binds body
  = ASSERT (all is_boxed_bind binds)
    Let (Rec binds) body
  where
    is_boxed_bind (binder, rhs)
272
      = (not . isUnboxedType . idType) binder
273 274 275 276 277 278 279 280 281 282 283 284
\end{code}

\begin{code}
--mkCoLetUnboxedToCase ::
--  GenCoreBinding val_bdr val_occ tyvar uvar ->
--  GenCoreExpr val_bdr val_occ tyvar uvar ->
--  GenCoreExpr val_bdr val_occ tyvar uvar

mkCoLetUnboxedToCase bind@(Rec binds) body
  = mkCoLetrecNoUnboxed binds body
mkCoLetUnboxedToCase bind@(NonRec binder rhs) body
  = case body of
285
      Var binder2 | binder == binder2
286 287
	 -> rhs   -- hey, I have the rhs
      other
288
	 -> if (not (isUnboxedType (idType binder))) then
289 290 291 292 293 294 295 296 297 298
		Let bind body		 -- boxed...
	    else
		Case rhs		  -- unboxed...
	    	  (PrimAlts []
		    (BindDefault binder body))

mkCoLetsUnboxedToCase []    expr = expr
mkCoLetsUnboxedToCase binds expr = foldr mkCoLetUnboxedToCase expr binds
\end{code}

299 300
%************************************************************************
%*									*
dnt's avatar
dnt committed
301
\subsection{Case alternatives in @GenCoreExpr@}
302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317
%*									*
%************************************************************************

We have different kinds of @case@s, the differences being reflected in
the kinds of alternatives a case has.  We maintain a distinction
between cases for scrutinising algebraic datatypes, as opposed to
primitive types.  In both cases, we carry around a @TyCon@, as a
handle with which we can get info about the case (e.g., total number
of data constructors for this type).

For example:
\begin{verbatim}
let# x=e in b
\end{verbatim}
becomes
\begin{verbatim}
dnt's avatar
dnt committed
318
Case e [ BindDefaultAlt x -> b ]
319 320 321
\end{verbatim}

\begin{code}
322
data GenCoreCaseAlts val_bdr val_occ tyvar uvar
dnt's avatar
dnt committed
323 324 325 326 327 328 329 330
  = AlgAlts	[(Id,				-- alts: data constructor,
		  [val_bdr],			-- constructor's parameters,
		  GenCoreExpr val_bdr val_occ tyvar uvar)]	-- rhs.
		(GenCoreCaseDefault val_bdr val_occ tyvar uvar)

  | PrimAlts	[(Literal,			-- alts: unboxed literal,
		  GenCoreExpr val_bdr val_occ tyvar uvar)]	-- rhs.
		(GenCoreCaseDefault val_bdr val_occ tyvar uvar)
331 332

-- obvious things: if there are no alts in the list, then the default
dnt's avatar
dnt committed
333
-- can't be NoDefault.
334

dnt's avatar
dnt committed
335 336
data GenCoreCaseDefault val_bdr val_occ tyvar uvar
  = NoDefault					-- small con family: all
337
						-- constructor accounted for
dnt's avatar
dnt committed
338 339
  | BindDefault val_bdr				-- form: var -> expr;
		(GenCoreExpr val_bdr val_occ tyvar uvar)	-- "val_bdr" may or may not
340 341 342
						-- be used in RHS.
\end{code}

343 344 345 346 347 348 349 350
\begin{code}
rhssOfAlts (AlgAlts alts deflt)  = rhssOfDeflt deflt ++ [rhs | (_,_,rhs) <- alts]
rhssOfAlts (PrimAlts alts deflt) = rhssOfDeflt deflt ++ [rhs | (_,rhs)   <- alts]

rhssOfDeflt NoDefault		= []
rhssOfDeflt (BindDefault _ rhs) = [rhs]
\end{code}

351 352
%************************************************************************
%*									*
353
\subsection{Core binders}
354 355 356 357
%*									*
%************************************************************************

\begin{code}
358 359 360 361
data GenCoreBinder val_bdr tyvar uvar
  = ValBinder	val_bdr
  | TyBinder	tyvar
  | UsageBinder	uvar
362 363 364 365 366

isValBinder (ValBinder _) = True
isValBinder _		  = False

notValBinder = not . isValBinder
367
\end{code}
368

369
Clump Lams together if possible.
370

371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391
\begin{code}
mkValLam :: [val_bdr]
	 -> GenCoreExpr val_bdr val_occ tyvar uvar
	 -> GenCoreExpr val_bdr val_occ tyvar uvar
mkTyLam  :: [tyvar]
	 -> GenCoreExpr val_bdr val_occ tyvar uvar
	 -> GenCoreExpr val_bdr val_occ tyvar uvar
mkUseLam :: [uvar]
	 -> GenCoreExpr val_bdr val_occ tyvar uvar
	 -> GenCoreExpr val_bdr val_occ tyvar uvar

mkValLam binders body = foldr (Lam . ValBinder)   body binders
mkTyLam  binders body = foldr (Lam . TyBinder)    body binders
mkUseLam binders body = foldr (Lam . UsageBinder) body binders

mkLam :: [tyvar] -> [val_bdr] -- ToDo: could add a [uvar] arg...
	 -> GenCoreExpr val_bdr val_occ tyvar uvar
	 -> GenCoreExpr val_bdr val_occ tyvar uvar

mkLam tyvars valvars body
  = mkTyLam tyvars (mkValLam valvars body)
392 393
\end{code}

394
We often want to strip off leading lambdas before getting down to
395
business.  @collectBinders@ is your friend.
396 397 398 399

We expect (by convention) usage-, type-, and value- lambdas in that
order.

400
\begin{code}
401
collectBinders ::
402 403
  GenCoreExpr val_bdr val_occ tyvar uvar ->
  ([uvar], [tyvar], [val_bdr], GenCoreExpr val_bdr val_occ tyvar uvar)
404

405 406
collectBinders expr
  = usages expr []
407
  where
408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423
    usages (Lam (UsageBinder u) body) uacc = usages body (u:uacc)
    usages other uacc
      = case (tyvars other []) of { (tacc, vacc, expr) ->
	(reverse uacc, tacc, vacc, expr) }

    tyvars (Lam (TyBinder t)    body) tacc = tyvars body (t:tacc)
    tyvars other tacc
      = ASSERT(not (usage_lambda other))
	case (valvars other []) of { (vacc, expr) ->
	(reverse tacc, vacc, expr) }

    valvars (Lam (ValBinder v)  body) vacc = valvars body (v:vacc)
    valvars other vacc
      = ASSERT(not (usage_lambda other))
	ASSERT(not (tyvar_lambda other))
	(reverse vacc, other)
424 425 426 427 428 429 430

    ---------------------------------------
    usage_lambda (Lam (UsageBinder _) _) = True
    usage_lambda _			 = False

    tyvar_lambda (Lam (TyBinder _) _)    = True
    tyvar_lambda _			 = False
431 432
\end{code}

433 434 435 436 437
%************************************************************************
%*									*
\subsection{Core arguments (atoms)}
%*									*
%************************************************************************
438 439

\begin{code}
440 441 442 443 444 445
data GenCoreArg val_occ tyvar uvar
  = LitArg	Literal
  | VarArg	val_occ
  | TyArg	(GenType tyvar uvar)
  | UsageArg	(GenUsage uvar)
\end{code}
446

447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476
General and specific forms:
\begin{code}
mkGenApp :: GenCoreExpr val_bdr val_occ tyvar uvar
	 -> [GenCoreArg val_occ tyvar uvar]
	 -> GenCoreExpr val_bdr val_occ tyvar uvar
mkTyApp  :: GenCoreExpr val_bdr val_occ tyvar uvar
	 -> [GenType tyvar uvar]
	 -> GenCoreExpr val_bdr val_occ tyvar uvar
mkUseApp :: GenCoreExpr val_bdr val_occ tyvar uvar
	 -> [GenUsage uvar]
	 -> GenCoreExpr val_bdr val_occ tyvar uvar
mkValApp :: GenCoreExpr val_bdr val_occ tyvar uvar
	 -> [GenCoreArg val_occ tyvar uvar] -- but we ASSERT they are LitArg or VarArg
	 -> GenCoreExpr val_bdr val_occ tyvar uvar

mkGenApp f args = foldl App		  		   f args
mkTyApp  f args = foldl (\ e a -> App e (TyArg a))	   f args
mkUseApp f args = foldl (\ e a -> App e (UsageArg a))	   f args
mkValApp f args = foldl (\ e a -> App e (is_Lit_or_Var a)) f args

#ifndef DEBUG
is_Lit_or_Var a = a
#else
is_Lit_or_Var a
  = if isValArg a then a else panic "CoreSyn.mkValApps:not LitArg or VarArg"
#endif

isValArg (LitArg _) = True  -- often used for sanity-checking
isValArg (VarArg _) = True
isValArg _	    = False
477 478 479 480

notValArg = not . isValArg -- exists only because it's a common use of isValArg

numValArgs as = length [ a | a <- as, isValArg a ] -- again, convenience
481
\end{code}
482

483 484 485 486
\begin{code}
mkApp  fun = mk_thing (mkGenApp fun)
mkCon  con = mk_thing (Con      con)
mkPrim op  = mk_thing (Prim     op)
dnt's avatar
dnt committed
487

488 489
mk_thing thing uses tys vals
  = thing (map UsageArg uses ++ map TyArg tys ++ map is_Lit_or_Var vals)
490 491 492 493 494 495
\end{code}

@collectArgs@ takes an application expression, returning the function
and the arguments to which it is applied.

\begin{code}
496 497
collectArgs :: GenCoreExpr val_bdr val_occ tyvar uvar
	    -> (GenCoreExpr val_bdr val_occ tyvar uvar,
498 499 500
		[GenUsage uvar],
		[GenType tyvar uvar],
	        [GenCoreArg val_occ tyvar uvar]{-ValArgs-})
501 502

collectArgs expr
503
  = valvars expr []
504
  where
505 506 507
    valvars (App fun v) vacc | isValArg v = valvars fun (v:vacc)
    valvars fun vacc
      = case (tyvars fun []) of { (expr, uacc, tacc) ->
508 509 510 511
	(expr, uacc, tacc, vacc) }

    tyvars (App fun (TyArg t))    tacc = tyvars fun (t:tacc)
    tyvars fun tacc
512 513
      = case (usages fun []) of { (expr, uacc) ->
	(expr, uacc, tacc) }
514

515 516 517
    usages (App fun (UsageArg u)) uacc = usages fun (u:uacc)
    usages fun uacc
      = (fun,uacc)
518 519 520 521
\end{code}

%************************************************************************
%*									*
522
\subsection{The main @Core*@ instantiation of the @GenCore*@ types}
523 524 525 526
%*									*
%************************************************************************

\begin{code}
527 528 529 530
type CoreBinding = GenCoreBinding  Id Id TyVar UVar
type CoreExpr    = GenCoreExpr     Id Id TyVar UVar
type CoreBinder	 = GenCoreBinder   Id    TyVar UVar
type CoreArg     = GenCoreArg         Id TyVar UVar
531

532 533
type CoreCaseAlts    = GenCoreCaseAlts    Id Id TyVar UVar
type CoreCaseDefault = GenCoreCaseDefault Id Id TyVar UVar
534 535
\end{code}

536 537 538 539 540
%************************************************************************
%*									*
\subsection{The @TaggedCore*@ instantiation of the @GenCore*@ types}
%*									*
%************************************************************************
541

542
Binders are ``tagged'' with a \tr{t}:
543
\begin{code}
544
type Tagged t = (Id, t)
545

546 547 548 549
type TaggedCoreBinding t = GenCoreBinding (Tagged t) Id TyVar UVar
type TaggedCoreExpr    t = GenCoreExpr    (Tagged t) Id TyVar UVar
type TaggedCoreBinder  t = GenCoreBinder  (Tagged t)    TyVar UVar
type TaggedCoreArg     t = GenCoreArg                Id TyVar UVar
550

551 552
type TaggedCoreCaseAlts    t = GenCoreCaseAlts    (Tagged t) Id TyVar UVar
type TaggedCoreCaseDefault t = GenCoreCaseDefault (Tagged t) Id TyVar UVar
553 554
\end{code}

555 556 557 558 559
%************************************************************************
%*									*
\subsection{The @SimplifiableCore*@ instantiation of the @GenCore*@ types}
%*									*
%************************************************************************
560

561
Binders are tagged with @BinderInfo@:
562
\begin{code}
563
type Simplifiable = (Id, BinderInfo)
564

565 566 567 568
type SimplifiableCoreBinding = GenCoreBinding Simplifiable Id TyVar UVar
type SimplifiableCoreExpr    = GenCoreExpr    Simplifiable Id TyVar UVar
type SimplifiableCoreBinder  = GenCoreBinder  Simplifiable    TyVar UVar
type SimplifiableCoreArg     = GenCoreArg                  Id TyVar UVar
569

570 571
type SimplifiableCoreCaseAlts    = GenCoreCaseAlts    Simplifiable Id TyVar UVar
type SimplifiableCoreCaseDefault = GenCoreCaseDefault Simplifiable Id TyVar UVar
572
\end{code}