Fixed warnings in ndpFlatten/FlattenInfo
[ghc-hetmet.git] / compiler / ndpFlatten / FlattenInfo.hs
1 --  $Id$
2 --
3 --  Copyright (c) 2002 Manuel M T Chakravarty & Gabriele Keller
4 --
5 --  Information for modules outside of the flattening module collection.
6 --
7 --- DESCRIPTION ---------------------------------------------------------------
8 --
9 --  This module contains information that is needed, and thus imported, by
10 --  modules that are otherwise independent of flattening and may in fact be
11 --  directly or indirectly imported by some of the flattening-related
12 --  modules.  This is to avoid cyclic module dependencies.
13 -- 
14 --- DOCU ----------------------------------------------------------------------
15 --
16 --  Language: Haskell 98
17 --
18 --- TODO ----------------------------------------------------------------------
19 --
20 module FlattenInfo (
21   namesNeededForFlattening
22 ) where
23
24 import StaticFlags (opt_Flatten)
25 import NameSet     (FreeVars, emptyFVs, mkFVs)
26 import PrelNames   (fstName, andName, orName, lengthPName, replicatePName,
27                     mapPName, bpermutePName, bpermuteDftPName, indexOfPName)
28
29
30 -- this is a list of names that need to be available if flattening is
31 -- performed (EXPORTED)
32 --
33 --  * needs to be kept in sync with the names used in Core generation in
34 --   `FlattenMonad' and `NDPCoreUtils'
35 --
36 namesNeededForFlattening :: FreeVars
37 namesNeededForFlattening
38   | not opt_Flatten = emptyFVs          -- none without -fflatten
39   | otherwise
40   = mkFVs [fstName, andName, orName, lengthPName, replicatePName, mapPName,
41            bpermutePName, bpermuteDftPName, indexOfPName]
42     -- stuff from PrelGHC doesn't have to go here