1. 04 Jan, 2005 2 commits
  2. 30 Dec, 2004 1 commit
    • simonpj's avatar
      [project @ 2004-12-30 22:14:59 by simonpj] · 7f05f109
      simonpj authored
      Fix to the pre-Xmas simplifier changes, which should make 
      everything work again.  I'd forgotten to attend to this
      corner.  Still not properly tested I fear.
      
      Also remove dead code from SimplEnv, and simplify the remainder (hooray).
      7f05f109
  3. 27 Dec, 2004 2 commits
  4. 24 Dec, 2004 3 commits
    • simonpj's avatar
      [project @ 2004-12-24 16:14:36 by simonpj] · 339d5220
      simonpj authored
      ---------------------------
                Refactor the simplifier
        	---------------------------
      
      Driven by a GADT bug, I have refactored the simpifier, and the way GHC
      treats substitutions.  I hope I have gotten it right.  Be cautious about updating.
      
      * coreSyn/Subst.lhs has gone
      
      * coreSyn/CoreSubst replaces it, except that it's quite a bit simpler
      
      * simplCore/SimplEnv is added, and contains the simplifier-specific substitution
        stuff
      
      Previously Subst was trying to be all things to all men, and that was making
      it Too Complicated.
      
      There may be a little more code now, but it's much easier to understand.
      339d5220
    • simonpj's avatar
      [project @ 2004-12-24 11:38:09 by simonpj] · 0498d355
      simonpj authored
      Reset the export flag for the new bindings in LiberateCase
      0498d355
    • simonpj's avatar
      [project @ 2004-12-24 11:02:39 by simonpj] · 0ee11df0
      simonpj authored
      Further wibbles to the scoped-tyvar story.
      
      This commit tidies up the ATyVar in TcTyThing, making it
      	ATyVar Name Type
      instead of the previous misleading
      	ATyVar TyVar Type
      
      But the main thing is that we must take care with definitions
      like this:
      
      	type T a = forall b. b -> (a,b)
      
      	f :: forall c. T c
      	f = ...
      
      Here, we want only 'c' to scope over the RHS of f.  The renamer ensures
      that... but we must also take care that we freshly instantiate the 
      expanded type signature (forall c b. b -> (c,b)) before checking f's RHS,
      so that we don't get false sharing between uses of T.
      0ee11df0
  5. 23 Dec, 2004 4 commits
    • simonpj's avatar
      [project @ 2004-12-23 14:59:46 by simonpj] · fdba7999
      simonpj authored
      Simplifications, dead code elimination
      fdba7999
    • simonpj's avatar
      [project @ 2004-12-23 13:44:06 by simonpj] · af3dc1ff
      simonpj authored
      minor nomenclature wibble
      af3dc1ff
    • simonpj's avatar
      [project @ 2004-12-23 11:50:55 by simonpj] · c97ea0ce
      simonpj authored
      Enable scoped type variables only where there is an explicit forall
      c97ea0ce
    • simonpj's avatar
      [project @ 2004-12-23 09:07:30 by simonpj] · e12e0bb7
      simonpj authored
      ---------------------------------
                Template Haskell: names again
        	---------------------------------
      
      On 2 Dec 04 I made this commit (1.58 in Convert.lhs)
      
          Fix a Template Haskell bug that meant that top-level names created
          with newName were not made properly unique.
      
      But that just introduced a new bug!  THe trouble is that names created by
      newName are NameUs; but I was *also* using NameU for names of free varaibles,
      such as the 'x' in the quoted code here
      	f x = $( g [| \y -> (x,y) |])
      
      But when converting to HsSyn, the x and y must be treated diffferently.
      The 'x' must convert to an Exact RdrName, so that it binds to the 'x' that's
      in the type environment; but the 'y' must generate a nice unique RdrName.
      
      So this commit adds NameL for the lexically-scoped bindings like 'x'.
      e12e0bb7
  6. 22 Dec, 2004 3 commits
    • simonpj's avatar
      [project @ 2004-12-22 16:58:34 by simonpj] · 20e39e0e
      simonpj authored
      ----------------------------------------
      	     Add more scoped type variables
      	----------------------------------------
      
      Now the top-level forall'd variables of a type signature scope
      over the right hand side of that function.
      
      	f :: a -> a
      	f x = ....
      
      The type variable 'a' is in scope in the RHS, and in f's patterns.
      
      It's implied by -fglasgow-exts, but can also be switched off independently
      using -fscoped-type-variables (and the -fno variant)
      20e39e0e
    • simonpj's avatar
      [project @ 2004-12-22 12:06:13 by simonpj] · d7c402a3
      simonpj authored
      ----------------------------------------
           New Core invariant: keep case alternatives in sorted order
      	----------------------------------------
      
      We now keep the alternatives of a Case in the Core language in sorted
      order.  Sorted, that is,
      	by constructor tag	for DataAlt
      	by literal		for LitAlt
      
      The main reason is that it makes matching and equality testing more robust.
      But in fact some lines of code vanished from SimplUtils.mkAlts.
      
      
      WARNING: no change to interface file formats, but you'll need to recompile
      your libraries so that they generate interface files that respect the
      invariant.
      d7c402a3
    • simonpj's avatar
      [project @ 2004-12-22 12:04:14 by simonpj] · 1f3a9ff8
      simonpj authored
      --------------------------
      	Add -fwarn-orphans flag
      	--------------------------
      
      This gives a decent report for modules that contain 'orphan' instance and
      rule declarations.  These are to be avoided, because GHC has to proactively
      read the interface file every single time, just in case the instance/rule is
      needed.
      
      The flag just gives a convenient way of identifying the culprits.
      1f3a9ff8
  7. 21 Dec, 2004 12 commits
  8. 20 Dec, 2004 1 commit
    • simonpj's avatar
      [project @ 2004-12-20 17:16:24 by simonpj] · c45a0ac5
      simonpj authored
      --------------------------------
      	Deal properly with dual-renaming
      	--------------------------------
      
      When comparing types and terms, and during matching, we are faced
      with 
      	\x.e1	~   \y.e2
      
      There are many pitfalls here, and GHC has never done the job properly.
      Now, at last it does, using a new abstraction VarEnv.RnEnv2.  See
      comments there for how it works.
      
      There are lots of consequential changes to use the new stuff, especially
      in 
      	types/Type (type comparison), 
      	types/Unify (matching on types)
      	coreSyn/CoreUtils (equality on expressions), 
      	specialise/Rules (matching).
      
      I'm not 100% certain of that I've covered all the bases, so let me
      know if something unexpected happens after you update.  Maybe wait until
      a nightly build has worked ok first!
      c45a0ac5
  9. 18 Dec, 2004 1 commit
    • panne's avatar
      [project @ 2004-12-18 15:45:56 by panne] · f207c9b9
      panne authored
      The documentation breakage continues... >:-( Fixed DocBook. Again: "make html"
      (or the faster "make validate" in the case of DocBook XML) is your friend! >:-(
      f207c9b9
  10. 17 Dec, 2004 5 commits
  11. 16 Dec, 2004 3 commits
    • simonmar's avatar
      [project @ 2004-12-16 10:36:57 by simonmar] · c69886a1
      simonmar authored
      Sanity check when configuring for mingw32: make sure that $CC is a
      mingw gcc before proceeding.
      c69886a1
    • simonmar's avatar
      [project @ 2004-12-16 10:23:44 by simonmar] · 7fd32ef4
      simonmar authored
      --with-gcc: export the CC environment variable, so the setting gets
      picked up by sub-configures.  Perhaps we should be advising people to use
      
        CC=c:/mingw/bin/gcc ./configure
      
      because that works for all configure scripts, not just the top level one.
      
      Background:
      
       - We want --with-gcc to do the right thing, because we don't want
         to require Cygwin users to put c:/mingw/bin first on their
         path: that would break their Cygwin environment.
      
       - The build system should work with *no* gcc on your PATH, as long
         as you use --with-gcc (equivalently, CC=... ./configure).
      7fd32ef4
    • simonpj's avatar
      [project @ 2004-12-16 08:56:15 by simonpj] · 13f7d710
      simonpj authored
      Darn!  Forgot this commit, which killed the nightly build
      13f7d710
  12. 15 Dec, 2004 3 commits
    • simonpj's avatar
      [project @ 2004-12-15 15:28:39 by simonpj] · f8dfc857
      simonpj authored
      Comments only
      f8dfc857
    • simonpj's avatar
      [project @ 2004-12-15 12:51:15 by simonpj] · ab3e6dba
      simonpj authored
      Make ghc/lib/compat/Compat/Directory.hs use the C function
      	__compat_long_path_size, rather than
      	__hscore_long_path_size, as the libraries/ version does
      And make ghc/lib/compat/cbits/directory.c define it.
      
      In this way we avoid spurious duplicate-symbol errors when we
      compile GHC with ghc6.2.1 etc.
      ab3e6dba
    • simonpj's avatar
      [project @ 2004-12-15 12:15:16 by simonpj] · 4fb581f4
      simonpj authored
      Tidy the type of an interactively-bound Id before adding
      it to the environment.  Generally speaking, top level
      environments are assumed to be in tidied form, so we
      don't tidy the types before printing.
      4fb581f4