1. 25 Jun, 2001 11 commits
    • simonpj's avatar
      [project @ 2001-06-25 14:36:04 by simonpj] · a5ded1f8
      simonpj authored
      Import wibbles
      a5ded1f8
    • simonpj's avatar
      [project @ 2001-06-25 13:13:58 by simonpj] · f00281df
      simonpj authored
      In nubBy, put argument to eq in the standard order
      f00281df
    • rrt's avatar
      [project @ 2001-06-25 11:11:16 by rrt] · 0282f593
      rrt authored
      Fix so that it compiles on both pre and post 5.00 series compilers.
      0282f593
    • rrt's avatar
      [project @ 2001-06-25 09:49:59 by rrt] · 14e414ec
      rrt authored
      Comment out an uncomfortable ASSERT for now.
      14e414ec
    • rrt's avatar
      [project @ 2001-06-25 09:44:10 by rrt] · 265be40f
      rrt authored
      Add more symbols for mingwin version to get it to work. This still needs
      tidying up.
      265be40f
    • rrt's avatar
      [project @ 2001-06-25 09:34:11 by rrt] · d157569b
      rrt authored
      Remove hacked-in definition of system for mingwin; instead we now just link
      against the new version of systemCmd from lib/std/cbits/system.c.
      d157569b
    • simonpj's avatar
      [project @ 2001-06-25 08:09:57 by simonpj] · d069cec2
      simonpj authored
      ----------------
      	Squash newtypes
      	----------------
      
      This commit squashes newtypes and their coerces, from the typechecker
      onwards.  The original idea was that the coerces would not get in the
      way of optimising transformations, but despite much effort they continue
      to do so.   There's no very good reason to retain newtype information
      beyond the typechecker, so now we don't.
      
      Main points:
      
      * The post-typechecker suite of Type-manipulating functions is in
      types/Type.lhs, as before.   But now there's a new suite in types/TcType.lhs.
      The difference is that in the former, newtype are transparent, while in
      the latter they are opaque.  The typechecker should only import TcType,
      not Type.
      
      * The operations in TcType are all non-monadic, and most of them start with
      "tc" (e.g. tcSplitTyConApp).  All the monadic operations (used exclusively
      by the typechecker) are in a new module, typecheck/TcMType.lhs
      
      * I've grouped newtypes with predicate types, thus:
      	data Type = TyVarTy Tyvar | ....
      		  | SourceTy SourceType
      
      	data SourceType = NType TyCon [Type]
      			| ClassP Class [Type]
      			| IParam Type
      
      [SourceType was called PredType.]  This is a little wierd in some ways,
      because NTypes can't occur in qualified types.   However, the idea is that
      a SourceType is a type that is opaque to the type checker, but transparent
      to the rest of the compiler, and newtypes fit that as do implicit parameters
      and dictionaries.
      
      * Recursive newtypes still retain their coreces, exactly as before. If
      they were transparent we'd get a recursive type, and that would make
      various bits of the compiler diverge (e.g. things which do type comparison).
      
      * I've removed types/Unify.lhs (non-monadic type unifier and matcher),
      merging it into TcType.
      
      Ditto typecheck/TcUnify.lhs (monadic unifier), merging it into TcMType.
      d069cec2
    • simonpj's avatar
      [project @ 2001-06-25 08:08:32 by simonpj] · 3622a7de
      simonpj authored
      ---------------------------
      	Add a new case optimisation
      	---------------------------
      
      I found that lib/std/PrelCError had a case-expression that was
      generating terrible code.   Something like this
      
      	x | p `is` 1 -> e1
      	  | p `is` 2 -> e2
      	...etc...
      
      where @is@ was something like
      
      	p `is` n = p /= (-1) && p == n
      
      This gave rise to a horrible sequence of cases
      
      	case p of
      	  (-1) -> $j p
      	  1    -> e1
      	  DEFAULT -> $j p
      
      and similarly in cascade for all the join points!
      
      
      Solution: add the following transformation:
      
      	case e of		=====>     case e of
      	  C _ -> <expr>			     D v -> ....v....
      	  D v -> ....v....		     DEFAULT -> <expr>
      	  DEFAULT -> <expr>
      
      The point is that we merge common RHSs, at least for the DEFAULT case.
      [One could do something more elaborate but I've never seen it needed.]
      
      This transformation is implemented in SimplUtils.mkCase
      
      
      *** WARNING ***
      	To make this transformation easy, I have switched the convention
      	for DEFAULT clauses.  They must now occur FIRST in the list of
      	alternatives for a Core case expression.  (The semantics is
      	unchanged: they still are a catch-all case.)
      
      	The reason is that DEFAULT clauses sometimes need special treatment,
      	and it's a lot easier to find them at the front.
      
      	The easiest way to be insensitive to this change is to use
      	CoreUtils.findDefault to pull the default clause out.
      
      I've made the (surprisingly few) changes consequent on this changed
      of convention, but they aren't in this commit.  Instead they are part
      of the big commit on newtypes I'm doing at the same time.
      3622a7de
    • simonpj's avatar
      [project @ 2001-06-25 08:01:16 by simonpj] · a12bed53
      simonpj authored
      ----------------------------------
      	Fix a predicate-simplification bug
      	----------------------------------
      
      Fixes a bug pointed out by Marcin
      
          data R = R {f :: Int}
          foo:: (?x :: Int) => R -> R
          foo r = r {f = ?x}
      
          Test.hs:4:
      	Could not deduce `?x :: Int' from the context ()
      	arising from use of implicit parameter `?x' at Test.hs:4
      	In the record update: r {f = ?x}
      	In the definition of `foo': r {f = ?x}
      
      The predicate simplifier was declining to 'inherit' an
      implicit parameter.  This is right for a let-binding, but
      wrong for an expression binding.  For example, a simple
      expression type signature:
      
      		(?x + 1) :: Int
      
      This was rejected because the ?x constraint could not be
      floated out -- but that's wrong for expressions.
      a12bed53
    • sof's avatar
      [project @ 2001-06-25 05:25:31 by sof] · ef934bae
      sof authored
      One RCS  will do
      ef934bae
    • sof's avatar
      [project @ 2001-06-25 01:35:07 by sof] · 2917a645
      sof authored
      With -no-hs-main, don't force PrelMain.o to be linked (=> Main.o)
      2917a645
  2. 23 Jun, 2001 2 commits
  3. 22 Jun, 2001 8 commits
  4. 18 Jun, 2001 4 commits
  5. 15 Jun, 2001 8 commits
  6. 14 Jun, 2001 7 commits
    • rrt's avatar
      [project @ 2001-06-14 16:41:46 by rrt] · 82db18e4
      rrt authored
      Add getExecDir to return current directory of executable on Windows (to find
      config information).
      82db18e4
    • simonpj's avatar
      [project @ 2001-06-14 15:42:35 by simonpj] · 54f9adfa
      simonpj authored
      Windows wibbles
      54f9adfa
    • simonmar's avatar
      [project @ 2001-06-14 14:14:53 by simonmar] · 6e694be0
      simonmar authored
      - CURRENT_DIR isn't used any more
      - TmpFiles doesn't exist
      6e694be0
    • simonmar's avatar
      [project @ 2001-06-14 13:29:30 by simonmar] · e50a36b1
      simonmar authored
      fix typo in Simon's commit (cGHC_RAWCPP ==> GHC_RAWCPP)
      e50a36b1
    • simonpj's avatar
      [project @ 2001-06-14 12:50:05 by simonpj] · 16d5d1c7
      simonpj authored
      ----------------------
      	Installation packaging
      	----------------------
      
      GHC runs various system programs like
      	cp, touch
      	gcc, as, ld etc
      
      On Windows we plan to deliver these programs along with GHC,
      so we have to be careful about where to find them.
      
      This commit isolates all these dependencies in a single module
      
      	main/SysTools.lhs
      
      Most of the #ifdefery for mingw has moved into this module.
      There's some documentation in SysTools.lhs
      
      Along the way I did lots of other cleanups.  In particular
      
        * There is no more 'globbing' needed when calling runSomething
        * All file removal goes via the standard Directory.removeFile
        * TmpFiles.hs has gone; absorbed into SysTools
        * Some DynFlag stuff has moved from DriverFlags to CmdLineOpts
      
      
      Still to do:
      
        **	I'm a bit concerned that calling removeFile one at a time
      	when deleting masses of split-object files is going to be
      	rather slow
      
        **	GHC now expects to find split,mangle,unlit in
      		libdir/extra-bin
      	instead of just
      		libdir
      
      	So something needs to change in the Unix installation scripts
      
        **    The "ineffective C preprocessor" is a perversion and should die
      16d5d1c7
    • simonmar's avatar
      [project @ 2001-06-14 11:46:55 by simonmar] · 8245241e
      simonmar authored
      just move some code around.
      8245241e
    • simonmar's avatar
      [project @ 2001-06-14 09:47:37 by simonmar] · a30fbb32
      simonmar authored
      comment fixes
      a30fbb32