1. 04 Dec, 2002 1 commit
  2. 02 Dec, 2002 4 commits
    • simonpj's avatar
      [project @ 2002-12-02 17:10:13 by simonpj] · aa78876d
      simonpj authored
      Use the right PackageIfaceTable in cmInfoThing
      aa78876d
    • simonpj's avatar
      [project @ 2002-12-02 16:58:33 by simonpj] · bd87e787
      simonpj authored
      Remember to zapToType in tcSpliceExpr
      bd87e787
    • simonmar's avatar
      [project @ 2002-12-02 14:33:10 by simonmar] · 286a25bb
      simonmar authored
      Fix a bug and clean up some cruft in here:
      
       - In each function in the rts_getXXXX() family, there was a test that
         the object is actually of the desired type by examining its info
         table.  Some of these tests were disabled, but there was no comment
         explaining why.  I've just (re-)discovered the reason: the
         info table might be dynamically-loaded in the GHCi case.
      
         Not all the tests were disabled, which lead to bugs using the FFI
         in GHCi (in particular with functions that return Float or Double).
      
       - I've added consistent, but commented out, assertions to each of
         the rts_getXXXX() functions, and left a comment explaining why
         these reasonable-looking assertions are disabled.
      
      MERGE TO STABLE
      286a25bb
    • simonmar's avatar
      [project @ 2002-12-02 10:44:10 by simonmar] · 12718d14
      simonmar authored
      Add a FAQ item about long link times.
      12718d14
  3. 28 Nov, 2002 4 commits
    • simonpj's avatar
      [project @ 2002-11-28 17:17:41 by simonpj] · 3c58c25b
      simonpj authored
      -------------------------------
            A day's work to improve error messages
      	-------------------------------
      
      1.  Indicate when the cause of the error is likely to be the monomorpism
          restriction, and identify the offending variables.  This involves
          mainly tcSimplifyTop and its error generation.
      
      2.  Produce much better kind error messages.  No more
            ../alonzo/DiGraph.hs:40:
      	  Couldn't match `* -> *' against `Type bx'
      	      Expected kind: * -> *
      	      Inferred kind: Type bx
      	  When checking that `DiGraph n' is a type
      
      It took a surprisingly long time to get the details right.
      3c58c25b
    • simonpj's avatar
      [project @ 2002-11-28 10:04:52 by simonpj] · b44c6881
      simonpj authored
      Report over-size tuples gracefully
      b44c6881
    • simonpj's avatar
      [project @ 2002-11-28 10:04:15 by simonpj] · e030a747
      simonpj authored
      Document a couple more bugs
      e030a747
    • mthomas's avatar
      [project @ 2002-11-28 01:00:44 by mthomas] · 2c5ca121
      mthomas authored
      Add a getting started example.  Someone with Docbook please check the SGML.
      2c5ca121
  4. 26 Nov, 2002 1 commit
  5. 22 Nov, 2002 3 commits
  6. 21 Nov, 2002 14 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 17:43:43 by simonpj] · d8a22a2b
      simonpj authored
      wibble
      d8a22a2b
    • 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 14:59:51 by simonpj] · c9c01697
      simonpj authored
      -------------------------------
      	Better notion of what a 'value' is
      	Slightly better eta reduction
      	-------------------------------
      
      1.  At various places we watch out for "values"; the predicate exprIsValue
      detects them. It was stupidly treating nullary constructors as non-values
      which is exceptionally stupid.  This (performance) bug has been there
      for ages.
      
      There's an exactly similar bug in SimplUtils.interestingArg, which looks
      for an interesting argument to trigger an inlining.
      
      
      2.  The eta reduction in SimplUtils.tryEtaReduce would only eta reduce if
      that left us with a variable.  That led to slightly tiresome thing like
      	:DMonad (/\a b -> foo @ s @ a @ b) ...
      where this would be neater
      	:DMonad (foo @ s)
      The fix is easy, and there's a little less code too.
      c9c01697
    • simonpj's avatar
      [project @ 2002-11-21 11:32:45 by simonpj] · 99cccd62
      simonpj authored
      Add rawSystem back in for benefit of pre-504 compilers on Win32
      99cccd62
    • simonpj's avatar
      [project @ 2002-11-21 11:31:51 by simonpj] · b2d633b6
      simonpj authored
      import trimming
      b2d633b6
    • simonpj's avatar
      [project @ 2002-11-21 11:31:34 by simonpj] · a06f5e7b
      simonpj authored
      --------------------------------
      	Compile instance declarations better
      	--------------------------------
      
      This commit makes the type checker build better dictionaries
      from instance declarations.  "Better" in the sense that if a
      binding in the instance declaration mentions one of the other
      methods of the same class, we use that method directly rather
      than going via a (recursive) use of the dictionary.
      
      This makes it easier to unravel recursive knots, and that
      makes more inlining happen.  There's a long comment in
      TcInstDcls.tcMethods
      
      Makes the Monad instance for ST much more inlinable, and that
      makes spectral/fibheaps go faster, among other things.
      a06f5e7b
    • simonmar's avatar
      [project @ 2002-11-21 11:27:05 by simonmar] · 49c120b9
      simonmar authored
      these files should be on eval-apply-branch
      49c120b9
    • simonmar's avatar
      [project @ 2002-11-21 10:04:20 by simonmar] · 98eae016
      simonmar authored
      Repair the HEAD after some file adds/removes that were supposed to
      happen on the eval-apply-branch yesterday mysteriously happened on the
      HEAD instead.
      98eae016
    • 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:48 by simonpj] · b8598510
      simonpj authored
      Less rn-tracing
      b8598510
    • 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
    • chak's avatar
      [project @ 2002-11-21 03:34:07 by chak] · 063123a0
      chak authored
      Convert : Added newly required import of `HsSyn.TySynonym'
      TcSplice: Adapted `tcRunQ' to new definition of `THSyntax.Q'
      063123a0
  7. 20 Nov, 2002 10 commits
    • chak's avatar
      [project @ 2002-11-20 23:27:37 by chak] · d31b5e62
      chak authored
      wibble
      d31b5e62
    • simonpj's avatar
      [project @ 2002-11-20 15:43:37 by simonpj] · f2e26fc5
      simonpj authored
      Three Template Haskell improvements
      
      a) Add type synonyms to THSyntax (and DsMeta, Convert)
      
      b) Make Q into a newtype instead of a type synonym
      
      c) Eliminate tiresome and error prone argument to DsMeta.wrapGenSyms
         and similarly addTyVarBinds
      f2e26fc5
    • simonpj's avatar
      [project @ 2002-11-20 15:40:32 by simonpj] · c0624c76
      simonpj authored
      Wibble to fix :info
      c0624c76
    • simonpj's avatar
      [project @ 2002-11-20 15:39:47 by simonpj] · 916abd02
      simonpj authored
      ------------------------------------
      	Improve occurrence analysis a little
      	------------------------------------
      
      Consider
      
      		x1 = a0 : []
      		x2 = a1 : x1
      		x3 = a2 : x2
      		g  = f x3
      
      First time round, it looks as if x1 and x2 occur as an arg of a
      let(rec)-bound constructor, and hence should not be inlined. (If the
      RHS of a let is just (C a b) where C is a constructor, then we like to
      keep it that way, with atomic a,b, so that it can be inlined easily at
      a 'case'.)
      
      But in this case, x3 is inlined in g's RHS... and now x2 is not an arg
      of a let-bound constructor, so it can be inlined, and then x1.   Result:
      
      		g = f (a2 : a1 : a0 : [])
      
      Which is fine.  What is *not* fine is that it has been costing us a
      whole simplifier iteration for each element!
      
      This commit adds another little hack to get around the problem: don't treat
      constructor RHSs specially if the bound variable looks as if it occurs just
      once so it'll be inlined.  This catches the common case very nicely.
      
      It's a pain that we have the atomic-args-for-constructor-RHSs invariant.
      But I can't see  how to do without it.
      916abd02
    • simonmar's avatar
      [project @ 2002-11-20 14:09:42 by simonmar] · 491f66f8
      simonmar authored
      Snapshot of the Eval/Apply changes, c. 15 Nov 2002.  This snapshot
      should be relatively stable, although GHCi and profiling are currently
      known to be broken.
      491f66f8
    • simonmar's avatar
      [project @ 2002-11-20 13:34:20 by simonmar] · 0addb8f5
      simonmar authored
      Back out rev. 1.233
      0addb8f5
    • simonmar's avatar
      [project @ 2002-11-20 13:33:52 by simonmar] · 018351b3
      simonmar authored
      Back out previous change.  I remembered why we don't generate .depend
      each time the sources chage: it's too annoying :-)
      018351b3
    • chak's avatar
      [project @ 2002-11-20 12:34:42 by chak] · cda70f58
      chak authored
      TH:
      - We are forcing importing THSyntax.Q at every top splice now; this suffices
        to get simple splices that do not involve reifyDecl or declaration
        quasi-quotes to work.  NB: This worked already when the construction of the
        Dec term and the splice were in separated modules, but not when they are in
        the same (see the regression test "TH_spliceDecl1.hs").
      - The tests "TH_spliceDecl2.hs" and "TH_spliceDecl3.hs" use toplevel splices
        together with quasi-quoted and reifyDecl.  These currently still fail, as
        importing of some of the required type constructors from THSyntax isn't
        forced.
      cda70f58
    • simonpj's avatar
      [project @ 2002-11-20 09:37:45 by simonpj] · 34a10d66
      simonpj authored
      -----------------------------------------------
      	Add -Werror flag, which makes warnings fatal
      	-----------------------------------------------
      
      -Werror is standard gcc-ism; it makes warnings into fatal errors
      so you don't miss them in a batch compile.
      
      Fairly easy to implement, by modifying ErrUtils.errorsFound
      
      Suggested by Ashley Yakeley
      34a10d66
    • chak's avatar
      [project @ 2002-11-20 07:19:12 by chak] · dac19c07
      chak authored
      TH: Revised type variable handling in toplevel decls (became necessary due to
      recent addition of foralls in type representations).
      dac19c07
  8. 19 Nov, 2002 3 commits
    • simonpj's avatar
      [project @ 2002-11-19 15:57:10 by simonpj] · 0316a9e6
      simonpj authored
      -----------------------------------------------
      	Fix a terrible and long-standing strictness bug
      	-----------------------------------------------
      
      		MERGE TO STABLE
      
      Simplify.simplifyArg was floating out lets from a lazy argument.
      Not only is this unprofitable, but it can actually be wrong it
      the floated let has a strict-demand flag on it.  (Simplify.simplLazyBind
      goes to some trouble to check for this case.)
      
      The situation is this
      
      	lazy_fn (let v = <expensive> in str_fn v v)
      
      Here, the strictness analyser may put a 'demanded' flag on
      v, and if is is *then* floated we'll get
      
      	let v* = <expensive>
      	in
      	lazy_fn (str_fn v v)
      
      and then <expensive> will always be evaluated.
      
      This bug has been in the compiler at least a year (since Sept 01), but
      in fact it's quite hard to make a test case for it, because the same
      bug meant that the let was floated out *before* strictness analysis
      giving
      
      	let v = <expensive>
      	in
      	lazy_fn (str_fn v v)
      
      and now v won't get a strict-demand flag.  So it's only if the let
      shows up (by inlining) after strictness analysis but not before.
      0316a9e6
    • simonpj's avatar
      [project @ 2002-11-19 15:51:16 by simonpj] · 821d7994
      simonpj authored
      Comments
      821d7994
    • simonmar's avatar
      [project @ 2002-11-19 14:16:43 by simonmar] · de7a4a03
      simonmar authored
      - Fix a bug in eta-expansion of an application; it probably never bit
        us in practice.
      
      - Change the behaviour of State#-lambdas: previously a State# lambda
        was considered to be one-shot for the purposes of inlining and
        eta-expansion.  Both can lead to unbounded extra work, but inlining
        is more likely to kill us, and eta-expansion is the case we mostly
        care about (getting the State# lambda to the outside of the function
        is often very important).  So now we only consider a State# lambda to be
        one-shot in eta expansion, not for inlining.
      de7a4a03