1. 21 Feb, 2003 1 commit
  2. 20 Feb, 2003 2 commits
    • simonpj's avatar
      [project @ 2003-02-20 18:33:50 by simonpj] · 56b5a8b8
      simonpj authored
      -------------------------------------
            Add Core Notes and the {-# CORE #-} pragma
      	-------------------------------------
      
      This is an idea of Hal Daume's. The key point is that Notes in Core
      are augmented thus:
      
        data Note
          = SCC CostCentre
          | ...
          | CoreNote String     -- NEW
      
      These notes can be injected via a Haskell-source pragma:
      
         f x = ({-# CORE "foo" #-} show) ({-# CORE "bar" #-} x)
      
      This wraps a (Note (CoreNote "foo")) around the 'show' variable,
      and a similar note around the argument to 'show'.
      
      These notes are basically ignored by GHC, but are emitted into
      External Core, where they may convey useful information.
      
      Exactly how code involving these notes is munged by the simplifier
      isn't very well defined.  We'll see how it pans out.  Meanwhile
      the impact on the rest of the compiler is minimal.
      56b5a8b8
    • simonpj's avatar
      [project @ 2003-02-20 13:01:20 by simonpj] · f9853a3e
      simonpj authored
      Eliminate brain-dead outputC pattern-match failure
      f9853a3e
  3. 19 Feb, 2003 1 commit
  4. 18 Feb, 2003 1 commit
    • igloo's avatar
      [project @ 2003-02-18 16:23:35 by igloo] · cdb01ba2
      igloo authored
      Support strictness annotations on data declarations and support the record
      and infix constructors. Also tweaked the pretty printer a bit.
      cdb01ba2
  5. 12 Feb, 2003 1 commit
    • simonpj's avatar
      [project @ 2003-02-12 15:01:31 by simonpj] · 42b63073
      simonpj authored
      -------------------------------------
        Big upheaval to the way that constructors are named
      	-------------------------------------
      
      This commit enshrines the new story for constructor names.  We could never
      really get External Core to work nicely before, but now it does.
      
      The story is laid out in detail in the Commentary
      	ghc/docs/comm/the-beast/data-types.html
      so I will not repeat it here.
      
      	[Manuel: the commentary isn't being updated, apparently.]
      
      However, the net effect is that in Core and in External Core, contructors look
      like constructors, and the way things are printed is all consistent.
      
      It is a fairly pervasive change (which is why it has been so long postponed),
      but I hope the question is now finally closed.
      
      All the libraries compile etc, and I've run many tests, but doubtless there will
      be some dark corners.
      42b63073
  6. 06 Feb, 2003 1 commit
    • simonpj's avatar
      [project @ 2003-02-06 17:15:50 by simonpj] · 70e9ee75
      simonpj authored
      -------------------------------------
        Fix parsing of floating-point constants in External Core
      	-------------------------------------
      
      This fix accidentally made it into the previous (unrelated) commit,
      so it's really the *previous* change to LexCore you should look
      at.
      
      The fix updates LexCore so that it can parse literals in scientific
      notation (e.g. 4.3e-3)
      70e9ee75
  7. 25 Jan, 2003 1 commit
    • wolfgang's avatar
      [project @ 2003-01-25 15:54:48 by wolfgang] · af136096
      wolfgang authored
      This commit fixes many bugs and limitations in the threaded RTS.
      There are still some issues remaining, though.
      
      The following bugs should have been fixed:
      
      - [+] "safe" calls could cause crashes
      - [+] yieldToReturningWorker/grabReturnCapability
          -     It used to deadlock.
      - [+] couldn't wake blocked workers
          -     Calls into the RTS could go unanswered for a long time, and
                that includes ordinary callbacks in some circumstances.
      - [+] couldn't block on an MVar and expect to be woken up by a signal
            handler
          -     Depending on the exact situation, the RTS shut down or
                blocked forever and ignored the signal.
      - [+] The locking scheme in RtsAPI.c didn't work
      - [+] run_thread label in wrong place (schedule())
      - [+] Deadlock in GHC.Handle
          -     if a signal arrived at the wrong time, an mvar was never
                filled again
      - [+] Signals delivered to the "wrong" thread were ignored or handled
            too late.
      
      Issues:
      *) If GC can move TSO objects (I don't know - can it?), then ghci
      will occasionally crash when calling foreign functions, because the
      parameters are stored on the TSO stack.
      
      *) There is still a race condition lurking in the code
      (both threaded and non-threaded RTS are affected):
      If a signal arrives after the check for pending signals in
      schedule(), but before the call to select() in awaitEvent(),
      select() will be called anyway. The signal handler will be
      executed much later than expected.
      
      *) For Win32, GHC doesn't yet support non-blocking IO, so while a
      thread is waiting for IO, no call-ins can happen. If the RTS is
      blocked in awaitEvent, it uses a polling loop on Win32, so call-ins
      should work (although the polling loop looks ugly).
      
      *) Deadlock detection is disabled for the threaded rts, because I
      don't know how to do it properly in the presence of foreign call-ins
      from foreign threads.
      This causes the tests conc031, conc033 and conc034 to fail.
      
      *) "safe" is currently treated as "threadsafe". Implementing "safe" in
      a way that blocks other Haskell threads is more difficult than was
      thought at first. I think it could be done with a few additional lines
      of code, but personally, I'm strongly in favour of abolishing the
      distinction.
      
      *) Running finalizers at program termination is inefficient - there
      are two OS threads passing messages back and forth for every finalizer
      that is run. Also (just as in the non-threaded case) the finalizers
      are run in parallel to any remaining haskell threads and to any
      foreign call-ins that might still happen.
      af136096
  8. 23 Jan, 2003 1 commit
  9. 13 Jan, 2003 1 commit
    • simonpj's avatar
      [project @ 2003-01-13 13:20:37 by simonpj] · 90bf3139
      simonpj authored
      --------------------------------
      	Don't export the inlining for a foreign
      	import that has a #include directive
      	--------------------------------
      
      Reason for this change: if the inlining is imported into another
      module, the latter may not have the right #include directives.
      
      Also add notes to the documentation to explain the issues.
      90bf3139
  10. 21 Nov, 2002 5 commits
    • simonpj's avatar
      [project @ 2002-11-21 17:54:54 by simonpj] · 5e34dfe2
      simonpj authored
      un-wibble
      5e34dfe2
    • simonpj's avatar
      [project @ 2002-11-21 17:54:17 by simonpj] · 0df43546
      simonpj authored
      Another wibble
      0df43546
    • simonpj's avatar
      [project @ 2002-11-21 15:51:43 by simonpj] · 11047b5e
      simonpj authored
      -------------------------------
      	Pass the current-module type envt
      to HscMain.compileExpr, and thence to the desugarer
      	-------------------------------
      
      For Template Haskell it's important to have the type envt of
      the current module available to hand the desugarer.
      
      Should fix TH_spliceDecl3
      11047b5e
    • simonpj's avatar
      [project @ 2002-11-21 09:37:24 by simonpj] · 5f7e4514
      simonpj authored
      More wibbles to improve declaration splicing
      5f7e4514
    • simonpj's avatar
      [project @ 2002-11-21 09:36:03 by simonpj] · f0f69132
      simonpj authored
      -------------------------------
      	Fix and tidy the desugaring of
      	pattern-matching in do-notation
      	-------------------------------
      
      In the reorgansiation of HsPat, failureFreePat had become incorrect (due to
      a catch-all case that caught a constructor that should have been matched).  So
      pattern-match failure in do-notation wasn't handled right.
      
      As it turned out, DsExpr.dsDo could be made much simpler and more elegant
      by using matchSimply instead of matchWrapper, and this had the side benefit
      of removing the last call to HsPat.failureFreePat.  So it's gone!
      f0f69132
  11. 20 Nov, 2002 3 commits
  12. 13 Nov, 2002 1 commit
  13. 09 Nov, 2002 1 commit
    • chak's avatar
      [project @ 2002-11-09 09:58:56 by chak] · 33fec6b1
      chak authored
      Changed implementation of representation of negation to use function
      application instead of a special syntactic form as suggested by SPJ.
      33fec6b1
  14. 08 Nov, 2002 1 commit
    • simonpj's avatar
      [project @ 2002-11-08 09:01:06 by simonpj] · 73641e01
      simonpj authored
      ------------------
        	   More TH stuff (thanks to Ian L)
      		------------------
      
      * Make TH Literals have an Integer not an Int
      * Desguar TH 'foreign import' a bit better
      * Minor documentation changes
      73641e01
  15. 07 Nov, 2002 1 commit
    • simonpj's avatar
      [project @ 2002-11-07 11:42:48 by simonpj] · 06fa575f
      simonpj authored
      ------------------
      	Fix an obscure bug in implicit parameters,
      	interacting with lazy pattern matching
      		------------------
      
      		MERGE TO STABLE BRANCH
      
      The problem was this:
      
        data UniqueSupply = US Integer
      
        newUnique :: (?uniqueSupply :: UniqueSupply) => Integer
        newUnique = r
                  where US r = ?uniqueSupply
      
      The lazy pattern match in the where clause killed GHC 5.04 because the
      SourceType {?uniqueSupply::UniqueSupply} of the RHS of the 'where' didn't
      look like a UniqueSupply.
      
      The fix is simple: in DsUtils.mkSelectorBinds, use the pattern, not
      the rhs, to get the type reqd.  More efficient too.
      
      Test is typecheck/should_compile/tc164.hs
      06fa575f
  16. 06 Nov, 2002 1 commit
    • simonpj's avatar
      [project @ 2002-11-06 13:10:46 by simonpj] · e26dd9a9
      simonpj authored
      ------------------
      		Template Haskell stuff
      		------------------
      
      a) Pretty printer for TH (thanks to Ian Lynagh)
      
      b) A declaration quote has type Q [Dec], not [Q Dec] as in
         the paper
      
      c) Foreign imports are part of THSyntax, and can be spliced in
      e26dd9a9
  17. 04 Nov, 2002 1 commit
  18. 31 Oct, 2002 1 commit
  19. 30 Oct, 2002 2 commits
  20. 29 Oct, 2002 2 commits
    • chak's avatar
      [project @ 2002-10-29 13:16:46 by chak] · c883ba41
      chak authored
      Cleaned up `repE'.  Reordered to match order of cases in HsExpr and made an
      effort to catch all cases.
      c883ba41
    • chak's avatar
      [project @ 2002-10-29 11:57:41 by chak] · 73ac2f44
      chak authored
      Added a case for HsPar to repE.  Also completed the cases in repE to at
      least panic for the missing syntactic forms of HsExpr.
      
      Is there any good reason for the semi-random order of the cases in repE?
      Using the same order as in the data declaration for HsExpr would make it
      easier to spot missing cases.
      73ac2f44
  21. 25 Oct, 2002 1 commit
    • simonpj's avatar
      [project @ 2002-10-25 15:23:03 by simonpj] · 4ef18ea2
      simonpj authored
      ------------------------
      	More dependency fiddling
      	------------------------
      
      	WARNING: Interface file format has changed (again)
      		 You need to 'make clean' in all library code
      
      * Orphan modules are now kept separately
        Home-package dependencies now contain only home-package dependencies!
        See HscTypes.Dependencies
      
      * Linker now uses the dependencies to do dynamic linking
      
      Result: Template Haskell should work even without --make (not yet tested)
      4ef18ea2
  22. 24 Oct, 2002 1 commit
    • simonpj's avatar
      [project @ 2002-10-24 14:17:46 by simonpj] · e0445ffa
      simonpj authored
      ------------------------------------------
      	1. New try and module and package dependencies
      	2. OrigNameCache always contains final info
      	------------------------------------------
      
      These things nearly complete sorting out the incremental
      linking problem that started us off!
      
      1. This commit separates two kinds of information:
      
        (a) HscTypes.Dependencies:
      	What (i)  home-package modules, and
      	     (ii) other packages
            this module depends on, transitively.
      
            That is, to link the module, it should be enough
            to link the dependent modules and packages (plus
            any C stubs etc).
      
            Along with this info we record whether the dependent module
            is (a) a boot interface or (b) an orphan module.  So in
            fact (i) can contain non-home-package modules, namely the
            orphan ones in other packages (sigh).
      
        (b) HscTypes.Usage:
            What version of imported things were used to
            actually compile the module.  This info is used for
            recompilation control only.
      
      
      
      2. The Finder now returns a correct Module (incl package indicator)
      first time, so we can install the absolutely final Name in the
      OrigNameCache when we first come across an occurrence of that name,
      even if it's only an occurrence in an unfolding in some other interface
      file.  This is much tidier.
      
      As a result Module.lhs is much cleaner
      	No DunnoYet
      	No mkVanillaModule
      ALl very joyful stuff.
      e0445ffa
  23. 23 Oct, 2002 1 commit
    • simonpj's avatar
      [project @ 2002-10-23 14:30:00 by simonpj] · 203a687f
      simonpj authored
      ------------------------------------------------
      	Allow implicit-parameter bindings anywhere that
      		a normal binding group is allowed.
      	------------------------------------------------
      
      That is, you can have implicit parameters
      
      	* in a let binding
      	* in a where clause (but then you can't have non-implicit
      	  ones as well)
      	* in a let group in a list comprehension or monad do-notation
      
      The implementation is simple: just add IPBinds to the allowable forms of HsBinds,
      and remove the HsWith expression form altogether.   (It now comes in via the
      HsLet form.)
      
      It'a a nice generalisation really.  Needs a bit of documentation, which I'll do next.
      203a687f
  24. 11 Oct, 2002 2 commits
    • simonpj's avatar
      [project @ 2002-10-11 16:45:16 by simonpj] · 37f72280
      simonpj authored
      More reification wibbling; and -ddump-splices
      37f72280
    • simonpj's avatar
      [project @ 2002-10-11 14:46:02 by simonpj] · cbb5beb0
      simonpj authored
      ------------------------------------------
      	Implement reification for Template Haskell
      	------------------------------------------
      
      This is entirely un-tested, but I don't think it'll break non-TH stuff.
      
      Implements
      	reifyDecl T :: Dec	-- Data type T
      	reifyDecl C :: Dec	-- Class C
      	reifyType f :: Typ	-- Function f
      
      I hope.
      cbb5beb0
  25. 09 Oct, 2002 2 commits
    • simonpj's avatar
      [project @ 2002-10-09 16:53:10 by simonpj] · aadb64aa
      simonpj authored
      Fix to mdo, plus SrcLocs on splices and brackets
      aadb64aa
    • simonpj's avatar
      [project @ 2002-10-09 15:03:48 by simonpj] · 8c1b6bd7
      simonpj authored
      -----------------------------------
      	Lots more Template Haskell stuff
      	-----------------------------------
      
      At last!  Top-level declaration splices work!
      Syntax is
      
      	$(f x)
      
      not "splice (f x)" as in the paper.
      
      Lots jiggling around, particularly with the top-level plumbining.
      Note the new data type HsDecls.HsGroup.
      8c1b6bd7
  26. 27 Sep, 2002 2 commits
    • simonpj's avatar
      [project @ 2002-09-27 12:42:42 by simonpj] · 278092c8
      simonpj authored
      Wibbles to improve error reporting
      278092c8
    • simonpj's avatar
      [project @ 2002-09-27 08:20:43 by simonpj] · dbc254c3
      simonpj authored
      --------------------------------
              Implement recursive do-notation
      	--------------------------------
      
      This commit adds recursive do-notation, which Hugs has had for some time.
      
      	mdo { x <- foo y ;
      	      y <- baz x ;
      	      return (y,x) }
      
      turns into
      
      	do { (x,y) <- mfix (\~(x,y) -> do { x <- foo y;
      					    y <- baz x }) ;
      	     return (y,x) }
      
      This is all based on work by Levent Erkok and John Lanuchbury.
      
      The really tricky bit is in the renamer (RnExpr.rnMDoStmts) where
      we break things up into minimal segments.  The rest is easy, including
      the type checker.
      
      Levent laid the groundwork, and Simon finished it off. Needless to say,
      I couldn't resist tidying up other stuff, so there's no guaranteed I
      have not broken something.
      dbc254c3
  27. 13 Sep, 2002 2 commits