[project @ 1996-01-18 16:33:17 by partain]
[ghc-hetmet.git] / ghc / compiler / abstractSyn / AbsSynFuns.lhs
1 %
2 % (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
3 %
4 \section[AbsSynFuns]{Abstract syntax: help functions}
5
6 \begin{code}
7 #include "HsVersions.h"
8
9 module AbsSynFuns (
10         collectTopLevelBinders,
11         collectBinders, collectTypedBinders,
12         collectMonoBinders,
13         collectMonoBindersAndLocs,
14         collectPatBinders,
15         collectQualBinders,
16         collectTypedPatBinders,
17 #ifdef DPH
18         collectParQualBinders,
19 #endif {- Data Parallel Haskell -}
20         cmpInstanceTypes,
21         extractMonoTyNames,
22 {-OLD:-}getMentionedVars, -- MENTIONED
23         getNonPrelOuterTyCon,
24         mkDictApp,
25         mkDictLam,
26         mkTyApp,
27         mkTyLam,
28
29         PreludeNameFun(..)
30     ) where
31
32 IMPORT_Trace
33
34 import AbsSyn
35
36 import HsTypes          ( cmpMonoType )
37 import Id               ( Id, DictVar(..), DictFun(..) )
38 import Maybes           ( Maybe(..) )
39 import ProtoName        ( ProtoName(..), cmpProtoName )
40 import Rename           ( PreludeNameFun(..) )
41 import Util
42 \end{code}
43
44 %************************************************************************
45 %*                                                                      *
46 \subsection[AbsSynFuns-MonoBinds]{Bindings: @MonoBinds@}
47 %*                                                                      *
48 %************************************************************************
49
50 Get all the binders in some @ProtoNameMonoBinds@, IN THE ORDER OF
51 APPEARANCE; e.g., in:
52 \begin{verbatim}
53 ...
54 where
55   (x, y) = ...
56   f i j  = ...
57   [a, b] = ...
58 \end{verbatim}
59 it should return @[x, y, f, a, b]@ (remember, order important).
60
61 \begin{code}
62 collectTopLevelBinders :: Binds name (InPat name) -> [name]
63 collectTopLevelBinders EmptyBinds     = []
64 collectTopLevelBinders (SingleBind b) = collectBinders b
65 collectTopLevelBinders (BindWith b _) = collectBinders b
66 collectTopLevelBinders (ThenBinds b1 b2) 
67  = (collectTopLevelBinders b1) ++ (collectTopLevelBinders b2)
68
69 collectBinders :: Bind name (InPat name) -> [name]
70 collectBinders EmptyBind              = []
71 collectBinders (NonRecBind monobinds) = collectMonoBinders monobinds
72 collectBinders (RecBind monobinds)    = collectMonoBinders monobinds
73
74 collectTypedBinders :: TypecheckedBind -> [Id]
75 collectTypedBinders EmptyBind         = []
76 collectTypedBinders (NonRecBind monobinds) = collectTypedMonoBinders monobinds
77 collectTypedBinders (RecBind monobinds)    = collectTypedMonoBinders monobinds
78
79 collectMonoBinders :: MonoBinds name (InPat name) -> [name]
80 collectMonoBinders EmptyMonoBinds                    = []
81 collectMonoBinders (PatMonoBind pat grhss_w_binds _) = collectPatBinders pat
82 collectMonoBinders (FunMonoBind f matches _)         = [f]
83 collectMonoBinders (VarMonoBind v expr)              = error "collectMonoBinders"
84 collectMonoBinders (AndMonoBinds bs1 bs2)
85  = (collectMonoBinders bs1) ++ (collectMonoBinders bs2)
86
87 collectTypedMonoBinders :: TypecheckedMonoBinds -> [Id]
88 collectTypedMonoBinders EmptyMonoBinds                    = []
89 collectTypedMonoBinders (PatMonoBind pat grhss_w_binds _) = collectTypedPatBinders pat
90 collectTypedMonoBinders (FunMonoBind f matches _)         = [f]
91 collectTypedMonoBinders (VarMonoBind v expr)              = [v]
92 collectTypedMonoBinders (AndMonoBinds bs1 bs2)
93  = (collectTypedMonoBinders bs1) ++ (collectTypedMonoBinders bs2)
94
95 -- We'd like the binders -- and where they came from --
96 -- so we can make new ones with equally-useful origin info.
97
98 collectMonoBindersAndLocs
99         :: MonoBinds name (InPat name) -> [(name, SrcLoc)]
100
101 collectMonoBindersAndLocs EmptyMonoBinds = []
102
103 collectMonoBindersAndLocs (AndMonoBinds bs1 bs2)
104   = collectMonoBindersAndLocs bs1 ++ collectMonoBindersAndLocs bs2
105
106 collectMonoBindersAndLocs (PatMonoBind pat grhss_w_binds locn) 
107   = collectPatBinders pat `zip` repeat locn
108
109 collectMonoBindersAndLocs (FunMonoBind f matches locn) = [(f, locn)]
110
111 collectMonoBindersAndLocs (VarMonoBind v expr)
112   = trace "collectMonoBindersAndLocs:VarMonoBind" []
113         -- ToDo: this is dubious, i.e., wrong, but harmless?
114 \end{code}
115
116 %************************************************************************
117 %*                                                                      *
118 \subsection[AbsSynFuns-Expr]{Help functions: @Expr@}
119 %*                                                                      *
120 %************************************************************************
121
122 And some little help functions that remove redundant redundancy:
123 \begin{code}
124 mkTyApp :: TypecheckedExpr -> [UniType] -> TypecheckedExpr
125 mkTyApp expr []  = expr
126 mkTyApp expr tys = TyApp expr tys
127
128 mkDictApp :: TypecheckedExpr -> [DictVar] -> TypecheckedExpr
129 mkDictApp expr []         = expr
130 mkDictApp expr dict_vars = DictApp expr dict_vars
131
132 mkTyLam :: [TyVar] -> TypecheckedExpr -> TypecheckedExpr
133 mkTyLam []     expr = expr
134 mkTyLam tyvars expr = TyLam tyvars expr
135
136 mkDictLam :: [DictVar] -> TypecheckedExpr -> TypecheckedExpr
137 mkDictLam [] expr = expr
138 mkDictLam dicts expr = DictLam dicts expr
139 \end{code}
140
141 %************************************************************************
142 %*                                                                      *
143 \subsection[AbsSynFuns-Qual]{Help functions: @Quals@}
144 %*                                                                      *
145 %************************************************************************
146
147 \begin{code}
148 #ifdef DPH
149 collectParQualBinders :: RenamedParQuals -> [Name]
150 collectParQualBinders (AndParQuals q1 q2) 
151    = collectParQualBinders q1 ++ collectParQualBinders q2
152
153 collectParQualBinders (DrawnGenIn pats pat expr) 
154    = concat ((map collectPatBinders pats)++[collectPatBinders pat])
155
156 collectParQualBinders (IndexGen exprs pat expr) 
157    = (collectPatBinders pat)
158
159 collectParQualBinders (ParFilter expr) = []
160 #endif {- Data Parallel HAskell -}
161 \end{code}
162
163 %************************************************************************
164 %*                                                                      *
165 \subsection[AbsSynFuns-ParQuals]{Help functions: @ParQuals@}
166 %*                                                                      *
167 %************************************************************************
168
169 \begin{code}
170 collectQualBinders :: [RenamedQual] -> [Name]
171
172 collectQualBinders quals
173   = concat (map collect quals)
174   where
175     collect (GeneratorQual pat expr) = collectPatBinders pat
176     collect (FilterQual expr) = []
177 \end{code}
178
179 %************************************************************************
180 %*                                                                      *
181 \subsection[AbsSynFuns-pats]{Help functions: patterns}
182 %*                                                                      *
183 %************************************************************************
184
185 With un-parameterised patterns, we have to have ``duplicate'' copies
186 of one or two functions:
187 \begin{code}
188 collectPatBinders :: InPat a -> [a]
189 collectPatBinders (VarPatIn var)            = [var]
190 collectPatBinders (LazyPatIn pat)    = collectPatBinders pat
191 collectPatBinders (AsPatIn a pat)    = a : (collectPatBinders pat)
192 collectPatBinders (ConPatIn c pats)  = concat (map collectPatBinders pats)
193 collectPatBinders (ConOpPatIn p1 c p2)= (collectPatBinders p1) ++ (collectPatBinders p2)
194 collectPatBinders (ListPatIn pats)   = concat (map collectPatBinders pats)
195 collectPatBinders (TuplePatIn pats)  = concat (map collectPatBinders pats)
196 collectPatBinders (NPlusKPatIn n _)  = [n]
197 #ifdef DPH
198 collectPatBinders (ProcessorPatIn pats pat)
199    = concat (map collectPatBinders pats) ++ (collectPatBinders pat)
200 #endif
201 collectPatBinders any_other_pat     = [ {-no binders-} ]
202 \end{code}
203
204 Nota bene: DsBinds relies on the fact that at least for simple
205 tuple patterns @collectTypedPatBinders@ returns the binders in 
206 the same order as they appear in the tuple.
207
208 \begin{code}
209 collectTypedPatBinders :: TypecheckedPat -> [Id]
210 collectTypedPatBinders (VarPat var)         = [var]
211 collectTypedPatBinders (LazyPat pat)        = collectTypedPatBinders pat
212 collectTypedPatBinders (AsPat a pat)        = a : (collectTypedPatBinders pat)
213 collectTypedPatBinders (ConPat _ _ pats)    = concat (map collectTypedPatBinders pats)
214 collectTypedPatBinders (ConOpPat p1 _ p2 _) = (collectTypedPatBinders p1) ++ (collectTypedPatBinders p2)
215 collectTypedPatBinders (ListPat t pats)    = concat (map collectTypedPatBinders pats)
216 collectTypedPatBinders (TuplePat pats)      = concat (map collectTypedPatBinders pats)
217 collectTypedPatBinders (NPlusKPat n _ _ _ _ _) = [n]
218 #ifdef DPH
219 collectTypedPatBinders (ProcessorPat pats _ pat) 
220   = (concat (map collectTypedPatBinders pats)) ++ 
221     (collectTypedPatBinders pat)
222 #endif {- Data Parallel Haskell -}
223 collectTypedPatBinders any_other_pat        = [ {-no binders-} ]
224 \end{code}
225
226 %************************************************************************
227 %*                                                                      *
228 \subsection[AbsSynFuns-MonoType]{Help functions: @MonoType@}
229 %*                                                                      *
230 %************************************************************************
231
232 Get the type variable names from a @MonoType@.  Don't use class @Eq@
233 because @ProtoNames@ aren't in it.
234
235 \begin{code}
236 extractMonoTyNames :: (name -> name -> Bool) -> MonoType name -> [name]
237
238 extractMonoTyNames eq monotype
239   = get monotype []
240   where
241     get (MonoTyVar name) acc | name `is_elem` acc = acc
242                                | otherwise            = name : acc
243     get (MonoTyCon con tys) acc = foldr get acc tys
244     get (ListMonoTy ty)     acc = get ty acc
245     get (FunMonoTy ty1 ty2) acc = get ty1 (get ty2 acc)
246     get (TupleMonoTy tys)   acc
247       = foldr get_poly acc tys
248       where
249         get_poly (UnoverloadedTy ty)    acc = get ty acc
250         get_poly (ForAllTy _ ty)        acc = get ty acc
251         get_poly (OverloadedTy ctxt ty) acc = panic "extractMonoTyNames"
252     get (MonoDict _ ty)     acc = get ty acc
253     get (MonoTyVarTemplate _) acc = acc
254 #ifdef DPH
255     get (MonoTyProc tys ty) acc = foldr get (get ty acc) tys
256     get (MonoTyPod  ty)     acc = get ty acc
257 #endif {- Data Parallel Haskell -}
258
259     is_elem n []     = False
260     is_elem n (x:xs) = n `eq` x || n `is_elem` xs
261 \end{code}
262
263 @cmpInstanceTypes@ compares two @MonoType@s which are being used as
264 ``instance types.''  This is used when comparing as-yet-unrenamed
265 instance decls to eliminate duplicates.  We allow things (e.g.,
266 overlapping instances) which standard Haskell doesn't, so we must
267 cater for that.  Generally speaking, the instance-type
268 ``shape''-checker in @tcInstDecl@ will catch any mischief later on.
269
270 All we do is call @cmpMonoType@, passing it a tyvar-comparing function
271 that always claims that tyvars are ``equal;'' the result is that we
272 end up comparing the non-tyvar-ish structure of the two types.
273
274 \begin{code}
275 cmpInstanceTypes :: ProtoNameMonoType -> ProtoNameMonoType -> TAG_
276
277 cmpInstanceTypes ty1 ty2
278   = cmpMonoType funny_cmp ty1 ty2
279   where
280     funny_cmp :: ProtoName -> ProtoName -> TAG_
281
282     {- The only case we are really trying to catch
283        is when both types are tyvars: which are both
284        "Unk"s and names that start w/ a lower-case letter! (Whew.)
285     -}
286     funny_cmp (Unk u1) (Unk u2)
287       | isLower s1 && isLower s2 = EQ_
288       where
289         s1 = _HEAD_ u1
290         s2 = _HEAD_ u2
291
292     funny_cmp x y = cmpProtoName x y -- otherwise completely normal
293 \end{code}
294
295 @getNonPrelOuterTyCon@ is a yukky function required when deciding
296 whether to import an instance decl.  If the class name or type
297 constructor are ``wanted'' then we should import it, otherwise not.
298 But the built-in core constructors for lists, tuples and arrows are
299 never ``wanted'' in this sense.  @getNonPrelOuterTyCon@ catches just a
300 user-defined tycon and returns it.
301
302 \begin{code}
303 getNonPrelOuterTyCon :: ProtoNameMonoType -> Maybe ProtoName
304
305 getNonPrelOuterTyCon (MonoTyCon con _)   = Just con
306 getNonPrelOuterTyCon _                   = Nothing
307 \end{code}
308
309 %************************************************************************
310 %*                                                                      *
311 \subsection[AbsSynFuns-mentioned-vars]{Collect mentioned variables}
312 %*                                                                      *
313 %************************************************************************
314
315 This is just a {\em hack} whichs collects, from a module body, all the
316 variables that are ``mentioned,'' either as top-level binders or as
317 free variables.  We can then use this list when walking over
318 interfaces, using it to avoid imported variables that are patently of
319 no interest.
320
321 We have to be careful to look out for \tr{M..} constructs in the
322 export list; if so, the game is up (and we must so report).
323
324 \begin{code}
325 {- OLD:MENTIONED-}
326 getMentionedVars :: PreludeNameFun      -- a prelude-name lookup function, so
327                                         -- we can avoid recording prelude things
328                                         -- as "mentioned"
329                  -> [IE]{-exports-}     -- All the bits of the module body to 
330                  -> [ProtoNameFixityDecl]-- look in for "mentioned" vars.
331                  -> [ProtoNameClassDecl]
332                  -> [ProtoNameInstDecl]
333                  -> ProtoNameBinds
334
335                  -> (Bool,              -- True <=> M.. construct in exports
336                      [FAST_STRING])     -- list of vars "mentioned" in the module body
337
338 getMentionedVars val_nf exports fixes class_decls inst_decls binds
339   = case (mention_IE exports) of { (module_dotdot_seen, export_mentioned) ->
340     (module_dotdot_seen,
341      concat [export_mentioned,
342              mention_Fixity            fixes,
343              mention_ClassDecls val_nf class_decls,
344              mention_InstDecls  val_nf inst_decls,
345              mention_Binds      val_nf True{-top-level-} binds])
346     }
347 \end{code}
348
349 \begin{code}
350 mention_IE :: [IE] -> (Bool, [FAST_STRING])
351
352 mention_IE exps
353   = foldr men (False, []) exps
354   where
355     men (IEVar str) (dotdot_seen, so_far) = (dotdot_seen, str : so_far)
356     men (IEModuleContents _)  (_, so_far) = (True, so_far)
357     men other_ie              acc         = acc
358 \end{code}
359
360 \begin{code}
361 mention_Fixity :: [ProtoNameFixityDecl] -> [FAST_STRING]
362
363 mention_Fixity fixity_decls = []
364     -- ToDo: if we ever do something proper with fixity declarations,
365     -- this might need to do something.
366 \end{code}
367
368 \begin{code}
369 mention_ClassDecls :: PreludeNameFun -> [ProtoNameClassDecl] -> [FAST_STRING]
370
371 mention_ClassDecls val_nf [] = []
372 mention_ClassDecls val_nf (ClassDecl _ _ _ _ binds _ _ : rest)
373   = mention_MonoBinds val_nf True{-toplev-} binds
374     ++ mention_ClassDecls val_nf rest
375 \end{code}
376
377 \begin{code}
378 mention_InstDecls :: PreludeNameFun -> [ProtoNameInstDecl] -> [FAST_STRING]
379
380 mention_InstDecls val_nf [] = []
381 mention_InstDecls val_nf (InstDecl _ _ _ binds _ _ _ _ _ _ : rest)
382   = mention_MonoBinds val_nf True{-toplev-} binds
383     ++ mention_InstDecls val_nf rest
384 \end{code}
385
386 \begin{code}
387 mention_Binds :: PreludeNameFun -> Bool -> ProtoNameBinds -> [FAST_STRING]
388
389 mention_Binds val_nf toplev EmptyBinds = []
390 mention_Binds val_nf toplev (ThenBinds a b)
391   = mention_Binds val_nf toplev a ++ mention_Binds val_nf toplev b
392 mention_Binds val_nf toplev (SingleBind a) = mention_Bind val_nf toplev a
393 mention_Binds val_nf toplev (BindWith a _) = mention_Bind val_nf toplev a
394 \end{code}
395
396 \begin{code}
397 mention_Bind :: PreludeNameFun -> Bool -> ProtoNameBind -> [FAST_STRING]
398
399 mention_Bind val_nf toplev EmptyBind        = []
400 mention_Bind val_nf toplev (NonRecBind a)   = mention_MonoBinds val_nf toplev a
401 mention_Bind val_nf toplev (RecBind a)      = mention_MonoBinds val_nf toplev a
402 \end{code}
403
404 \begin{code}
405 mention_MonoBinds :: PreludeNameFun -> Bool -> ProtoNameMonoBinds -> [FAST_STRING]
406
407 mention_MonoBinds val_nf toplev EmptyMonoBinds = []
408 mention_MonoBinds val_nf toplev (AndMonoBinds a b)
409   = mention_MonoBinds val_nf toplev a ++ mention_MonoBinds val_nf toplev b
410 mention_MonoBinds val_nf toplev (PatMonoBind p gb _)
411   = let
412         rest = mention_GRHSsAndBinds val_nf gb
413     in
414     if toplev
415     then (map stringify (collectPatBinders p)) ++ rest
416     else rest
417
418 mention_MonoBinds val_nf toplev (FunMonoBind v ms _)
419   = let
420         rest = concat (map (mention_Match val_nf) ms)
421     in
422     if toplev then (stringify v) : rest else rest
423
424 stringify :: ProtoName -> FAST_STRING
425 stringify (Unk s) = s
426 \end{code}
427
428 \begin{code}
429 mention_Match :: PreludeNameFun -> ProtoNameMatch -> [FAST_STRING]
430
431 mention_Match val_nf (PatMatch _ m) = mention_Match val_nf m
432 mention_Match val_nf (GRHSMatch gb) = mention_GRHSsAndBinds val_nf gb
433 \end{code}
434
435 \begin{code}
436 mention_GRHSsAndBinds :: PreludeNameFun -> ProtoNameGRHSsAndBinds -> [FAST_STRING]
437
438 mention_GRHSsAndBinds val_nf (GRHSsAndBindsIn gs bs)
439   = mention_GRHSs val_nf gs ++ mention_Binds val_nf False bs
440 \end{code}
441
442 \begin{code}
443 mention_GRHSs :: PreludeNameFun -> [ProtoNameGRHS] -> [FAST_STRING]
444
445 mention_GRHSs val_nf grhss
446   = concat (map mention_grhs grhss)
447   where
448     mention_grhs (OtherwiseGRHS e _) = mention_Expr val_nf [] e
449     mention_grhs (GRHS g e _)
450       = mention_Expr val_nf [] g  ++ mention_Expr val_nf [] e
451 \end{code}
452
453 \begin{code}
454 mention_Expr :: PreludeNameFun -> [FAST_STRING] -> ProtoNameExpr -> [FAST_STRING]
455
456 mention_Expr val_nf acc (Var v)
457   = case v of
458       Unk str | _LENGTH_ str >= 3
459         -> case (val_nf str) of
460              Nothing -> str : acc
461              Just _  -> acc
462       other -> acc
463
464 mention_Expr val_nf acc (Lit _) = acc
465 mention_Expr val_nf acc (Lam m) = acc ++ (mention_Match val_nf m)
466 mention_Expr val_nf acc (App a b) = mention_Expr val_nf (mention_Expr val_nf acc a) b
467 mention_Expr val_nf acc (OpApp a b c) = mention_Expr val_nf (mention_Expr val_nf (mention_Expr val_nf acc a) b) c
468 mention_Expr val_nf acc (SectionL a b) = mention_Expr val_nf (mention_Expr val_nf acc a) b
469 mention_Expr val_nf acc (SectionR a b) = mention_Expr val_nf (mention_Expr val_nf acc a) b
470 mention_Expr val_nf acc (CCall _ es _ _ _) = mention_Exprs val_nf acc es
471 mention_Expr val_nf acc (SCC _ e) = mention_Expr val_nf acc e
472 mention_Expr val_nf acc (Case e ms) = mention_Expr val_nf acc e ++ concat (map (mention_Match val_nf) ms)
473 mention_Expr val_nf acc (ListComp e q) = mention_Expr val_nf acc e ++ mention_Quals val_nf q
474 mention_Expr val_nf acc (Let b e) = (mention_Expr val_nf acc e) ++ (mention_Binds val_nf False{-not toplev-} b)
475 mention_Expr val_nf acc (ExplicitList es)  = mention_Exprs val_nf acc es
476 mention_Expr val_nf acc (ExplicitTuple es) = mention_Exprs val_nf acc es
477 mention_Expr val_nf acc (ExprWithTySig e _) = mention_Expr val_nf acc e
478 mention_Expr val_nf acc (If b t e) = mention_Expr val_nf (mention_Expr val_nf (mention_Expr val_nf acc b) t) e
479 mention_Expr val_nf acc (ArithSeqIn s) = mention_ArithSeq val_nf acc s
480 #ifdef DPH
481 mention_Expr val_nf acc (ParallelZF e q) = (mention_Expr val_nf acc e) ++ 
482                                            (mention_ParQuals val_nf q)
483 mention_Expr val_nf acc (ExplicitPodIn es) = mention_Exprs val_nf acc es
484 mention_Expr val_nf acc (ExplicitProcessor es e) = mention_Expr val_nf (mention_Exprs val_nf acc es) e
485 #endif {- Data Parallel Haskell -}
486 \end{code}
487
488 \begin{code}
489 mention_Exprs :: PreludeNameFun -> [FAST_STRING] -> [ProtoNameExpr] -> [FAST_STRING]
490
491 mention_Exprs val_nf acc []     = acc
492 mention_Exprs val_nf acc (e:es) = mention_Exprs val_nf (mention_Expr val_nf acc e) es
493 \end{code}
494
495 \begin{code}
496 mention_ArithSeq :: PreludeNameFun -> [FAST_STRING] -> ProtoNameArithSeqInfo -> [FAST_STRING]
497
498 mention_ArithSeq val_nf acc (From       e1)
499   = mention_Expr val_nf acc e1
500 mention_ArithSeq val_nf acc (FromThen   e1 e2)
501   = mention_Expr val_nf (mention_Expr val_nf acc e1) e2
502 mention_ArithSeq val_nf acc (FromTo     e1 e2)
503   = mention_Expr val_nf (mention_Expr val_nf acc e1) e2
504 mention_ArithSeq val_nf acc (FromThenTo e1 e2 e3)
505   = mention_Expr val_nf (mention_Expr val_nf (mention_Expr val_nf acc e1) e2) e3
506 \end{code}
507
508 \begin{code}
509 mention_Quals :: PreludeNameFun -> [ProtoNameQual] -> [FAST_STRING]
510
511 mention_Quals val_nf quals
512   = concat (map mention quals)
513   where
514     mention (GeneratorQual _ e) = mention_Expr val_nf [] e
515     mention (FilterQual e)      = mention_Expr val_nf [] e
516 \end{code}
517
518 \begin{code}
519 #ifdef DPH
520 mention_ParQuals :: PreludeNameFun -> ProtoNameParQuals -> [FAST_STRING]
521 mention_ParQuals val_nf (ParFilter e)      = mention_Expr val_nf [] e
522 mention_ParQuals val_nf (DrawnGenIn _ _ e) = mention_Expr val_nf [] e
523 mention_ParQuals val_nf (AndParQuals a b)  = mention_ParQuals val_nf a ++ 
524                                              mention_ParQuals val_nf b
525 mention_ParQuals val_nf (IndexGen es _ e)  = mention_Exprs val_nf [] es 
526                                              ++ mention_Expr val_nf [] e
527 #endif {- Data Parallel Haskell -}
528
529 {- END OLD:MENTIONED -}
530 \end{code}