Ticket #716: notimer.patch

File notimer.patch, 34.5 KB (added by lennart@…, 8 years ago)

Patch to disable time slicing by specifying a negative slice.

Line 
1
2New patches:
3
4[Use a negative time slice value to indicate that no slicing should occur.
5lennart.augustsson@credit-suisse.com**20060308222724] {
6hunk ./ghc/rts/RtsFlags.c 1033
7-                   if (cst != 0 && cst < CS_MIN_MILLISECS)
8+                   if (cst > 0 && cst < CS_MIN_MILLISECS)
9hunk ./ghc/rts/RtsStartup.c 205
10-    startTimer(TICK_MILLISECS);
11+    if (RtsFlags.ConcFlags.ctxtSwitchTime >= 0)
12+        startTimer(TICK_MILLISECS);
13hunk ./ghc/rts/RtsStartup.c 338
14-    stopTimer();
15+    if (RtsFlags.ConcFlags.ctxtSwitchTime >= 0)
16+        stopTimer();
17}
18
19Context:
20
21[Disable the NCG if GhcUnregisterised=YES
22Simon Marlow <simonmar@microsoft.com>**20060301165341
23 The NCG cannot be used in an unregisterised compiler, so there's no
24 point in including it.
25]
26[Undo patch Simplify-the-IdInfo-before-any-RHSs
27simonpj@microsoft.com**20060301161423
28 
29 Sadly the above patch wasn't right, because it fouls
30 up pre/postInlineUnconditionally.  This patch puts
31 things back as they were functionally, but with slightly
32 tidied-up code.
33 
34]
35[fix parse error
36Simon Marlow <simonmar@microsoft.com>**20060301160701]
37[fix compilation with older GHCs
38Simon Marlow <simonmar@microsoft.com>**20060301140931]
39[update docs w.r.t. dllMain() definition (EXTFUN is no more)
40Simon Marlow <simonmar@microsoft.com>**20060301130736]
41[add comments
42Simon Marlow <simonmar@microsoft.com>**20060301132018]
43[add ':set prompt' command
44Simon Marlow <simonmar@microsoft.com>**20060301131948
45 
46 contributed by Neil Mitchell <ndmitchell@gmail.com>, with docs by me.
47]
48[Add support for Data.Char.generalCategory to libcompat
49Simon Marlow <simonmar@microsoft.com>**20060301113536
50 
51 this is so that the stage1 compiler has proper support for Unicode.
52 Should fix these errors:
53 
54   lexical error in string/character literal at character '\8759'
55 
56 when building the stage2 compiler.
57]
58[takeMVar/putMVar were missing some write barriers when modifying a TSO
59Simon Marlow <simonmar@microsoft.com>**20060228163724
60 
61 This relates to the recent introduction of clean/dirty TSOs, and the
62 consqeuent write barriers required.  We were missing some write
63 barriers in the takeMVar/putMVar family of primops, when performing
64 the take/put directly on another TSO.
65 
66 Fixes #705, and probably some test failures.
67]
68[A better x86_64 register mapping, with more argument registers.
69Simon Marlow <simonmar@microsoft.com>**20060228153640
70 
71 Now that we can handle using C argument registers as global registers,
72 extend the x86_64 register mapping.  We now have 5 integer argument
73 registers, 4 float, and 2 double (all caller-saves).  This results in a
74 reasonable speedup on x86_64.
75]
76[filter the messages generated by gcc
77Simon Marlow <simonmar@microsoft.com>**20060228153134
78 
79 Eliminate things like "warning: call-clobbered register used as global
80 register variable", which is an non-suppressible warning from gcc.
81]
82[Allow C argument regs to be used as global regs (R1, R2, etc.)
83Simon Marlow <simonmar@microsoft.com>**20060228152942
84 
85 The problem here was that we generated C calls with expressions
86 involving R1 etc. as parameters.  When some of the R registers are
87 also C argument registers, both GCC and the native code generator
88 generate incorrect code.  The hacky workaround is to assign
89 problematic arguments to temporaries first; fortunately this works
90 with both GCC and the NCG, but we have to be careful not to undo this
91 with later optimisations (see changes to CmmOpt).
92]
93[pass arguments to unknown function calls in registers
94Simon Marlow <simonmar@microsoft.com>**20060228152524
95 
96 We now have more stg_ap entry points: stg_ap_*_fast, which take
97 arguments in registers according to the platform calling convention.
98 This is faster if the function being called is evaluated and has the
99 right arity, which is the common case (see the eval/apply paper for
100 measurements). 
101 
102 We still need the stg_ap_*_info entry points for stack-based
103 application, such as an overflows when a function is applied to too
104 many argumnets.  The stg_ap_*_fast functions actually just check for
105 an evaluated function, and if they don't find one, push the args on
106 the stack and invoke stg_ap_*_info.  (this might be slightly slower in
107 some cases, but not the common case).
108]
109[fix live register annotations on foreign calls
110Simon Marlow <simonmar@microsoft.com>**20060228151815
111 
112 fix one incorrect case, and made several more accurate
113]
114[       Simplify the IdInfo before any RHSs
115simonpj@microsoft.com**20060228133157
116        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
117 Simplfy (i.e. substitute) the IdInfo of a recursive group of Ids
118 before looking at the RHSs of *any* of them.  That way, the rules
119 are available throughout the letrec, which means we don't have to
120 be careful about function to put first.
121 
122 Before, we just simplified the IdInfo of f before looking at f's RHS,
123 but that's not so good when f and g both have RULES, and both rules
124 mention the other.
125 
126 This change makes things simpler, but shouldn't change performance.
127 
128]
129[Add floating-point symbols to the list
130simonpj@microsoft.com**20060228114502]
131[slightly better dependencies for GenApply.hs
132Simon Marlow <simonmar@microsoft.com>**20060227153828]
133[x86_64: include .type and .size directives in the output, for valgrind
134Simon Marlow <simonmar@microsoft.com>**20060227152822]
135[The initStablePtrTable should be called before ACQUIRE_LOCK(&stable_mutex)
136kr.angelov@gmail.com**20060222202912]
137[support LOCK_DEBUG for Windows
138kr.angelov@gmail.com**20060222201721]
139[mmap() errors on Darwin: use errorBelch/exit instead of barf()
140Simon Marlow <simonmar@microsoft.com>**20060227111103
141 
142 The most likely cause is out-of-memory, not an RTS error.
143]
144[remove empty .SECONDARY target
145Simon Marlow <simonmar@microsoft.com>**20060227105939
146 
147 This works around a problem with recent versions of GNU make that take
148 a long time when all targets are declared intermediate with
149 .SECONDARY.  See
150 
151   https://savannah.gnu.org/bugs/?func=detailitem&item_id=15584
152 
153 for discussion of the GNU make issue.
154]
155[these tables have four columns, not three
156claus.reinke@talk21.com**20060225215945]
157[Remove comment about imports and exports not being in the renamer result.
158Lemmih <lemmih@gmail.com>**20060226120407]
159[NCG: fix mkRegRegMoveInstr for x86-64
160wolfgang.thaller@gmx.net**20060225225920]
161[NCG: Fix Typo in Register Allocator Loop Patch
162wolfgang.thaller@gmx.net**20060225033954
163 
164 Fix previous patch "NCG: Handle loops in register allocator"
165 Of course, I broke it when correcting a style problem just before committing.
166]
167[NCG: Handle loops in register allocator
168wolfgang.thaller@gmx.net**20060225031434
169 
170 Fill in the missing parts in the register allocator so that it can
171 handle loops.
172 
173 *) The register allocator now runs in the UniqSuppy monad, as it needs
174    to be able to generate unique labels for fixup code blocks.
175 
176 *) A few functions have been added to RegAllocInfo:
177        mkRegRegMoveInstr -- generates a good old move instruction
178        mkBranchInstr     -- used to be MachCodeGen.genBranch
179        patchJump         -- Change the destination of a jump
180 
181 *) The register allocator now makes sure that only one spill slot is used
182    for each temporary, even if it is spilled and reloaded several times.
183    This obviates the need for memory-to-memory moves in fixup code.
184 
185 LIMITATIONS:
186 
187 *) The case where the fixup code needs to cyclically permute a group of
188    registers is currently unhandled. This will need more work once we come
189    accross code where this actually happens.
190 
191 *) Register allocation for code with loop is probably very inefficient
192    (both at compile-time and at run-time).
193 
194 *) We still cannot compile the RTS via NCG, for various other reasons.
195 
196]
197[Oops, I got a little trigger happy while trimming package.conf.in.
198Lemmih <lemmih@gmail.com>**20060224223704]
199[Prettify parts of RnNames. No change of functionality.
200Lemmih <lemmih@gmail.com>**20060224215020]
201[Remove duplicate code from RnNames.
202Lemmih <lemmih@gmail.com>**20060224212748]
203[Remove non-existing modules from package.conf.in
204Lemmih <lemmih@gmail.com>**20060224203727]
205[Remove some unused bindings frm RnNames.
206Lemmih <lemmih@gmail.com>**20060224165409]
207[Rather large refactoring of RnNames.
208Lemmih <lemmih@gmail.com>**20060224154704
209 
210 This restructoring makes the renamed export and import lists
211 available in IDE mode.
212 
213]
214[add file to go with "extract some of the generic..." patch
215Simon Marlow <simonmar@microsoft.com>**20060224144126]
216[oops, undo accidental addition of package-time settings
217Simon Marlow <simonmar@microsoft.com>**20060224143051]
218[turn off a trace
219Simon Marlow <simonmar@microsoft.com>**20060224124608]
220[add instance Outputable CLabel
221Simon Marlow <simonmar@microsoft.com>**20060224124349]
222[-O2 implies -optc-O2 now
223Simon Marlow <simonmar@microsoft.com>**20060224124033]
224[extract some of the generic C-- optimisations from the NCG
225Simon Marlow <simonmar@microsoft.com>**20060224111753]
226[lag/drag/void: add an extra assertion, and some commentary
227Simon Marlow <simonmar@microsoft.com>**20060223155120]
228[lag/drag/void profiling fix
229Simon Marlow <simonmar@microsoft.com>**20060223155046
230 
231 We were searching the wrong part of the heap for dead objects, this
232 was broken by recent changes to the step structure: from-space is now
233 in step->old_blocks, not step->blocks.  Fortunately some assertions in
234 ProfHeap picked up the problem.
235]
236[add (trivial) support for STM objects in lag/drag/void profiling
237Simon Marlow <simonmar@microsoft.com>**20060223154859]
238[bugfix for LDV profiling on 64-bit platforms
239Simon Marlow <simonmar@microsoft.com>**20060223150904
240 
241 There was an integer overflow in the definition of LDV_RECORD_CREATE
242 when StgWord is 64 bits.
243]
244[warning fix
245Simon Marlow <simonmar@microsoft.com>**20060223144537]
246[further fix for floating point primitives
247Simon Marlow <simonmar@microsoft.com>**20060223143013]
248[Comment wibbles
249simonpj@microsoft.com**20060223142101]
250[Wibbles to instance validity checking
251simonpj@microsoft.com**20060223134154]
252[Fix comment
253simonpj@microsoft.com**20060223130104]
254[Improve error reporting for type-improvement errors
255simonpj@microsoft.com**20060223130029]
256[Reject polytypes in instance declarations (for now anyway)
257simonpj@microsoft.com**20060223125958]
258[Remove duplicate comment
259simonpj@microsoft.com**20060210104028]
260[Add renamed fixities to HsGroup.
261Lemmih <lemmih@gmail.com>**20060222173648]
262[oops, initialize atomic_modify_mutvar_mutex
263Simon Marlow <simonmar@microsoft.com>**20060222163827]
264[check black holes before doing GC in scheduleDoHeapProfile()
265Simon Marlow <simonmar@microsoft.com>**20060222160733
266 
267 fixes #687, see comment for details.
268]
269[fix for ASSIGN_BaseReg() in the unregisterised way
270Simon Marlow <simonmar@microsoft.com>**20060222141836]
271[floating-point fix for x86_64
272Simon Marlow <simonmar@microsoft.com>**20060222140719
273   
274 For 32-bit float primtives like sinFloat#, we currently call the
275 double versions of the C library functions (sin(), cos() etc.).  It
276 seems more correct to call the float versions (sinf(), cosf() etc.).
277 This makes a difference on x86_64, I'm not entirely sure why, but this
278 way at least generates more consistent results and avoids extra
279 promotion/demotion instructions when calling these primitives.
280 
281]
282[fix a deadlock in atomicModifyMutVar#
283Simon Marlow <simonmar@microsoft.com>**20060221163711
284 
285 atomicModifyMutVar# was re-using the storage manager mutex (sm_mutex)
286 to get its atomicity guarantee in SMP mode. But recently the addition
287 of a call to dirty_MUT_VAR() to implement the read barrier lead to a
288 rare deadlock case, because dirty_MUT_VAR() very occasionally needs to
289 allocate a new block to chain on the mutable list, which requires
290 sm_mutex.
291]
292[warning fix
293Simon Marlow <simonmar@microsoft.com>**20060221163308]
294[Mention the 'Encoding' module in package.conf.in
295Lemmih <lemmih@gmail.com>**20060221105147]
296[Loosen the rules for instance declarations (Part 3)
297Ross Paterson <ross@soi.city.ac.uk>**20060213161044
298 
299 Relax the restrictions on derived instances in the same way, so we
300 can write
301 
302        data MinHeap h a = H a (h a) deriving (Show)
303]
304[If we don't have libreadline then we need some dummy definition for complete* functions.
305kr.angelov@gmail.com**20060212095019]
306[SMP bugfix: reload capability from task->cap after scheduleDoGC
307wolfgang.thaller@gmx.net**20060212034736]
308[SMP support (xchg(), cas() and mb()) for PowerPC
309wolfgang.thaller@gmx.net**20060212033352]
310[Bugfix in completion code for :set and :unset.
311Lemmih <lemmih@gmail.com>**20060210181319]
312[Completion for :set, :unset and :undef.
313Lemmih <lemmih@gmail.com>**20060210171728]
314[oops, forgot some more SMP->THREADED_RTS conversions
315Simon Marlow <simonmar@microsoft.com>**20060210153236]
316[fix test for REG_BaseReg (it's spelled REG_Base)
317Simon Marlow <simonmar@microsoft.com>**20060210123552]
318[Change CVS for _darcs in dirs to prune during make dist
319Duncan Coutts <duncan.coutts@worc.ox.ac.uk>**20060209093204]
320[fix for dirty_MUT_VAR: don't try to recordMutableCap in gen 0
321Simon Marlow <simonmar@microsoft.com>**20060210120021]
322[STM fix from Tim Harris
323Simon Marlow <simonmar@microsoft.com>**20060210112111
324 
325 Fixes assertion failures with STM and -debug.  Tim says:
326 Sorry, it's a problem in how nested transactions are handled in
327 non-SMP builds.  It'll bite when trying to commit a nested transaction
328 which has read from a TVar but not updated it.
329 
330 The call to validate_and_acquire_ownership in
331 stmCommitNestedTransaction should be the same as that in
332 stmCommitNestedTransaction, i.e.:
333 
334   result = validate_and_acquire_ownership(trec, (!use_read_phase), TRUE);
335 
336]
337[improvement to the deadlock detection
338Simon Marlow <simonmar@microsoft.com>*-20060209123056
339 
340 When the RTS is idle, as detected by the timer signal, instead of
341 prodding capabilities from the signal handler (which is not guaranteed
342 to work - pthread_cond_signal() can't be called from signal handlers),
343 create a new thread to do it.
344]
345[Simplify the -B handling. The interface to the ghc library has changed slightly.
346Lemmih <lemmih@gmail.com>**20060210094601]
347[Fix desugaring of unboxed tuples
348simonpj@microsoft.com**20060209175328
349 
350 This patch is a slightly-unsatisfactory fix to desugaring unboxed
351 tuples; it fixes ds057 which has been failing for some time.
352 
353 Unsatisfactory because rather ad hoc -- but that applies to lots
354 of the unboxed tuple stuff.
355 
356]
357[x86_64: fix case of out-of-range operands to leaq
358Simon Marlow <simonmar@microsoft.com>**20060209162247]
359[Merge the smp and threaded RTS ways
360Simon Marlow <simonmar@microsoft.com>**20060209154449
361 
362 Now, the threaded RTS also includes SMP support.  The -smp flag is a
363 synonym for -threaded.  The performance implications of this are small
364 to negligible, and it results in a code cleanup and reduces the number
365 of combinations we have to test.
366]
367[change dirty_MUT_VAR() to use recordMutableCap()
368Simon Marlow <simonmar@microsoft.com>**20060209150420
369 rather than recordMutableGen(), the former works better in SMP
370]
371[improvement to the deadlock detection
372Simon Marlow <simonmar@microsoft.com>**20060209123056
373 
374 When the RTS is idle, as detected by the timer signal, instead of
375 prodding capabilities from the signal handler (which is not guaranteed
376 to work - pthread_cond_signal() can't be called from signal handlers),
377 create a new thread to do it.
378]
379[Fix typo
380simonpj@microsoft.com**20060209124208]
381[Fix instance rules for functional dependencies
382simonpj@microsoft.com**20060209113531
383 
384 GHC 6.4 implements a rather relaxed version of the Coverage Condition
385 which is actually too relaxed: the compiler can get into an infinite loop
386 as a result.
387 
388 This commit fixes the problem (see Note [Coverage condition] in FunDeps.lhs)
389 and documents the change.
390 
391 I also took the opportunity to add documentation about functional dependencies,
392 taken from the Hugs manual with kind permission of Mark Jones
393 
394]
395[fix for the unregisterised way
396Simon Marlow <simonmar@microsoft.com>**20060209105058
397 
398 We always assign to BaseReg on return from resumeThread(), but in
399 cases where BaseReg is not an lvalue (eg. unreg) we need to disable
400 this assigment.  See comments for more details.
401]
402[prof/smp combination probably doesn't work, disable it
403Simon Marlow <simonmar@microsoft.com>**20060209104815]
404[tiny panic msg fix
405Simon Marlow <simonmar@microsoft.com>**20060209102540]
406[Loosen the rules for instance declarations (Part 2)
407simonpj@microsoft.com**20060209102129
408 
409 Tidying up to Ross's  patch, plus adding documenation for it.
410 
411 
412]
413[relaxed instance termination test
414Ross Paterson <ross@soi.city.ac.uk>**20060206111651
415 
416 With -fglasgow-exts but not -fallow-undecidable-instances, GHC 6.4
417 requires that instances be of the following form:
418 
419  (1) each assertion in the context must constrain distinct variables
420      mentioned in the head, and
421 
422  (2) at least one argument of the head must be a non-variable type.
423 
424 This patch replaces these rules with the requirement that each assertion
425 in the context satisfy
426 
427  (1) no variable has more occurrences in the assertion than in the head, and
428 
429  (2) the assertion has fewer constructors and variables (taken together
430      and counting repetitions) than the head.
431 
432 This allows all instances permitted by the old rule, plus such instances as
433 
434        instance C a
435        instance Show (s a) => Show (Sized s a)
436        instance (Eq a, Show b) => C2 a b
437        instance C2 Int a => C3 Bool [a]
438        instance C2 Int a => C3 [a] b
439        instance C4 a a => C4 [a] [a]
440 
441 but still ensures that under any substitution assertions in the context
442 will be smaller than the head, so context reduction must terminate.
443 
444 This is probably the best we can do if we consider each instance in
445 isolation.
446]
447[Fix CPP failure by adding space before hASH_TBL_SIZE
448simonpj@microsoft.com**20060209093704]
449[an LDV profiling fix (might just fix ASSERTIONs, I'm not sure)
450Simon Marlow <simonmar@microsoft.com>**20060208170744]
451[Do type refinement in TcIface
452simonpj@microsoft.com**20060208154412
453 
454 This commit fixes a bug in 6.4.1 and the HEAD.  Consider this code,
455 recorded **in an interface file**
456 
457     \(x::a) -> case y of
458                 MkT -> case x of { True -> ... }
459 (where MkT forces a=Bool)
460 
461 In the "case x" we need to know x's type, because we use that
462 to find which module to look for "True" in. x's type comes from
463 the envt, so we must refine the envt. 
464 
465 The alternative would be to record more info with an IfaceCase,
466 but that would change the interface file format.
467 
468 (This stuff will go away when we have proper coercions.)
469       
470]
471[Add mapOccEnv
472simonpj@microsoft.com**20060208154343]
473[A little more debug printing
474simonpj@microsoft.com**20060208150701]
475[Show types of case result when debug is on
476simonpj@microsoft.com**20060208150357]
477[fix installation of binary dist when the PS docs aren't present
478Simon Marlow <simonmar@microsoft.com>**20060208153259
479 
480 Fixes #660
481]
482[fix a bug in closure_sizeW_()
483Simon Marlow <simonmar@microsoft.com>**20060208145451]
484[make the smp way RTS-only, normal libraries now work with -smp
485Simon Marlow <simonmar@microsoft.com>**20060208143348
486 
487 We had to bite the bullet here and add an extra word to every thunk,
488 to enable running ordinary libraries on SMP.  Otherwise, we would have
489 needed to ship an extra set of libraries with GHC 6.6 in addition to
490 the two sets we already ship (normal + profiled), and all Cabal
491 packages would have to be compiled for SMP too.  We decided it best
492 just to take the hit now, making SMP easily accessible to everyone in
493 GHC 6.6.
494 
495 Incedentally, although this increases allocation by around 12% on
496 average, the performance hit is around 5%, and much less if your inner
497 loop doesn't use any laziness.
498]
499[add -dfaststring-stats to dump some stats about the FastString hash table
500Simon Marlow <simonmar@microsoft.com>**20060208131018]
501[fix a warning
502Simon Marlow <simonmar@microsoft.com>**20060207132323]
503[catch up with changes to Distribution.ParseUtils.ParseResult
504Simon Marlow <simonmar@microsoft.com>**20060207111111]
505[Wibble to type signature
506simonpj@microsoft.com**20060207171254]
507[Empty forall should disable implicit quantification
508simonpj@microsoft.com**20060207085137]
509[Remove unused constructor in SourceTypeCtxt
510simonpj@microsoft.com**20060206112031]
511[Basic completion in GHCi
512Simon Marlow <simonmar@microsoft.com>**20060206122654
513 
514 This patch adds completion support to GHCi when readline is being
515 used.  Completion of identifiers (in scope only, but including
516 qualified identifiers) in expressions is provided.  Also, completion
517 of commands (:cmd), and special completion for certain commands
518 (eg. module names for the :module command) are also provided.
519]
520[Improve error report for pattern guards
521simonpj@microsoft.com**20060206101730]
522[Add bang patterns
523simonpj@microsoft.com**20060203175108
524 
525 This commit adds bang-patterns,
526        enabled by -fglasgow-exts or -fbang-patterns
527        diabled by -fno-bang-patterns
528 
529 The idea is described here
530        http://haskell.galois.com/cgi-bin/haskell-prime/trac.cgi/wiki/BangPatterns
531 
532]
533[Add Bag.anyBag (analogous to List.any)
534simonpj@microsoft.com**20060203174627]
535[Deal correctly with lazy patterns and GADTs
536simonpj@microsoft.com**20060202130409]
537[Record the type in TuplePat (necessary for GADTs)
538simonpj@microsoft.com**20060202124405
539 
540 We must record the type of a TuplePat after typechecking, just like a ConPatOut,
541 so that desugaring works correctly for GADTs. See comments with the declaration
542 of HsPat.TuplePat, and test gadt15
543 
544]
545[Improve error reporting in Core Lint
546simonpj@microsoft.com**20060202124327]
547[don't clean ghc-inplace when cleaning stages other than 1
548Simon Marlow <simonmar@microsoft.com>**20060202124359]
549[Improve error reporting in typechecker
550simonpj@microsoft.com**20060201170332]
551[Trim imports
552simonpj@microsoft.com**20060201170248]
553[Yet another fix to an old hi-boot-6 file
554simonpj@microsoft.com**20060201105544]
555[Kinding wibble in TH brackets
556simonpj@microsoft.com**20060131175730]
557[Use extraGHCiLibraries (if supplied) in GHCi linker rather than extraLibraries
558Duncan Coutts <duncan.coutts@worc.ox.ac.uk>**20051207105654
559 Also extend the parser.
560]
561[combine libraries/.darcs-boring and .darcs-boring
562Simon Marlow <simonmar@microsoft.com>**20060131161530]
563[Fix long-standing bug in CPR analysis
564simonpj@microsoft.com**20060131153247
565 
566        MERGE TO STABLE
567 
568 For a long time (2002!) the CPR analysis done by
569 dmdAnalTopRhs has been bogus.  In particular, it's possible
570 for a newtype constructor to look CPR-ish when it simply isn't.
571 
572 This fixes it.  Test is stranal/newtype
573 
574 
575 
576]
577[More hi-boot-6 updates
578simonpj@microsoft.com**20060131130926]
579[Fix TcUnify.subFunTys in AppTy case
580simonpj@microsoft.com**20060131122420
581 
582 subFunTys wasn't dealing correctly with the case where the type
583 to be split was of form (a ty1), where a is a type variable.
584 
585 This shows up when compiling
586        Control.Arrow.Transformer.Stream
587 in package arrows.
588 
589 This commit fixes it.
590 
591 
592]
593[Error message wibble
594simonpj@microsoft.com**20060130163651]
595[Add mkHsCoerce to avoid junk in typechecked code
596simonpj@microsoft.com**20060130131231
597 
598 Avoiding identity coercions is a Good Thing generally, but
599 it turns out that the desugarer has trouble recognising
600 'otherwise' and 'True' guards if they are wrapped in an
601 identity coercion; and that leads to bogus overlap warnings.
602 
603]
604[Improve error messsage when argument count varies
605simonpj@microsoft.com**20060130131133]
606[fix bug #664 in printSample()
607Simon Marlow <simonmar@microsoft.com>**20060130115301
608 printSample() was attempting to round the fractional part of the time,
609 but not propagated to the non-fractional part.  It's probably better not
610 to attempt to round the time at all.
611]
612[Fix hi-boot file for earlier versions of GHC
613simonpj@microsoft.com**20060127175040]
614[Fix typo in boxy matching
615simonpj@microsoft.com**20060127174536]
616[fix one case where -q wasn't honoured
617Simon Marlow <simonmar@microsoft.com>**20060127104715]
618[Check for GMP.framework on all Darwin platforms, not just PPC
619wolfgang.thaller@gmx.net**20060126071504]
620[Simon's big boxy-type commit
621simonpj@microsoft.com**20060125162832
622 
623 This very large commit adds impredicativity to GHC, plus
624 numerous other small things.
625   
626 *** WARNING: I have compiled all the libraries, and
627 ***         a stage-2 compiler, and everything seems
628 ***         fine.  But don't grab this patch if you
629 ***         can't tolerate a hiccup if something is
630 ***         broken.
631   
632 The big picture is this:
633 
634 a) GHC handles impredicative polymorphism, as described in the
635    "Boxy types: type inference for higher-rank types and
636    impredicativity" paper
637 
638 b) GHC handles GADTs in the new simplified (and very sligtly less
639    epxrssive) way described in the
640    "Simple unification-based type inference for GADTs" paper
641 
642   
643 But there are lots of smaller changes, and since it was pre-Darcs
644 they are not individually recorded.
645   
646 Some things to watch out for:
647   
648 c)   The story on lexically-scoped type variables has changed, as per
649      my email.  I append the story below for completeness, but I
650      am still not happy with it, and it may change again.  In particular,
651      the new story does not allow a pattern-bound scoped type variable
652      to be wobbly, so (\(x::[a]) -> ...) is usually rejected.  This is
653      more restrictive than before, and we might loosen up again.
654   
655 d)   A consequence of adding impredicativity is that GHC is a bit less
656      gung ho about converting automatically between
657        (ty1 -> forall a. ty2)    and    (forall a. ty1 -> ty2)
658      In particular, you may need to eta-expand some functions to make
659      typechecking work again.
660   
661      Furthermore, functions are now invariant in their argument types,
662      rather than being contravariant.  Again, the main consequence is
663      that you may occasionally need to eta-expand function arguments when
664      using higher-rank polymorphism.
665   
666 
667 Please test, and let me know of any hiccups
668 
669 
670 Scoped type variables in GHC
671 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
672        January 2006
673 
674 0) Terminology.
675   
676    A *pattern binding* is of the form
677        pat = rhs
678 
679    A *function binding* is of the form
680        f pat1 .. patn = rhs
681 
682    A binding of the formm
683        var = rhs
684    is treated as a (degenerate) *function binding*.
685 
686 
687    A *declaration type signature* is a separate type signature for a
688    let-bound or where-bound variable:
689        f :: Int -> Int
690 
691    A *pattern type signature* is a signature in a pattern:
692        \(x::a) -> x
693        f (x::a) = x
694 
695    A *result type signature* is a signature on the result of a
696    function definition:
697        f :: forall a. [a] -> a
698        head (x:xs) :: a = x
699 
700    The form
701        x :: a = rhs
702    is treated as a (degnerate) function binding with a result
703    type signature, not as a pattern binding.
704 
705 1) The main invariants:
706 
707      A) A lexically-scoped type variable always names a (rigid)
708        type variable (not an arbitrary type).  THIS IS A CHANGE.
709         Previously, a scoped type variable named an arbitrary *type*.
710 
711      B) A type signature always describes a rigid type (since
712        its free (scoped) type variables name rigid type variables).
713        This is also a change, a consequence of (A).
714 
715      C) Distinct lexically-scoped type variables name distinct
716        rigid type variables.  This choice is open;
717 
718 2) Scoping
719 
720 2(a) If a declaration type signature has an explicit forall, those type
721    variables are brought into scope in the right hand side of the
722    corresponding binding (plus, for function bindings, the patterns on
723    the LHS). 
724        f :: forall a. a -> [a]
725        f (x::a) = [x :: a, x]
726    Both occurences of 'a' in the second line are bound by
727    the 'forall a' in the first line
728 
729    A declaration type signature *without* an explicit top-level forall
730    is implicitly quantified over all the type variables that are
731    mentioned in the type but not already in scope.  GHC's current
732    rule is that this implicit quantification does *not* bring into scope
733    any new scoped type variables.
734        f :: a -> a
735        f x = ...('a' is not in scope here)...
736    This gives compatibility with Haskell 98
737 
738 2(b) A pattern type signature implicitly brings into scope any type
739    variables mentioned in the type that are not already into scope.
740    These are called *pattern-bound type variables*.
741        g :: a -> a -> [a]
742        g (x::a) (y::a) = [y :: a, x]
743    The pattern type signature (x::a) brings 'a' into scope.
744    The 'a' in the pattern (y::a) is bound, as is the occurrence on
745    the RHS. 
746 
747    A pattern type siganture is the only way you can bring existentials
748    into scope.
749        data T where
750          MkT :: forall a. a -> (a->Int) -> T
751 
752        f x = case x of
753                MkT (x::a) f -> f (x::a)
754 
755 2a) QUESTION
756        class C a where
757          op :: forall b. b->a->a
758 
759        instance C (T p q) where
760          op = <rhs>
761     Clearly p,q are in scope in <rhs>, but is 'b'?  Not at the moment.
762     Nor can you add a type signature for op in the instance decl.
763     You'd have to say this:
764        instance C (T p q) where
765          op = let op' :: forall b. ...
766                   op' = <rhs>
767               in op'
768 
769 3) A pattern-bound type variable is allowed only if the pattern's
770    expected type is rigid.  Otherwise we don't know exactly *which*
771    skolem the scoped type variable should be bound to, and that means
772    we can't do GADT refinement.  This is invariant (A), and it is a
773    big change from the current situation.
774 
775        f (x::a) = x    -- NO; pattern type is wobbly
776       
777        g1 :: b -> b
778        g1 (x::b) = x   -- YES, because the pattern type is rigid
779 
780        g2 :: b -> b
781        g2 (x::c) = x   -- YES, same reason
782 
783        h :: forall b. b -> b
784        h (x::b) = x    -- YES, but the inner b is bound
785 
786        k :: forall b. b -> b
787        k (x::c) = x    -- NO, it can't be both b and c
788 
789 3a) You cannot give different names for the same type variable in the same scope
790     (Invariant (C)):
791 
792        f1 :: p -> p -> p               -- NO; because 'a' and 'b' would be
793        f1 (x::a) (y::b) = (x::a)       --     bound to the same type variable
794 
795        f2 :: p -> p -> p               -- OK; 'a' is bound to the type variable
796        f2 (x::a) (y::a) = (x::a)       --     over which f2 is quantified
797                                        -- NB: 'p' is not lexically scoped
798 
799        f3 :: forall p. p -> p -> p     -- NO: 'p' is now scoped, and is bound to
800        f3 (x::a) (y::a) = (x::a)       --     to the same type varialble as 'a'
801 
802        f4 :: forall p. p -> p -> p     -- OK: 'p' is now scoped, and its occurences
803        f4 (x::p) (y::p) = (x::p)       --     in the patterns are bound by the forall
804 
805 
806 3b) You can give a different name to the same type variable in different
807     disjoint scopes, just as you can (if you want) give diferent names to
808     the same value parameter
809 
810        g :: a -> Bool -> Maybe a
811        g (x::p) True  = Just x  :: Maybe p
812        g (y::q) False = Nothing :: Maybe q
813 
814 3c) Scoped type variables respect alpha renaming. For example,
815     function f2 from (3a) above could also be written:
816        f2' :: p -> p -> p
817        f2' (x::b) (y::b) = x::b
818    where the scoped type variable is called 'b' instead of 'a'.
819 
820 
821 4) Result type signatures obey the same rules as pattern types signatures.
822    In particular, they can bind a type variable only if the result type is rigid
823 
824        f x :: a = x    -- NO
825 
826        g :: b -> b
827        g x :: b = x    -- YES; binds b in rhs
828 
829 5) A *pattern type signature* in a *pattern binding* cannot bind a
830    scoped type variable
831 
832        (x::a, y) = ...         -- Legal only if 'a' is already in scope
833 
834    Reason: in type checking, the "expected type" of the LHS pattern is
835    always wobbly, so we can't bind a rigid type variable.  (The exception
836    would be for an existential type variable, but existentials are not
837    allowed in pattern bindings either.)
838 
839    Even this is illegal
840        f :: forall a. a -> a
841        f x = let ((y::b)::a, z) = ...
842              in
843    Here it looks as if 'b' might get a rigid binding; but you can't bind
844    it to the same skolem as a.
845 
846 6) Explicitly-forall'd type variables in the *declaration type signature(s)*
847    for a *pattern binding* do not scope AT ALL.
848 
849        x :: forall a. a->a       -- NO; the forall a does
850        Just (x::a->a) = Just id  --     not scope at all
851 
852        y :: forall a. a->a
853        Just y = Just (id :: a->a)  -- NO; same reason
854 
855    THIS IS A CHANGE, but one I bet that very few people will notice.
856    Here's why:
857 
858        strange :: forall b. (b->b,b->b)
859        strange = (id,id)
860 
861        x1 :: forall a. a->a
862        y1 :: forall b. b->b
863        (x1,y1) = strange
864 
865     This is legal Haskell 98 (modulo the forall). If both 'a' and 'b'
866     both scoped over the RHS, they'd get unified and so cannot stand
867     for distinct type variables. One could *imagine* allowing this:
868   
869        x2 :: forall a. a->a
870        y2 :: forall a. a->a
871        (x2,y2) = strange
872 
873     using the very same type variable 'a' in both signatures, so that
874     a single 'a' scopes over the RHS.  That seems defensible, but odd,
875     because though there are two type signatures, they introduce just
876     *one* scoped type variable, a.
877 
878 7) Possible extension.  We might consider allowing
879        \(x :: [ _ ]) -> <expr>
880     where "_" is a wild card, to mean "x has type list of something", without
881     naming the something.
882 
883]
884[add double colon and double arrow symbols (-fglasgow-exts)
885Simon Marlow <simonmar@microsoft.com>**20060125135501]
886[Fix conDeclFVs for GADTs, to fix bogus unused-import warning
887simonpj@microsoft.com**20060125090957]
888[make the par# primop actually do something
889Simon Marlow <simonmar@microsoft.com>**20060124162521]
890[Update Cachegrind support for changes to the Valgrind CLI
891Simon Marlow <simonmar@microsoft.com>**20060124154732]
892[send usage info to stdout, not stderr
893Simon Marlow <simonmar@microsoft.com>**20060124145551]
894[primop-docs
895Dinko Tenev <dinko.tenev@gmail.com>**20060122222446]
896[remove old CVS stuff, replace with darcs
897Simon Marlow <simonmar@microsoft.com>**20060120151322]
898[implement clean/dirty TSOs
899Simon Marlow <simonmar@microsoft.com>**20060123164930
900 Along the lines of the clean/dirty arrays and IORefs implemented
901 recently, now threads are marked clean or dirty depending on whether
902 they need to be scanned during a minor GC or not.  This should speed
903 up GC when there are lots of threads, especially if most of them are
904 idle.
905]
906[Better error message for Template Haskell pattern brackets
907simonpj@microsoft.com**20060123142838]
908[remove old comment
909Simon Marlow <simonmar@microsoft.com>**20060123140530]
910[Fix for feature request #655 (Loading the GHC library from GHCi.)
911Lemmih <lemmih@gmail.com>**20060123110625
912 Moved the utility functions out of hschooks, avoided
913 linking the GHC library with hschooks.o and
914 added a couple of symbols to the linkers export list.
915]
916[Make hsc2hs emit the full path name in {-# LINE #-} pagmas.
917Duncan Coutts <duncan.coutts@worc.ox.ac.uk>**20060122011831
918 For one thing this is the right thing to do anyway, it's what other tools do.
919 Secondly it allows haddock to produce accurate source code links.
920]
921[MFLAGS += -f Makefile
922Simon Marlow <simonmar@microsoft.com>**20060123094837
923 merged from CVS, because Tailor isn't merging the libraries subdir
924]
925[undo accidental commit of snapshot version
926Simon Marlow <simonmar@microsoft.com>**20060122175817]
927[TAG final switch to darcs, this repo is now live
928Simon Marlow <simonmar@microsoft.com>**20060120134630]
929Patch bundle hash:
93033f1ec7c3134b19af9ca060668c2b49e8c75f04c