Ticket #2762: ImproveDefArity.Initial.darcs_patch

File ImproveDefArity.Initial.darcs_patch, 58.9 KB (added by batterseapower, 11 years ago)

Arity analysis whipped together on 29th November

Line 
1Sat Nov 29 22:57:14 GMT 2008  Max Bolingbroke <batterseapower@hotmail.com>
2  * Initial version of arity definition-site analysis
3
4New patches:
5
6[Initial version of arity definition-site analysis
7Max Bolingbroke <batterseapower@hotmail.com>**20081129225714] {
8hunk ./compiler/ghc.cabal.in 334
9+        ImproveDefArity
10hunk ./compiler/main/DynFlags.hs 110
11+   | Opt_D_dump_arity_iterations
12hunk ./compiler/main/DynFlags.hs 254
13+   | Opt_ImproveDefArity
14hunk ./compiler/main/DynFlags.hs 816
15+    , ([1,2],   Opt_ImproveDefArity)
16hunk ./compiler/main/DynFlags.hs 912
17+  | CoreDoImproveDefArity
18hunk ./compiler/main/DynFlags.hs 980
19+    imprv_df_arty = dopt Opt_ImproveDefArity dflags
20hunk ./compiler/main/DynFlags.hs 1058
21+        runWhen imprv_df_arty CoreDoImproveDefArity,
22+
23hunk ./compiler/main/DynFlags.hs 1287
24+  , Flag "ddump-arity-iterations"  (setDumpFlag Opt_D_dump_arity_iterations)
25+         Supported
26addfile ./compiler/simplCore/ImproveDefArity.lhs
27hunk ./compiler/simplCore/ImproveDefArity.lhs 1
28-
29+%
30+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
31+%
32+
33+\begin{code}
34+module ImproveDefArity (
35+       improveDefArity
36+    ) where
37+
38+#include "HsVersions.h"
39+
40+import Id
41+import IdInfo
42+import Literal
43+import PrimOp
44+import CoreSyn
45+import CoreUtils
46+import VarEnv
47+import DynFlags
48+import BasicTypes
49+
50+import UniqSupply
51+import Outputable
52+import FastString
53+import MonadUtils
54+import Maybes
55+import Util
56+
57+import Data.List
58+\end{code}
59+
60+%************************************************************************
61+%*                                                                     *
62+\subsection{Improvement of definition-site arity}
63+%*                                                                     *
64+%************************************************************************
65+
66+  The game plan is to take functions like this one:
67+
68+f = \d. let f' = f d
69+        in \y. ... f' ...
70+
71+  And give back ones like this:
72+
73+f = \d. \eta. (let f' = f d
74+               in \y. ... f' ...) eta
75+
76+  The simplifier will then mess with this so that we get:
77+
78+f = \d. \y. ... f' ...
79+
80+  This is much better because it removes the spurious "work" being done by the
81+  partial application in f'. This can remove some space leaks (see #2762).
82
83+  The key thing our pass has to discover before it performs the transformation
84+  is whether any of the things between the two lambdas does real work. TODO
85+  flesh out what this means :-)
86+
87+
88+  Note [Mutual recursion]
89
90+  TODO FILL THIS OUT
91+
92+
93+  Note [Infinite arities]
94
95+  It is entirely possible for a binder to be tagged with a SuperArity of Infinite
96+  even after fixed point convergence of the entire program. An example is the binding:
97
98+f = f
99+
100+  In this case, we shouldn't bother applying eta expansion to the binding.
101+
102+\begin{code}
103+improveDefArity :: DynFlags -> UniqSupply -> [CoreBind] -> [CoreBind]
104+improveDefArity dflags us = fst . initUs us . mapM etaBind . snd . mapAccumL idaTopBind (initialEnv dflags) . map initBind
105+
106+idaTopBind :: ArityEnv -> AritiedBind -> (ArityEnv, AritiedBind)
107+idaTopBind env bind = (env', bind')
108+  where (_, bind', env') = idaBind env bind
109+\end{code}
110+
111+%************************************************************************
112+%*                                                                     *
113+\subsection{Step 0: what is SuperArity?}
114+%*                                                                     *
115+%************************************************************************
116+
117+\begin{code}
118+-- A lambda is one-shot if pushing work inside the lambda does not lose sharing
119+type OneShotness = Bool
120+
121+-- TODO: we can surely improve this in the future, but let's try this for now
122+data SuperArity = Infinite  -- Something which you can apply as much as you like to and still do no work (e.g. error)
123+                | Lambda OneShotness SuperArity -- Something with a finite arity greater than 0. The flag records whether sharing will be lost if you push stuff inside the lambda
124+                | Expensive -- Something with an effective arity of 0 that really /is/ expensive
125+                | Cheap     -- Something with an effective arity of 0 that is still cheap (e.g. a saturated, cheap, primop)
126+                | Trivial   -- Something with an effective arity of 0 that we can duplicate with abandon (e.g. a variable)
127+                deriving (Eq) -- TODO: do we need to make Expensive == Cheap == Trivial to ensure convergence of the fixed point?
128+                              -- TODO: does Infinite == Lambda y Infinite?
129+
130+mkLambdas :: Int -> SuperArity -> SuperArity
131+mkLambdas 0 sa = sa
132+mkLambdas n sa = Lambda False (mkLambdas (n - 1) sa)
133+
134+isCheap :: SuperArity -> Bool
135+isCheap Expensive = False
136+isCheap _         = True
137+
138+{-
139+isTrivial :: SuperArity -> Bool
140+isTrivial Trivial = True
141+isTrivial _       = False
142+-}
143+
144+oneShotPrefix_maybe :: SuperArity -> Maybe SuperArity
145+oneShotPrefix_maybe (Lambda True sa) = Just $ Lambda True (oneShotPrefix_maybe sa `orElse` Expensive)
146+oneShotPrefix_maybe _                = Nothing -- Nb. in particular it is wrong to treat Infinite as being one shot
147+
148+joinArity :: SuperArity -> SuperArity -> SuperArity
149+joinArity Infinite        (Lambda os2 a2) = Lambda os2 (joinArity Infinite a2)
150+joinArity Infinite        Trivial         = Cheap
151+joinArity Infinite        a2              = a2 -- Infinite, Expensive, Cheap
152+joinArity (Lambda os1 a1) (Lambda os2 a2) = Lambda (os1 && os2) (joinArity a1 a2)
153+joinArity (Lambda _   _ ) Expensive       = Expensive
154+joinArity (Lambda _   _ ) Cheap           = Cheap
155+joinArity (Lambda _   _ ) Trivial         = Cheap
156+joinArity Expensive       _               = Expensive -- Infinite, Lambda, Expensive, Cheap, Trivial
157+joinArity Cheap           Cheap           = Cheap
158+joinArity Cheap           Trivial         = Cheap
159+joinArity Trivial         Trivial         = Trivial
160+joinArity a1              a2              = joinArity a2 a1
161+
162+concatArities :: [SuperArity] -> SuperArity
163+concatArities []  = panic "concatArities: at least one arity expected!"
164+concatArities sas = foldl1' joinArity sas
165+
166+instance Outputable SuperArity where
167+    ppr Infinite       = ptext (sLit "Infinite")
168+    ppr (Lambda os sa) = (if os then ptext (sLit "One-Shot-Lambda") else ptext (sLit "Lambda")) <> ptext (sLit " -> ") <> ppr sa
169+    ppr Expensive      = ptext (sLit "Expensive")
170+    ppr Cheap          = ptext (sLit "Cheap")
171+    ppr Trivial        = ptext (sLit "Trivial")
172+
173+type AritiedBndr = TaggedBndr SuperArity
174+type AritiedExpr = TaggedExpr SuperArity
175+type AritiedBind = TaggedBind SuperArity
176+type AritiedAlt = TaggedAlt SuperArity
177+\end{code}
178+
179+%************************************************************************
180+%*                                                                     *
181+\subsection{Step 1: annotate all binders with an initial SuperArity}
182+%*                                                                     *
183+%************************************************************************
184+
185+\begin{code}
186+initBndr :: CoreBndr -> AritiedBndr
187+initBndr = flip TB Infinite
188+
189+initBind :: CoreBind -> AritiedBind
190+initBind (NonRec b e) = NonRec (initBndr b) (initExpr e)
191+initBind (Rec bes)    = Rec [(initBndr b, initExpr e) | (b, e) <- bes]
192+
193+initExpr :: CoreExpr -> AritiedExpr
194+initExpr expr = case expr of
195+    Var v            -> Var v
196+    Lit l            -> Lit l
197+    App e1 e2        -> App (initExpr e1) (initExpr e2)
198+    Lam b e          -> Lam (initBndr b) (initExpr e)
199+    Let bind e       -> Let (initBind bind) (initExpr e)
200+    Case e b ty alts -> Case (initExpr e) (initBndr b) ty (map initAlt alts)
201+    Cast e co        -> Cast (initExpr e) co
202+    Note no e        -> Note no (initExpr e)
203+    Type ty          -> Type ty
204+
205+initAlt :: CoreAlt -> AritiedAlt
206+initAlt (con, bs, e) = (con, map initBndr bs, initExpr e)
207+\end{code}
208+
209+%************************************************************************
210+%*                                                                     *
211+\subsection{Step 2: compute arity fixed point}
212+%*                                                                     *
213+%************************************************************************
214+
215+\begin{code}
216+changeTag :: AritiedBndr -> SuperArity -> AritiedBndr
217+changeTag (TB b _) sa' = TB b sa' -- TODO: add check here for arity increasing?
218+
219+idaBind :: ArityEnv -> AritiedBind -> (SuperArity, AritiedBind, ArityEnv)
220+idaBind env (NonRec b e) = (a, bind', env')
221+  where
222+    (a, e') = idaExpr' env e
223+    b' = changeTag b a
224+    env' = extendArityEnv env b'
225+    bind' = NonRec b' e'
226+idaBind env (Rec initial_bes) = go 0 initial_bes
227+  where
228+    go n bes
229+      | no_change = pprTraceIterations env True n bs (concatArities as', Rec bes', env')
230+      | otherwise = pprTraceIterations env False n bs $ go (n + 1) bes'
231+      where
232+        (bs, es) = unzip bes
233+       
234+        env' = extendArityEnvList env bs
235+        (as', es') = unzip $ map (idaExpr' env') es
236+       
237+        bs' = zipWith changeTag bs as'
238+        bes' = bs' `zip` es'
239+        no_change = and (zipWith (==) (map tagOf bs) as')
240+
241+-- This instrumented version of idaExpr' is used purely when debugging the Core pass
242+idaExpr' :: ArityEnv -> AritiedExpr -> (SuperArity, AritiedExpr)
243+idaExpr' env expr
244+  | False     = pprTrace "idaExpr" (ppr arity $$ ppr expr') (arity, expr')
245+  | otherwise = (arity, expr')
246+  where (arity, expr') = idaExpr env expr
247+
248+idaExpr :: ArityEnv -> AritiedExpr -> (SuperArity, AritiedExpr)
249+idaExpr env expr@(Var v)
250+  | Just arity <- lookupIdArity env v
251+  = (arity, expr)
252+  | not (isIdVar v)
253+  = (Trivial, expr)
254+  | isBottomingId v
255+  = (Infinite, expr)
256+  | otherwise
257+  = case globalIdDetails v of
258+        RecordSelId {}  -> (Lambda False Expensive, expr) --
259+        ClassOpId _     -> (Lambda False Expensive, expr) -- These two always have a single argument, and we know nothing about the result
260+        PrimOpId op     -> let (_, _, _, arity, _) = primOpSig op
261+                           in (mkLambdas arity (if primOpIsCheap op then Cheap else Expensive), expr) -- TODO: is this an improvement on exprIsCheap?
262+        _ | idArity v == 0 -> (Cheap, expr) -- Call-by-need takes care of sharing the work done on this variable
263+          | otherwise      -> (mkLambdas (idArity v) Expensive, expr) -- DataConWorkIds / normal vars. TODO: not quite like existing exprIsCheap (that requires trivial args)
264+idaExpr _env expr@(Lit l)
265+  | litIsTrivial l
266+  = (Trivial, expr)
267+  | otherwise
268+  = (Cheap, expr)
269+idaExpr env (App e1 e2)
270+  | not (isValArg e2)
271+  = (a1, expr')
272+  | otherwise
273+  = case a1 of
274+        Infinite       -> (Infinite, expr')
275+        Lambda _ a1'
276+          | isCheap a2 -> (a1', expr')
277+          | otherwise  -> (Expensive, expr')
278+        _              -> (Expensive, expr') -- Expensive, Cheap, Trivial
279+  where
280+    (a1, e1') = idaExpr' env e1
281+    (a2, e2') = idaExpr' env e2
282+    expr' = App e1' e2'
283+idaExpr env (Lam ab@(TB b _) e)
284+  | not (isIdVar b)
285+  = (a, expr')
286+  | otherwise
287+  = (Lambda (isOneShotBndr b) a, expr')
288+  where
289+    (a, e') = idaExpr' env e
290+    expr' = Lam ab e'
291+idaExpr env (Let bind e)
292+  | isCheap binda
293+  = (a, expr')
294+  | Just a' <- oneShotPrefix_maybe a
295+  = (a', expr')
296+  | otherwise
297+  = (Expensive, expr')
298+  where
299+    (binda, bind', env') = idaBind env bind
300+    (a, e') = idaExpr' env' e
301+    expr' = Let bind' e'
302+idaExpr env (Case e b ty alts)
303+  | isCheap ea
304+  = (altsa, expr')
305+  | Just altsa' <- oneShotPrefix_maybe altsa
306+  = (altsa', expr')
307+  | otherwise
308+  = (Expensive, expr')
309+  where
310+    (ea, e') = idaExpr' env e
311+    b' = changeTag b ea
312+    env' = extendArityEnv env b'
313+    (altsa, alts') = onLeft concatArities $ unzip $ map (idaAlt env') alts
314+    expr' = Case e' b' ty alts'
315+idaExpr env (Cast e co)
316+  = (a, expr')
317+  where
318+    (a, e') = idaExpr' env e
319+    expr' = Cast e' co
320+idaExpr env (Note no e)
321+  = (a, expr')
322+  where
323+    (a, e') = idaExpr' env e
324+    expr' = Note no e'
325+idaExpr _env expr@(Type _)
326+  = (Trivial, expr)
327+
328+idaAlt :: ArityEnv -> AritiedAlt -> (SuperArity, AritiedAlt)
329+idaAlt env (con, bs, e) = (a, (con, bs, e'))
330+  where
331+    (a, e') = idaExpr' env e
332+\end{code}
333+
334+%************************************************************************
335+%*                                                                     *
336+\subsection{Step 3: apply the computed arity fixed point}
337+%*                                                                     *
338+%************************************************************************
339+
340+\begin{code}
341+superEtaExpand :: AritiedBndr -> AritiedExpr -> UniqSM CoreExpr
342+superEtaExpand (TB b sa) e = do
343+    e' <- etaExpr e
344+    case superArityEtaAmount sa of
345+        Nothing -> return e'
346+        Just arity -> do
347+            uniques <- getUniquesM
348+            return $ etaExpand arity uniques e' (idType b)
349+
350+superArityEtaAmount :: SuperArity -> Maybe Arity
351+superArityEtaAmount (Lambda _ sa) = Just $ 1 + (superArityEtaAmount sa `orElse` 0)
352+superArityEtaAmount _             = Nothing -- Infinite, Cheap, Trivial and Expensive. See Note [Infinite arities]
353+
354+etaBind :: AritiedBind -> UniqSM CoreBind
355+etaBind (NonRec b e) = do
356+    e' <- superEtaExpand b e
357+    return $ NonRec (unTagBndr b) e'
358+etaBind (Rec bes) = do
359+    es' <- mapM (uncurry superEtaExpand) bes
360+    return $ Rec $ map (unTagBndr . fst) bes `zip` es'
361+
362+etaExpr :: AritiedExpr -> UniqSM CoreExpr
363+etaExpr expr = case expr of
364+    Var v            -> return $ Var v
365+    Lit l            -> return $ Lit l
366+    App e1 e2        -> App <$> etaExpr e1 <*> etaExpr e2
367+    Lam b e          -> Lam (unTagBndr b) <$> etaExpr e -- Can't eta-expand lambda-bound things
368+    Let bind e       -> Let <$> etaBind bind <*> etaExpr e
369+    Case e b ty alts -> Case <$> superEtaExpand b e <*> pure (unTagBndr b) <*> pure ty <*> mapM etaAlt alts
370+    Cast e co        -> Cast <$> etaExpr e <*> pure co
371+    Note no e        -> Note no <$> etaExpr e
372+    Type ty          -> return $ Type ty
373+
374+etaAlt :: AritiedAlt -> UniqSM CoreAlt
375+etaAlt (con, bs, e) = do
376+    e' <- etaExpr e
377+    return (con, map unTagBndr bs, e') -- Can't eta-expand alt-bound things
378+\end{code}
379+
380+%************************************************************************
381+%*                                                                     *
382+\subsection{Arity environment nitty-gritty}
383+%*                                                                     *
384+%************************************************************************
385+
386+\begin{code}
387+data ArityEnv = ArityEnv {
388+    ae_dflags :: DynFlags,
389+    ae_fv_arities :: VarEnv SuperArity
390+  }
391+
392+initialEnv :: DynFlags -> ArityEnv
393+initialEnv dflags = ArityEnv {
394+    ae_dflags = dflags,
395+    ae_fv_arities = emptyVarEnv
396+  }
397+
398+extendArityEnv :: ArityEnv -> AritiedBndr -> ArityEnv
399+extendArityEnv env (TB b sa) = env { ae_fv_arities = extendVarEnv (ae_fv_arities env) b sa }
400+
401+extendArityEnvList :: ArityEnv -> [AritiedBndr] -> ArityEnv
402+extendArityEnvList env bs = foldl' extendArityEnv env bs
403+
404+lookupIdArity :: ArityEnv -> Id -> Maybe SuperArity
405+lookupIdArity env v | isIdVar v = lookupVarEnv (ae_fv_arities env) v
406+                    | otherwise = panic "lookupIdArity: can't determine the arity of type variables"
407+
408+pprTraceIterations :: ArityEnv -> Bool -> Int -> [AritiedBndr] -> a -> a
409+pprTraceIterations env converged iteration_number bs rest
410+  | dopt Opt_D_dump_arity_iterations (ae_dflags env)
411+  = pprTrace ("Arity iteration " ++ show iteration_number) final_doc rest
412+  | otherwise
413+  = rest
414+  where
415+    final_doc = arities_doc $$ (if converged then ptext (sLit "Converged!") else ptext (sLit "No convergence yet, let's try again.."))
416+    arities_doc = vcat [ppr b <> colon <+> ppr a | (TB b a) <- bs]
417+\end{code}
418hunk ./compiler/simplCore/SimplCore.lhs 63
419+import ImproveDefArity  ( improveDefArity )
420hunk ./compiler/simplCore/SimplCore.lhs 195
421+doCorePass CoreDoImproveDefArity     = {-# SCC "ImproveDefArity" #-}
422+                                       describePass "Improve definition-site arity" Opt_D_verbose_core2core $
423+                                       doPassDU improveDefArity
424+
425hunk ./compiler/utils/Util.lhs 40
426-        sortLe, sortWith, on,
427+        sortLe, sortWith, on, Down(..),
428hunk ./compiler/utils/Util.lhs 534
429+newtype Down a = Down a
430+    deriving (Eq)
431+
432+instance Ord a => Ord (Down a) where
433+    compare (Down l) (Down r) = case l `compare` r of
434+        LT -> GT
435+        EQ -> EQ
436+        GT -> LT
437}
438
439Context:
440
441[Refactor binder tagging in terms to reuse some annotation infrastructure
442Max Bolingbroke <batterseapower@hotmail.com>**20081124003308]
443[Refactor Core annotations to be composable using open-recursive data types and functorality
444Max Bolingbroke <batterseapower@hotmail.com>**20081104101703]
445[Fix desugaring of record update (fixes Trac #2735)
446simonpj@microsoft.com**20081103110819]
447[Refuse to register packages with unversioned dependencies; trac #1837
448Ian Lynagh <igloo@earth.li>**20081031181746]
449[We now require GHC 6.6 to build the HEAD (and thus 6.12)
450Ian Lynagh <igloo@earth.li>**20081031171506]
451[:set prompt now understand Haskell String syntax; trace #2652
452Ian Lynagh <igloo@earth.li>**20081031145227]
453[Comments only
454simonpj@microsoft.com**20081031140236]
455[Quickfix for warning.
456Thomas Schilling <nominolo@googlemail.com>**20081031113125]
457[Export typeclasses for accessing compiler results.
458Thomas Schilling <nominolo@googlemail.com>**20081028182310
459 
460 MERGE TO 6.10.
461]
462[Minor refactoring.
463Thomas Schilling <nominolo@googlemail.com>**20081028182202]
464[Include record fields in tags.
465Thomas Schilling <nominolo@googlemail.com>**20081028180538]
466[Fix imports
467simonpj@microsoft.com**20081031092306]
468[Improve error reporting for non-rigid GADT matches
469simonpj@microsoft.com**20081030143947
470 
471 Following suggestions from users, this patch improves the error message
472 when a GADT match needs a rigid type:
473 
474  tcfail172.hs:19:10:
475      GADT pattern match in non-rigid context for `Nil'
476 -      Solution: add a type signature
477 +      Probable solution: add a type signature for `is_normal'
478      In the pattern: Nil
479      In the definition of `is_normal': is_normal Nil = True
480 
481 Now GHC tries to tell you what to give a type signature *for*.
482 Thanks to Daniel Gorin and others for the suggestions.
483 
484]
485[Add (a) CoreM monad, (b) new Annotations feature
486simonpj@microsoft.com**20081030125108
487 
488 This patch, written by Max Bolingbroke,  does two things
489 
490 1.  It adds a new CoreM monad (defined in simplCore/CoreMonad),
491     which is used as the top-level monad for all the Core-to-Core
492     transformations (starting at SimplCore).  It supports
493        * I/O (for debug printing)
494        * Unique supply
495        * Statistics gathering
496        * Access to the HscEnv, RuleBase, Annotations, Module
497     The patch therefore refactors the top "skin" of every Core-to-Core
498     pass, but does not change their functionality.
499 
500 2.  It adds a completely new facility to GHC: Core "annotations".
501     The idea is that you can say
502        {#- ANN foo (Just "Hello") #-}
503     which adds the annotation (Just "Hello") to the top level function
504     foo.  These annotations can be looked up in any Core-to-Core pass,
505     and are persisted into interface files.  (Hence a Core-to-Core pass
506     can also query the annotations of imported things.)  Furthermore,
507     a Core-to-Core pass can add new annotations (eg strictness info)
508     of its own, which can be queried by importing modules.
509 
510 The design of the annotation system is somewhat in flux.  It's
511 designed to work with the (upcoming) dynamic plug-ins mechanism,
512 but is meanwhile independently useful.
513 
514 Do not merge to 6.10! 
515 
516]
517[Fix Trac #2674: in TH reject empty case expressions and function definitions
518simonpj@microsoft.com**20081030094528]
519[Change naming conventions for compiler-generated dictionaries and type functions
520simonpj@microsoft.com**20081029140858
521 
522 Up to now, the data constructor dictionary for class C as been called
523 ":DC". But there is no reason for the colon to be at the front; indeed
524 it confuses the (simple-minded) pretty-printer for types.  So this
525 patch changes it to be "D:C".  This makes Core a lot easier to read.
526 Having a colon in the middle ensures that it can't clash with a user-written
527 data type.
528 
529 Similarly I changed
530 
531   T:C     Data type corresponding a class dictionary (was :TC)
532   D:C     Data constructor for class dictionary (was :DC)
533 
534   NTCo:T   Coercion mapping from a newtype T to its representation type
535                (was :CoT)
536 
537   TFCo:R   Coercion mapping from a data family to its respresentation type R
538                (was :CoFR)
539 
540   Rn:T     The n'th respresentation data type for a data type T
541                (was :RnT)
542 
543 
544 Do not merge to 6.10.
545 
546 HEADS-UP: you'll need to recompile libraries from scratch. 
547 
548 ROMAN: you could do the same for OccName.mkVectTyConOcc etc, if you wanted.
549 
550 
551]
552[Fix tcrun031: yet more tidying up in TcDeriv
553simonpj@microsoft.com**20081029130155]
554[Add Outputable instance for CoercionI
555simonpj@microsoft.com**20081029130114]
556[Fix Trac #2720: inlining and casts
557simonpj@microsoft.com**20081028140828
558 
559 The issue here is what happens when we have
560 
561        (f |> co) x
562 
563 where f is itself marked INLINE.  We want callSiteInline to "see"
564 the fact that the function is applied, and hence have some incentive
565 to inline.  I've done this by extending CoreUnfold.CallCtxt with
566 ValAppCtxt.  I think that should catch this case without messing up
567 any of the others.
568 
569]
570[Clarify documentatoin
571simonpj@microsoft.com**20081028133009]
572[Update library version numbers in the release notes
573Ian Lynagh <igloo@earth.li>**20081023144018]
574[various updates to the release notes
575Simon Marlow <marlowsd@gmail.com>**20081007151647]
576[Add library release notes
577Ian Lynagh <igloo@earth.li>**20080920155722]
578[Add release notes for the compiler
579Ian Lynagh <igloo@earth.li>**20080920114857]
580[Doc fix
581Ian Lynagh <igloo@earth.li>**20081028150534]
582[Rename some variables in docs
583Ian Lynagh <igloo@earth.li>**20081028150447]
584[Fix typos
585Ian Lynagh <igloo@earth.li>**20081028144655]
586[Mostly-fix Trac #2595: updates for existentials
587simonpj@microsoft.com**20081028115427
588 
589 Ganesh wanted to update records that involve existentials.  That
590 seems reasonable to me, and this patch covers existentials, GADTs,
591 and data type families.
592 
593 The restriction is that
594   The types of the updated fields may mention only the
595   universally-quantified type variables of the data constructor
596 
597 This doesn't allow everything in #2595 (it allows 'g' but not 'f' in
598 the ticket), but it gets a lot closer.
599 
600 Lots of the new lines are comments!
601 
602]
603[Fix Trac #2723: keep track of record field names in the renamer
604simonpj@microsoft.com**20081028110445
605 
606 The idea here is that with -XNamedFieldPuns and -XRecordWildCards we don't
607 want to report shadowing errors for
608        let fld = <blah> in C { .. }
609 But to suppress such shadowing errors, the renamer needs to know that
610 'fld' *is* a record selector.  Hence the new NameSet in
611 TcRnFypes.RecFieldEnv
612 
613]
614[Remove dead code
615simonpj@microsoft.com**20081028074639]
616[Fix Trac #2713: refactor and tidy up renaming of fixity decls
617simonpj@microsoft.com**20081027222738
618 
619 In fixing #2713, this patch also eliminates two almost-unused
620 functions from RnEnv (lookupBndr and lookupBndr_maybe).  The
621 net lines of code is prety much unchanged, but more of them
622 are comments!
623 
624]
625[Fix Trac #2701: make deriving check better for unlifted args
626simonpj@microsoft.com**20081025171211
627 
628 Getting the automatic deriving mechanism to work really smoothly
629 is surprisingly hard.  I keep finding myself in TcDeriv!
630 
631 Anyway, this is a nice clean fix to Trac #2701.
632 
633]
634[Use pdflatex rather than latex for building
635Ian Lynagh <igloo@earth.li>**20081024112400
636 The Windows builder is having problems running ps2pdf, so this works
637 aroudn the problem.
638]
639[Remove an unmatched } in core.tex
640Ian Lynagh <igloo@earth.li>**20081024111750]
641[Add a usepackage{url}
642Ian Lynagh <igloo@earth.li>**20081024111458]
643[Update ANNOUNCE
644Ian Lynagh <igloo@earth.li>**20081022164423]
645[Fix a bug in the new scheduler
646Simon Marlow <marlowsd@gmail.com>**20081023155017
647 If the current thread blocks, we should yield the Capability
648 immediately, because the thread and hence possibly the current Task
649 are now owned by someone else.  This worked in the old scheduler, but
650 we moved where the yield happens in the new scheduler which broke it.
651]
652[add an assertion
653Simon Marlow <marlowsd@gmail.com>**20081023154551]
654[fix a warning
655Simon Marlow <marlowsd@gmail.com>**20081023082213]
656[traverse the spark pools only once during GC rather than twice
657Simon Marlow <marlowsd@gmail.com>**20081022115233]
658[Refactoring and reorganisation of the scheduler
659Simon Marlow <marlowsd@gmail.com>**20081022092744
660 
661 Change the way we look for work in the scheduler.  Previously,
662 checking to see whether there was anything to do was a
663 non-side-effecting operation, but this has changed now that we do
664 work-stealing.  This lead to a refactoring of the inner loop of the
665 scheduler.
666 
667 Also, lots of cleanup in the new work-stealing code, but no functional
668 changes.
669 
670 One new statistic is added to the +RTS -s output:
671 
672   SPARKS: 1430 (2 converted, 1427 pruned)
673 
674 lets you know something about the use of `par` in the program.
675]
676[Work stealing for sparks
677berthold@mathematik.uni-marburg.de**20080915132846
678 
679    Spark stealing support for PARALLEL_HASKELL and THREADED_RTS versions of the RTS.
680   
681   Spark pools are per capability, separately allocated and held in the Capability
682   structure. The implementation uses Double-Ended Queues (deque) and cas-protected
683   access.
684   
685   The write end of the queue (position bottom) can only be used with
686   mutual exclusion, i.e. by exactly one caller at a time.
687   Multiple readers can steal()/findSpark() from the read end
688   (position top), and are synchronised without a lock, based on a cas
689   of the top position. One reader wins, the others return NULL for a
690   failure.
691   
692   Work stealing is called when Capabilities find no other work (inside yieldCapability),
693   and tries all capabilities 0..n-1 twice, unless a theft succeeds.
694   
695   Inside schedulePushWork, all considered cap.s (those which were idle and could
696   be grabbed) are woken up. Future versions should wake up capabilities immediately when
697   putting a new spark in the local pool, from newSpark().
698 
699 Patch has been re-recorded due to conflicting bugfixes in the sparks.c, also fixing a
700 (strange) conflict in the scheduler.
701 
702]
703[include an elapsed time table
704Simon Marlow <marlowsd@gmail.com>**20081023080648]
705[generate a valid summary for older GHC versions too
706Simon Marlow <marlowsd@gmail.com>**20081023080629]
707[Fix Trac #2714 (a minor wibble)
708simonpj@microsoft.com**20081022145138
709 
710 In boxy_match (which is a pure function used by preSubType) we can
711 encounter TyVars not just TcTyVars; this patch takes account of that.
712 
713]
714[Reject programs with superclass equalities for now
715Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20081021131721
716 - The current implementation of type families cannot properly deal
717   with superclass equalities.  Instead of making a half-hearted attempt at
718   supporting them, which mostly ends in cryptic error message, rejecting
719   right away with an appropriate message.
720 
721   MERGE TO 6.10
722]
723[Fix doc syntax
724Ian Lynagh <igloo@earth.li>**20081021183317]
725[Don't put the README file in the Windows installer; fixes trac #2698
726Ian Lynagh <igloo@earth.li>**20081021162543
727 The README file talks about getting and building the sources, which
728 doesn't make sense for the installer.
729]
730[Comments and parens only
731simonpj@microsoft.com**20081021151401]
732[Do proper cloning in worker/wrapper splitting
733simonpj@microsoft.com**20081021143156
734 
735 See Note [Freshen type variables] in WwLib.  We need to clone type
736 variables when building a worker/wrapper split, else we simply get
737 bogus code, admittedly in rather obscure situations.  I can't quite
738 remember what program showed this up, unfortunately, but there
739 definitely *was* one!  (You get a Lint error.)
740 
741]
742[Don't float an expression wrapped in a cast
743simonpj@microsoft.com**20081021143019
744 
745 There is no point in floating out an expression wrapped in a coercion;
746 If we do we'll transform 
747        lvl = e |> co [_$_]
748 to     
749        lvl' = e; lvl = lvl' |> co
750 and then inline lvl.  Better just to float out the payload (e).
751 
752]
753[Fix Trac #2668, and refactor TcDeriv
754simonpj@microsoft.com**20081021142922
755 
756 TcDeriv deals with both standalone and ordinary 'deriving';
757 and with both data types and 'newtype deriving'.  The result
758 is really rather compilcated and ad hoc.  Ryan discovered
759 #2668; this patch fixes that bug, and makes the internal interfces
760 #more uniform.  Specifically, the business of knocking off
761 type arguments from the instance type until it matches the kind of the
762 class, is now done by derivTyData, not mkNewTypeEqn, because the
763 latter is shared with standalone derriving, whree the trimmed
764 type application is what the user wrote.
765 
766]
767[Spelling error in comment
768simonpj@microsoft.com**20081019233511]
769[White space only
770simonpj@microsoft.com**20081019233352]
771[Comments to explain strict overlap checking for type family instances
772simonpj@microsoft.com**20081019184208]
773[Allow type families to use GADT syntax (and be GADTs)
774simonpj@microsoft.com**20080923140535
775 
776 We've always intended to allow you to use GADT syntax for
777 data families:
778        data instance T [a] where
779          T1 :: a -> T [a]
780 and indeed to allow data instances to *be* GADTs
781        data intsance T [a] where
782          T1 :: Int -> T [Int]
783          T2 :: a -> b -> T [(a,b)]
784 
785 This patch fixes the renamer and type checker to allow this.
786       
787]
788[Improve crash message from applyTys and applyTypeToArgs
789simonpj@microsoft.com**20080923135419]
790[Wibble to ungrammatical error message
791simonpj@microsoft.com**20080920232256]
792[Comments only: replace ":=:" by "~" (notation for equality predicates)
793simonpj@microsoft.com**20080920232024]
794[FIX #2693
795Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20081021120107
796 - As long as the first reduceContext in tcSimplifyRestricted potentially
797   performs improvement, we need to zonk again before the second reduceContext.
798   It would be better to prevent the improvement in the first place, but given
799   the current situation zonking is definitely the right thing to do.
800 
801   MERGE TO 6.10
802]
803[Restore the terminal attributes even if ghci does not exit normally.
804Judah Jacobson <judah.jacobson@gmail.com>**20081020164109]
805[FIX #2688
806Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20081021044213
807 - Change in TcSimplify.reduceContext:
808 
809      We do *not* go around for new extra_eqs.  Morally, we should,
810      but we can't without risking non-termination (see #2688).  By
811      not going around, we miss some legal programs mixing FDs and
812      TFs, but we never claimed to support such programs in the
813      current implementation anyway.
814 
815   MERGE TO 6.10
816]
817[Move documentation within 80 column boundary.
818Thomas Schilling <nominolo@googlemail.com>**20081014134016]
819[Improve haddock documentation for 'GHC.topSortModuleGraph'.
820Thomas Schilling <nominolo@googlemail.com>**20081014133833]
821[Improve haddock documentation for HsExpr module.
822Thomas Schilling <nominolo@googlemail.com>**20081014133740]
823[Improve Haddock-markup for HsDecls module.
824Thomas Schilling <nominolo@googlemail.com>**20081014133556]
825[Run Haddock with compacting GC and show RTS statistics.
826Thomas Schilling <nominolo@googlemail.com>**20081020111410]
827[FIX (partially) #2703: bug in stack overflow handling when inside block
828Simon Marlow <marlowsd@gmail.com>**20081020121103
829 As a result of a previous ticket (#767) we disabled the generation of
830 StackOverflow exceptions when inside a Control.Exception.block, on the
831 grounds that StackOverflow is like an asynchronous exception.  Instead
832 we just increase the stack size.  However, the stack size calculation
833 was wrong, and ended up not increasing the size of the stack, with the
834 result that the runtime just kept re-allocating the stack and filling
835 up memory.
836]
837[Re-export Located(..) and related functions
838Simon Marlow <marlowsd@gmail.com>**20081020102422
839 So that clients don't need to import SrcLoc
840]
841[whitespace fix
842Simon Marlow <marlowsd@gmail.com>**20081020101241]
843[FIX #2691: Manually reset the terminal to its initial settings; works around a bug in libedit.
844Judah Jacobson <judah.jacobson@gmail.com>**20081016024838]
845[Eliminate duplicate flags in the tab completion of ghci's :set command.
846Judah Jacobson <judah.jacobson@gmail.com>**20081016015721]
847[Add dph haddock docs to the doc index
848Ian Lynagh <igloo@earth.li>**20081019133208]
849[Clean the bootstrapping extensible-exceptions package
850Ian Lynagh <igloo@earth.li>**20081017195942]
851[Fix trac #2687
852Ian Lynagh <igloo@earth.li>**20081015163412
853 OtherPunctuation, ConnectorPunctuation and DashPunctuation are now
854 treated as symbols, rather than merely graphic characters.
855]
856[Fix trac #2680; avoid quadratic behaviour from (++)
857Ian Lynagh <igloo@earth.li>**20081015163235]
858[Fix the build when the bootstrapping compiler has a newer Cabal than us
859Ian Lynagh <igloo@earth.li>**20081015144023
860 We need to forcibly use the in-tree Cabal, or we get version mismatch errors
861]
862[Fix the name of prologue.txt when making bindists
863Ian Lynagh <igloo@earth.li>**20081014114714]
864[Comments only
865simonpj@microsoft.com**20081015084501]
866[Fix Trac #2497; two separate typos in Lexer.x
867simonpj@microsoft.com**20081015084344
868 
869 The patch to switch on lexing of 'forall' inside a RULES pragma
870 wasn't working.  This fixes it so that it does.
871 
872]
873[Update manual: tidy up instances, say more about type families in instance decls
874simonpj@microsoft.com**20081015080509]
875[Make tags work on Unices, too.
876Thomas Schilling <nominolo@googlemail.com>**20081014211236]
877[Undefine __PIC__ before defining it to work around "multiple definitions of __PIC__" warnings
878Clemens Fruhwirth <clemens@endorphin.org>**20081014143206]
879[Add "dyn" to GhcRTSWays when compiling --enable-shared
880Clemens Fruhwirth <clemens@endorphin.org>**20081014125123]
881[Fill out the ghc package's cabal file
882Ian Lynagh <igloo@earth.li>**20081013235817]
883[Patching libffi so it can be built as DLL
884Clemens Fruhwirth <clemens@endorphin.org>**20081014103459
885 
886 libffi-dllize-3.0.6.patch should be pushed upstream
887]
888[Add 'etags' makefile target.
889Thomas Schilling <nominolo@googlemail.com>**20081013170927
890 
891 This only works with stage2 since `ghctags' is built against stage1
892 but not against the bootstrapping compiler.  Also note that all of GHC
893 must typecheck for this target to succeed.  Perhaps we should not
894 overwrite the old TAGS file by default then.
895]
896[Use cabal information to get GHC's flags to `ghctags'.
897Thomas Schilling <nominolo@googlemail.com>**20081013170658
898 
899 By giving the dist-directory to ghctags we can get all the GHC API
900 flags we need in order to load the required modules.  The flag name
901 could perhaps be improved, but apart from that it seems to work well.
902]
903[Version bump for libffi to 3.0.6
904Clemens Fruhwirth <clemens@endorphin.org>**20081014081300]
905[Encode shared/static configuration into stamps to do the right thing when rebuilding
906Clemens Fruhwirth <clemens@endorphin.org>**20081013221530]
907[Add a link to the GHC API docs from the library haddock index
908Ian Lynagh <igloo@earth.li>**20081013195943]
909[Link to the GHC API documentation from the main doc page
910Ian Lynagh <igloo@earth.li>**20081013200927]
911[Whitespace only in docs/index.html
912Ian Lynagh <igloo@earth.li>**20081013200625]
913[Tweak gen_contents_index
914Ian Lynagh <igloo@earth.li>**20081013192548
915 It now works again after it has been installed, as well as while it is
916 in a source tree.
917 After it's been installed it filters out the ghc package, as that
918 currently swamps everything else in the index.
919]
920[Build fixes for DLLized rts
921Clemens Fruhwirth <clemens@endorphin.org>**20081013201608]
922[Do not filter the rts from linked libraries in linkDynLib as Windows does not allow unresolved symbols
923Clemens Fruhwirth <clemens@endorphin.org>**20081013201426]
924[Add HsFFI.o to INSTALL_LIBS
925Clemens Fruhwirth <clemens@endorphin.org>**20081013200945]
926[Rename symbol macros to a consistant naming scheme
927Clemens Fruhwirth <clemens@endorphin.org>**20081013162433]
928[Fix #2685: two Bool arguments to tidyTypeEnv were the wrong way around
929Simon Marlow <marlowsd@gmail.com>**20081013121339
930 So -XTemplateHaskell was behaving like -fomit-interface-file-pragmas,
931 and vice versa.
932]
933[Simplify the "is $bindir in $PATH" test
934Ian Lynagh <igloo@earth.li>**20081011191008]
935[Correct the "is $bindir in $PATH" test
936Ian Lynagh <igloo@earth.li>**20081011191030
937 We were testing neq instead of eq
938]
939[Fix a typo which was causing ghci to quit on commands errors
940pepe <mnislaih@gmail.com>**20081011114720]
941[Drop libm from the linker dependencies for libffi
942Clemens Fruhwirth <clemens@endorphin.org>**20081011074524]
943[Do not generate haddock documentation when running install-docs in libffi
944Clemens Fruhwirth <clemens@endorphin.org>**20081010192318]
945[When waking up thread blocked on TVars, wake oldest first (#2319)
946Josef Svenningsson <josef.svenningsson@gmail.com>**20081010150322
947 StgTVarWatchQueue contains the threads blocked on a TVar in order
948 youngest first. The list has to be traversed backwards to unpark the threads
949 oldest first.
950 
951 This improves the fairness when using STM in some situations.
952]
953[add readTVarIO :: TVar a -> IO a
954Simon Marlow <marlowsd@gmail.com>**20081010131545]
955[fix #2636: throw missing module errors as SourceErrors, not ErrMsg
956Simon Marlow <marlowsd@gmail.com>**20081010131535]
957[atomicModifyIORef: use a local cas() instead of the global lock
958Simon Marlow <simonmar@microsoft.com>**20081008154702
959 This should improve scaling when using atomicModifyIORef
960]
961[Delay building libffi until package.conf is created and fix bindist
962Clemens Fruhwirth <clemens@endorphin.org>**20081010073106]
963[Install a versioned ghc-pkg script; fixes trac #2662
964Ian Lynagh <igloo@earth.li>**20081009164946]
965[Fix bindist creation: Only the main RTS was being put in the bindists
966Ian Lynagh <igloo@earth.li>**20081009163451]
967[pushAtom: add missing case for MachNullAddr (#2589)
968Simon Marlow <marlowsd@gmail.com>**20081009091118]
969[undo incorrect assertion, and fix comments
970Simon Marlow <marlowsd@gmail.com>**20081009085118]
971[remove old GRAN/PARALLEL_HASKELL code
972Simon Marlow <marlowsd@gmail.com>**20081009085051]
973[FIX #2639
974Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20081009132328
975 
976   MERGE TO 6.10
977]
978[Cover PredTy case in Type.tyFamInsts
979Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20081009061435
980 
981   MERGE TO 6.10
982]
983[Drop ghcconfig.h/RtsConfig.h from libffi's package.conf.in
984Clemens Fruhwirth <clemens@endorphin.org>**20081009071342]
985[Don't use sed's -i flag as Solaris doesn't know it in libffi/Makefile
986Clemens Fruhwirth <clemens@endorphin.org>**20081008234455]
987[Don't use /dev/null trick to create empty object files in libffi/Makefile
988Clemens Fruhwirth <clemens@endorphin.org>**20081008232902]
989[Turn libffi into a Haskell package
990Clemens Fruhwirth <clemens@endorphin.org>**20081008170443]
991[Make 'getModSummary' deterministic.
992Thomas Schilling <nominolo@googlemail.com>**20081008144032]
993[Add accessors to 'HsModule' and haddockify it.
994Thomas Schilling <nominolo@googlemail.com>**20081007235656]
995[fix syntax errors in src-dist publish rules
996Simon Marlow <marlowsd@gmail.com>**20081008103432]
997[add comments and an ASSERT_LOCK_HELD()
998Simon Marlow <marlowsd@gmail.com>**20081008112627]
999[Fix #2663: we had a hard-wired capabilities[0]
1000Simon Marlow <marlowsd@gmail.com>**20081008112609
1001 For some unknown reason in schedulePostRunThread() we were always
1002 passing capabilities[0] rather than the current Capability to
1003 throwToSingleThreaded().  This caused all kinds of weird failures and
1004 crashes in STM code when running on multiple processors.
1005]
1006[Fix #1955 for heap profiles generated by +RTS -hT
1007Simon Marlow <marlowsd@gmail.com>**20081003150745]
1008[add a section id for +RTS -hT
1009Simon Marlow <marlowsd@gmail.com>**20081007151007]
1010[update documentation for PostfixOperators
1011Simon Marlow <marlowsd@gmail.com>**20081007150957]
1012[fix markup
1013Simon Marlow <marlowsd@gmail.com>**20081007150943]
1014[Fix bug in DPH docs
1015Roman Leshchinskiy <rl@cse.unsw.edu.au>**20081008101618]
1016[Add short DPH section to users guide
1017Roman Leshchinskiy <rl@cse.unsw.edu.au>**20081008064754
1018 
1019 MERGE TO 6.10
1020]
1021[Users Guide: added type family documentation
1022Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20081008061927
1023 
1024   MERGE TO 6.10
1025]
1026[Track changes to package dph
1027Roman Leshchinskiy <rl@cse.unsw.edu.au>**20081008032859
1028 
1029 MERGE TO 6.10
1030]
1031[Build a profiled GHC API by default if p is in GhcLibWays
1032Ian Lynagh <igloo@earth.li>**20081007152318]
1033[Check whether mk/validate.mk defines anything after validating
1034Ian Lynagh <igloo@earth.li>**20081007144855]
1035[Remove #define _BSD_SOURCE from Stg.h
1036Ian Lynagh <igloo@earth.li>**20081006101959
1037 It's no longer needed, as base no longer #includes it
1038]
1039[Make ghctags compile again.
1040Thomas Schilling <nominolo@googlemail.com>**20081007135705]
1041[Revert AutoLinkPackages change for dynamic libraries. Cabal handles that now.
1042Clemens Fruhwirth <clemens@endorphin.org>**20081007100417]
1043[Change suffix for dyn. linked executables from _real to .dyn
1044Clemens Fruhwirth <clemens@endorphin.org>**20081007100750]
1045[Add accessors to 'Target' fields and haddockify.
1046Thomas Schilling <nominolo@googlemail.com>**20081006222940
1047 
1048 MERGE TO 6.10
1049]
1050[Make 'gblock' and 'gunblock' part of 'ExceptionMonad'.  This way the
1051Thomas Schilling <nominolo@googlemail.com>**20081006222831
1052 default implementations of 'gbracket' and 'gfinally' just work.
1053 
1054 MERGE TO 6.10
1055]
1056[Add Word8 support to vectoriser
1057Roman Leshchinskiy <rl@cse.unsw.edu.au>**20081007004416
1058 
1059 MERGE TO 6.10
1060]
1061[Fix generating OS X installers: Set COMMAND_MODE=unix2003
1062Ian Lynagh <igloo@earth.li>**20081005222715
1063 If we don't specify COMMAND_MODE=unix2003 then xcodebuild defaults
1064 to setting it to legacy, which means that ar builds archives
1065 without a table of contents. That makes the build fail later on.
1066]
1067[We need to set datadir = $(libdir) in bindists
1068Ian Lynagh <igloo@earth.li>**20081005143307
1069 We already do in the normal Makefiles.
1070 
1071 This is because GHC needs package.conf and unlit to be in the same place
1072 (and things like ghc-pkg need to agree on where package.conf is, so we
1073 just set it globally).
1074]
1075[prep-bin-dist-mingw complains if it finds a bad version of windres
1076Ian Lynagh <igloo@earth.li>**20081004175351]
1077[removed Data.Generics.Basics, added Data.Data
1078'Jose Pedro Magalhaes <jpm@cs.uu.nl>'**20081002082808]
1079[Fix a build problem with GHC 6.4.2
1080Ian Lynagh <igloo@earth.li>**20081003195700]
1081[No AutoLinkPackages for dynamic library linking
1082Clemens Fruhwirth <clemens@endorphin.org>**20081003185304]
1083[use ghcError for error in command line
1084Clemens Fruhwirth <clemens@endorphin.org>**20081001125648]
1085[Fix warnings
1086simonpj@microsoft.com**20081003171207]
1087[Always use extensible exceptions in ghc-pkg, rather than using ifdefs
1088Ian Lynagh <igloo@earth.li>**20081003161247]
1089[Use a proper exception for IOEnvFailure, not just a UserError
1090Ian Lynagh <igloo@earth.li>**20081003160129]
1091[Use an extensible-exceptions package when bootstrapping
1092Ian Lynagh <igloo@earth.li>**20081003140216
1093 Ifdefs for whether we had extensible exceptions or not were spreading
1094 through GHC's source, and things would only have got worse for the next
1095 2-3 years, so instead we now use an implementation of extensible
1096 exceptions built on top of the old exception type.
1097]
1098[Expunge ThFake, cure Trac #2632
1099simonpj@microsoft.com**20081003140423
1100 
1101 This patch fixes a dirty hack (the fake ThFake module), which in turn
1102 was causing Trac #2632.
1103 
1104 The new scheme is that the top-level binders in a TH [d| ... |] decl splice
1105 get Internal names.  That breaks a previous invariant that things like
1106 TyCons always have External names, but these TyCons are never long-lived;
1107 they live only long enough to typecheck the TH quotation; the result is
1108 discarded.  So it seems cool.
1109 
1110 Nevertheless -- Template Haskell folk: please test your code.  The testsuite
1111 is OK but it's conceivable that I've broken something in TH.  Let's see.
1112 
1113]
1114[Make a debug check more refined
1115simonpj@microsoft.com**20081003140144]
1116[Add ASSERTs to all calls of nameModule
1117simonpj@microsoft.com**20081003135334
1118 
1119 nameModule fails on an InternalName.  These ASSERTS tell you
1120 which call failed.
1121 
1122]
1123[Let parseModule take a ModSummary like checkAndLoadModule did.
1124Thomas Schilling <nominolo@googlemail.com>**20081002230412
1125 
1126 To get the ModSummary for a ModuleName getModSummary can be used.
1127 It's not called find* or lookup* because it assumes that the module is
1128 in the module graph and throws an exception if it cannot be found.
1129 Overall, I'm not quite sure about the usefulness of this function
1130 since the user has no control about which filetype to grab (hs or
1131 hs-boot).
1132]
1133[Remove some out-of-date entries from .darcs-boring
1134Ian Lynagh <igloo@earth.li>**20081002201519]
1135[TFs: Allow repeated variables in left-hand sides of instances
1136Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20081002134539
1137 
1138   MERGE TO 6.10
1139]
1140[Clean up some comments
1141Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20081002074642
1142 
1143   MERGE TO 6.10
1144]
1145[Make the new binder-swap stuff in OccurAnal work right for GlobalIds
1146simonpj@microsoft.com**20081002133002
1147 
1148 See Note [Binder swap on GlobalId scrutinees].  I hadn't got this
1149 right before, so repeated cases on imported Ids weren't getting optimised.
1150 
1151 
1152]
1153[Minor refactoring only
1154simonpj@microsoft.com**20081002132929]
1155[Comments only
1156simonpj@microsoft.com**20081002132833]
1157[Zap dead-ness info appropriately in SpecConstr
1158simonpj@microsoft.com**20081002132657
1159 
1160 SpecConstr can make pattern binders come alive, so we must remember
1161 to zap their dead-variable annotation.  See extendCaseBndrs.
1162 
1163 (This was triggering a Core Lint failure in DPH.)
1164 
1165]
1166[Suppress invalid Core Lint complaint about lack of constructors
1167simonpj@microsoft.com**20081002132426]
1168[add some more GC roots (fixes conc048, and possibly some others)
1169Simon Marlow <marlowsd@gmail.com>**20081001164427]
1170[Document +RTS -hT
1171Simon Marlow <marlowsd@gmail.com>**20081001163222
1172 We forgot to document this in GHC 6.8
1173]
1174[fix new-qualified-operators link
1175Simon Marlow <marlowsd@gmail.com>**20081001163105]
1176[Proper error message for unsupported pattern signatures
1177Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20081001144339
1178 - Pattern signatures must be identical to the type expected for the pattern;
1179   see Note [Pattern coercions]
1180 - We now signal an appropriate error if an equality coercion would be needed
1181   (instead of just generating Core that doesn't typecheck)
1182 
1183   MERGE TO 6.10
1184]
1185[Prevent excessive inlining with DPH
1186Roman Leshchinskiy <rl@cse.unsw.edu.au>**20081002012055
1187 
1188 This adds a new flag -finline-if-enough-args which disables inlining for
1189 partially applied functions. It is automatically set by -Odph. This is a
1190 temporary hack and should remain undocumented.
1191 
1192 MERGE TO 6.10
1193 
1194]
1195[On Windows, check that we have a good version of windres when configuring
1196Ian Lynagh <igloo@earth.li>**20081001171133]
1197[Call $(PERL) rather than perl when making the manpage
1198Ian Lynagh <igloo@earth.li>**20080930155054]
1199[don't install the installPackage program
1200Ian Lynagh <igloo@earth.li>**20080930145714]
1201[Fix #2637: conc032(threaded2) failure
1202Simon Marlow <marlowsd@gmail.com>**20081001135549
1203 There was a race condition whereby a thread doing throwTo could be
1204 blocked on a thread that had finished, and the GC would detect this
1205 as a deadlock rather than raising the pending exception.  We can't
1206 close the race, but we can make the right thing happen when the GC
1207 runs later.
1208]
1209[Remove outdated link to OGI webpage
1210Simon Marlow <marlowsd@gmail.com>**20080930150912]
1211[TFs: Fixed InstContextNorm (and simplification of IPs)
1212Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20081001131303
1213 
1214   MERGE TO 6.10
1215]
1216[TcSimplify.reduceImplication: clean up
1217Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20081001091315
1218 - This cleans up some of the mess in reduceImplication and documents the
1219   precondition on the form of wanted equalities properly.
1220 - I also made the back off test a bit smarter by allowing to back off in the
1221   presence of wanted equalities as long as none of them got solved in the
1222   attempt.  (That should save generating some superfluous bindings.)
1223 
1224   MERGE TO 6.10
1225]
1226[Make sure to zonk the kind of coercion variables
1227Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20081001053243
1228 
1229   MERGE TO 6.10
1230]
1231[Remover PROT_EXEC flag from mmap()
1232Simon Marlow <marlowsd@gmail.com>**20080930141842
1233 Needed for #738 fix
1234]
1235[Fix #2410: carefully generate unique names for CAF CCs
1236Simon Marlow <marlowsd@gmail.com>**20080930141812]
1237[fix #2594: we were erroneously applying masks, as the reporter suggested
1238Simon Marlow <marlowsd@gmail.com>**20080930115611
1239 My guess is that this is left over from when we represented Int8 and
1240 friends as zero-extended rather than sign-extended.  It's amazing it hasn't
1241 been noticed earlier.
1242]
1243[Unconditionalize definition of DYNAMIC_* so that libffi.so/.dll is removed even when BuildSharedLibs is reset to NO
1244Clemens Fruhwirth <clemens@endorphin.org>**20080930085449]
1245[Type families: need to instantiate flexible skolems before other flexibles
1246Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20080930053559
1247 
1248 MERGE TO 6.10
1249]
1250[Fix warnings
1251Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20080929142227]
1252[Type families: consider subst rules both way
1253Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20080929141040
1254 - applySubstFam, applySubstVarVar & applySubstVarFam need to return their
1255   second argument -to be put into the todo list- if the rule would be
1256   applicable if the equalities would be supplied in the opposite order.
1257 
1258 MERGE TO 6.10
1259]
1260[Clean up a bit and improve an error message
1261pepe**20080926211429]
1262[Don't capture error calls in tryUser
1263pepe**20080926204836
1264 
1265 A previous patch slightly changed the semantics of tryUser.
1266 This patch restores the original behaviour
1267 (as expected in :print)
1268 
1269]
1270[tweaks to this section of the docs
1271Simon Marlow <simonmar@microsoft.com>**20080927141834]
1272[Add -outputdir flag (#2295)
1273Simon Marlow <simonmar@microsoft.com>**20080927141822]
1274[oops, forgot to add -XNewQualifiedOperators to the flags table
1275Simon Marlow <simonmar@microsoft.com>**20080923140449]
1276[Fix making OS X installers from source tarballs
1277Ian Lynagh <igloo@earth.li>**20080927150507
1278 I'm not sure why it works in the HEAD, but when making an installer
1279 from the 6.10.1 beta configure hangs when doing the CHECK_HIST_ERRORS
1280 test (during rl_initialize, I believe). Giving make /dev/null as stdin
1281 fixes it.
1282]
1283[Make the matching of the filename ghc.exe case insensitive, fixes bug #2603
1284Neil Mitchell <ndmitchell@gmail.com>**20080916160311]
1285[Fix #2411: missing case for CATCH_STM_FRAME in raiseAsync()
1286Simon Marlow <simonmar@microsoft.com>**20080926232806]
1287[Fix parsing of -ignore-package flag.
1288Bertram Felgenhauer <int-e@gmx.de>**20080925053820]
1289[Add an example of how to use SCCs to the user guide
1290Ian Lynagh <igloo@earth.li>**20080926203832]
1291[Add some description of the +RTS -t/-s/-S output
1292Ian Lynagh <igloo@earth.li>**20080926200203]
1293[Remove a redundant options pragma
1294Ian Lynagh <igloo@earth.li>**20080926152731]
1295[Split ShowVersion etc off into a different type to DoInteractive etc
1296Ian Lynagh <igloo@earth.li>**20080926140539
1297 This fixes trac #1348 (ghci --help gave ghc's help), and also tidies
1298 things up a bit. Things would be even tidier if the usage.txt files were
1299 put into a .hs file, so that ShowUsage wouldn't need to be able to find
1300 the libdir.
1301]
1302[Pass SRC_HC_OPTS to GHC when building GHC's Main.hs
1303Ian Lynagh <igloo@earth.li>**20080926131609]
1304[Improve runghc docs; fixes trac #2477
1305Ian Lynagh <igloo@earth.li>**20080926124425]
1306[Type families: fixes in flattening & finalisation
1307Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20080925225324
1308 * Finalisation didn't do the right thing for equalities x ~ y, where
1309   x was instantiated, but not zonked and y flexible (need to do y := x)
1310 * During flattening we weren't careful enough when turning wanteds
1311   intermediates into locals
1312 
1313 Both bugs showed up in a small example of SPJ:
1314 
1315   linear :: HasTrie (Basis v) => (Basis v, v)
1316   linear =  basisValue
1317 
1318   class HasTrie a where
1319 
1320   type family Basis u :: *
1321 
1322   basisValue :: (Basis v,v)
1323   basisValue = error "urk"
1324 
1325]
1326[Fix the behaviour of flags like --help and --version; fixes trac #2620
1327Ian Lynagh <igloo@earth.li>**20080925165618
1328 They should override other mode flags, not conflict with them
1329]
1330[Follow the integer package changes
1331Ian Lynagh <igloo@earth.li>**20080925133855]
1332[Type families: fix decomposition problem
1333Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20080925084139
1334 * Fixes the problem reported in
1335   <http://www.haskell.org/pipermail/haskell-cafe/2008-July/044911.html>
1336]
1337[Don't exit ghci if :info is called on an undefined identifier.
1338Judah Jacobson <judah.jacobson@gmail.com>**20080924212422]
1339[Fix maintainer-clean
1340Ian Lynagh <igloo@earth.li>**20080924230553]
1341[Use -f when making the runhaskell symlink
1342Ian Lynagh <igloo@earth.li>**20080924124255
1343 Otherwise installation fails if runhaskell already exists.
1344]
1345[Use -perm -100 rather than -perm /a+x when looking for executable files
1346Ian Lynagh <igloo@earth.li>**20080924124137
1347 /a+x doesn't work on some Solaris and OS X machines. Spotted by
1348 Christian Maeder.
1349]
1350[Use $(FIND) rather than find, as the former may be gfind
1351Ian Lynagh <igloo@earth.li>**20080924123323]
1352[Look for gfind as well as find
1353Ian Lynagh <igloo@earth.li>**20080924123046]
1354[In configure, don't call FPTOOLS_HADDOCK
1355Ian Lynagh <igloo@earth.li>**20080924122558
1356 We now use the in-tree haddock, so we don't need to look for it.
1357]
1358[Use $(TAR) rather than tar
1359Ian Lynagh <igloo@earth.li>**20080924121759
1360 Fixes problems on Solaris, where we need to use gtar instead of tar
1361]
1362[Add $(strip) to a Makefile test
1363Ian Lynagh <igloo@earth.li>**20080924120940
1364 Fixes making bindists on solaris. Patch from Christian Maeder.
1365]
1366[Use test -f rather than test -e, for portability (Solaris)
1367Ian Lynagh <igloo@earth.li>**20080924120840]
1368[Remove some dependencies on bootstrapping.conf from libraries/Makefile
1369Ian Lynagh <igloo@earth.li>**20080923205755
1370 They were causing some unnecessary work:
1371 Running make in a built tree reregisters the GHC package in
1372 bootstrapping.conf, and the build system thought that this updated
1373 timestamp meant that the configure stamps were out of date. This is
1374 particularly bad for the libraries with configure scripts, as those
1375 take a while to run.
1376 
1377 The bootstrapping.conf is built in an earlier phase ("make boot") so
1378 one shouldn't rely on the dependencies anyway.
1379]
1380[Bump the version number to 6.11
1381Ian Lynagh <igloo@earth.li>**20080923165613]
1382[Generalise type of 'defaultErrorHandler' so it can be used inside a Ghc session.
1383Thomas Schilling <nominolo@googlemail.com>**20080921085647]
1384[Make "sh -e boot" work
1385Ian Lynagh <igloo@earth.li>**20080921111508]
1386[Use -f rather than -e for portability
1387Ian Lynagh <igloo@earth.li>**20080921111436]
1388[Add some special cases for putting dph in bindists
1389Ian Lynagh <igloo@earth.li>**20080921000406]
1390[Escape a hash in the Makefile (it was breaking source dist creation)
1391Ian Lynagh <igloo@earth.li>**20080920232945]
1392[Disallow package flags in OPTIONS_GHC pragmas (#2499)
1393Simon Marlow <simonmar@microsoft.com>**20080923173904]
1394[#2566: emit a warning for 'ghc -c foo.bar'
1395Simon Marlow <simonmar@microsoft.com>**20080923144956
1396 
1397 $ ghc -c foo.bar
1398 Warning: the following files would be used as linker inputs, but linking is not being done: foo.bar
1399 ghc: no input files
1400 Usage: For basic information, try the `--help' option.
1401]
1402[Fix to new executable allocation code (fixed print002 etc.)
1403Simon Marlow <simonmar@microsoft.com>**20080922210915
1404 The problem here is caused by the fact that info tables include a
1405 relative offset to the string naming the constructor.  Executable
1406 memory now resides at two places in the address space: one for writing
1407 and one for executing.  In the info tables generated by GHCi, we were
1408 calculating the offset relative to the writable instance, rather than
1409 the executable instance, which meant that the GHCi debugger couldn't
1410 find the names for constructors it found in the heap.
1411]
1412[clean sm/Evac_thr.c and sm/Scav_thr.c
1413Simon Marlow <simonmar@microsoft.com>**20080922152827]
1414[add -XNewQualifiedOperators (Haskell' qualified operator syntax)
1415Simon Marlow <simonmar@microsoft.com>**20080922152340]
1416[Fix Trac #2597 (first bug): correct type checking for empty list
1417simonpj@microsoft.com**20080920212010
1418 
1419 The GHC front end never generates (ExplicitList []), but TH can.
1420 This patch makes the typechecker robust to such programs.
1421 
1422]
1423[Fix Trac #2597 (second bug): complain about an empty DoE block
1424simonpj@microsoft.com**20080920211101
1425 
1426 When converting an empty do-block from TH syntax to HsSyn,
1427 complain rather than crashing.
1428 
1429]
1430[Update dependencies
1431Ian Lynagh <igloo@earth.li>**20080920183534]
1432[Fix building with GHC 6.6
1433Ian Lynagh <igloo@earth.li>**20080920162918]
1434[Remove fno-method-sharing from the list of static flags
1435Ian Lynagh <igloo@earth.li>**20080920010635
1436 It is now a dynamic flag
1437]
1438[Tidy up the treatment of dead binders
1439simonpj@microsoft.com**20080920175238
1440 
1441 This patch does a lot of tidying up of the way that dead variables are
1442 handled in Core.  Just the sort of thing to do on an aeroplane.
1443 
1444 * The tricky "binder-swap" optimisation is moved from the Simplifier
1445   to the Occurrence Analyser.  See Note [Binder swap] in OccurAnal.
1446   This is really a nice change.  It should reduce the number of
1447   simplifier iteratoins (slightly perhaps).  And it means that
1448   we can be much less pessimistic about zapping occurrence info
1449   on binders in a case expression. 
1450 
1451 * For example:
1452        case x of y { (a,b) -> e }
1453   Previously, each time around, even if y,a,b were all dead, the
1454   Simplifier would pessimistically zap their OccInfo, so that we
1455   can't see they are dead any more.  As a result virtually no
1456   case expression ended up with dead binders.  This wasn't Bad
1457   in itself, but it always felt wrong.
1458 
1459 * I added a check to CoreLint to check that a dead binder really
1460   isn't used.  That showed up a couple of bugs in CSE. (Only in
1461   this sense -- they didn't really matter.)
1462   
1463 * I've changed the PprCore printer to print "_" for a dead variable.
1464   (Use -dppr-debug to see it again.)  This reduces clutter quite a
1465   bit, and of course it's much more useful with the above change.
1466 
1467 * Another benefit of the binder-swap change is that I could get rid of
1468   the Simplifier hack (working, but hacky) in which the InScopeSet was
1469   used to map a variable to a *different* variable. That allowed me
1470   to remove VarEnv.modifyInScopeSet, and to simplify lookupInScopeSet
1471   so that it doesn't look for a fixpoint.  This fixes no bugs, but
1472   is a useful cleanup.
1473 
1474 * Roman pointed out that Id.mkWildId is jolly dangerous, because
1475   of its fixed unique.  So I've
1476 
1477      - localied it to MkCore, where it is private (not exported)
1478 
1479      - renamed it to 'mkWildBinder' to stress that you should only
1480        use it at binding sites, unless you really know what you are
1481        doing
1482 
1483      - provided a function MkCore.mkWildCase that emodies the most
1484        common use of mkWildId, and use that elsewhere
1485 
1486    So things are much better
1487 
1488 * A knock-on change is that I found a common pattern of localising
1489   a potentially global Id, and made a function for it: Id.localiseId
1490 
1491]
1492[Gix the ghcii script
1493Ian Lynagh <igloo@earth.li>**20080919174651
1494 The ghc executable name doesn't have a version number on Windows, so
1495 don't put one in the script.
1496]
1497[Create runhaskell as well as runghc
1498Ian Lynagh <igloo@earth.li>**20080919153010]
1499[On Linux use libffi for allocating executable memory (fixed #738)
1500Simon Marlow <marlowsd@gmail.com>**20080919134602]
1501[Move the context_switch flag into the Capability
1502Simon Marlow <marlowsd@gmail.com>**20080919102601
1503 Fixes a long-standing bug that could in some cases cause sub-optimal
1504 scheduling behaviour.
1505]
1506[Fix building the extralibs tarball
1507Ian Lynagh <igloo@earth.li>**20080919133555
1508 We now need to dig the appropriate lines out of packages, rather than
1509 just catting libraries/extra-packages, in order to find out what the
1510 extralibs are.
1511]
1512[Install libffi when installing frmo a bindist
1513Ian Lynagh <igloo@earth.li>**20080919130332]
1514[Fix how we put libffi into bindists
1515Ian Lynagh <igloo@earth.li>**20080919125528]
1516[TAG 6.10 branch has been forked
1517Ian Lynagh <igloo@earth.li>**20080919123437]
1518Patch bundle hash:
1519cbedc8c86b9ba4e87f6c5e1a89c4230fa3b8c982