summaryrefslogtreecommitdiff
path: root/ghc/compiler/envs/LIE.lhs
blob: cd3e38cd62438d1dde018ca8e97bc00b09c501e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
%
% (c) The GRASP/AQUA Project, Glasgow University, 1992-1994
%
\section[LIE]{Id instance environment}

This is not really an ``environment.''

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

module LIE (
	LIE,		-- abstract type
	mkLIE, nullLIE, unitLIE, unMkLIE, plusLIE,

	-- imported things so this module's interface is self-contained
	Inst
    ) where

import Inst		( Inst )
import Outputable
import Util
\end{code}

%************************************************************************
%*									*
\subsection[LIE-building]{Building LIEs}
%*									*
%************************************************************************

\begin{code}
data LIE = MkLIE [Inst]

mkLIE = MkLIE

nullLIE   = MkLIE []
unitLIE x = MkLIE [x]

unMkLIE :: LIE -> [Inst]
unMkLIE (MkLIE insts) = insts

plusLIE :: LIE -> LIE -> LIE
plusLIE (MkLIE lie1) (MkLIE lie2)
  = MkLIE (lie1 ++ lie2)
\end{code}