[project @ 1996-01-08 20:28:12 by partain]
[ghc-hetmet.git] / ghc / compiler / envs / LIE.lhs
1 %
2 % (c) The GRASP/AQUA Project, Glasgow University, 1992-1994
3 %
4 \section[LIE]{Id instance environment}
5
6 This is not really an ``environment.''
7
8 \begin{code}
9 #include "HsVersions.h"
10
11 module LIE (
12         LIE,            -- abstract type
13         mkLIE, nullLIE, unitLIE, unMkLIE, plusLIE,
14
15         -- imported things so this module's interface is self-contained
16         Inst
17     ) where
18
19 import Inst             ( Inst )
20 import Outputable
21 import Util
22 \end{code}
23
24 %************************************************************************
25 %*                                                                      *
26 \subsection[LIE-building]{Building LIEs}
27 %*                                                                      *
28 %************************************************************************
29
30 \begin{code}
31 data LIE = MkLIE [Inst]
32
33 mkLIE = MkLIE
34
35 nullLIE   = MkLIE []
36 unitLIE x = MkLIE [x]
37
38 unMkLIE :: LIE -> [Inst]
39 unMkLIE (MkLIE insts) = insts
40
41 plusLIE :: LIE -> LIE -> LIE
42 plusLIE (MkLIE lie1) (MkLIE lie2)
43   = MkLIE (lie1 ++ lie2)
44 \end{code}