1. 28 May, 1999 6 commits
    • simonpj's avatar
      [project @ 1999-05-28 19:19:20 by simonpj] · e3564f89
      simonpj authored
      Make the Enum Integer instance deforestable
      e3564f89
    • simonpj's avatar
      [project @ 1999-05-28 19:18:52 by simonpj] · 9f1b4646
      simonpj authored
      Fix a killer bug in the RULES for 'all' and 'any'
      that simply made them wrong, with various obscure
      consequences.
      9f1b4646
    • simonmar's avatar
      [project @ 1999-05-28 13:32:50 by simonmar] · 207fd30f
      simonmar authored
      Fixes for case-of-case and let-no-escape.
      207fd30f
    • sof's avatar
      [project @ 1999-05-28 13:20:10 by sof] · 83f88146
      sof authored
      semi-automatic support for indexing
      83f88146
    • simonpj's avatar
      [project @ 1999-05-28 08:08:44 by simonpj] · 4a5b2787
      simonpj authored
      Minor wibble to do with module names that contain a Z
      4a5b2787
    • simonpj's avatar
      [project @ 1999-05-28 08:07:52 by simonpj] · 00eefb90
      simonpj authored
      Make the renamer so that the class ops on the LEFT HAND SIDE
      of the bindings of an instance decl count as free variables
      of that declaration.  E.g.
      
      	instance Foo [a] where
      	  op x  = ...
      	  bop y = ...
      
      Here, 'op' and 'bop' are now counted as free variables of
      the decl.
      
      This is vital, because the class decl for Foo might be imported,
      and look like this:
      
      	class Foo a where
      	  op  :: a -> S
      	  bop :: T -> a
      
      and these might happen to be the only mentions of S and T
      in the program.  Then we need to treat S and T as instance
      gates for the purpose of hauling in further instance decls,
      and the Right Way to do that is to announce that 'op' and
      'bop' have been mentioned.
      
      I also removed the (now obselete) rn_omit field in the
      monad.
      00eefb90
  2. 26 May, 1999 2 commits
  3. 24 May, 1999 2 commits
  4. 21 May, 1999 6 commits
  5. 20 May, 1999 1 commit
  6. 18 May, 1999 14 commits
    • simonpj's avatar
      [project @ 1999-05-18 16:38:23 by simonpj] · 45dff0ad
      simonpj authored
      More small changes to make Simon's big commit work
      45dff0ad
    • simonpj's avatar
      [project @ 1999-05-18 16:10:59 by simonpj] · 111e58bd
      simonpj authored
      Small changes to make Simon's big commit work
      111e58bd
    • simonpj's avatar
      [project @ 1999-05-18 15:41:31 by simonpj] · ade3217b
      simonpj authored
      Documentation for rewrite rules.
      
      Some stuff in (a) glasgow exts
      	      (b) debugging
      
      Doubtless incomplete, and since I can't build the
      docs on (my) NT box, I don't even know if my changes
      are syntactically correct!
      ade3217b
    • simonpj's avatar
      [project @ 1999-05-18 15:20:51 by simonpj] · 8e16c2d2
      simonpj authored
      Simon's Prelude changes
      			~~~~~~~~~~~~~~~~~~~~~~~
      
      [The real commit preceded this, but had the stupid message "msg_prel"
       because I used "cvs commit -m" instead of "cvs commit -F"]
      
      Prelude is split into more modules
      	new are: PrelEnum, PrelShow, PrelNum
      	removed: PrelBounded (all in PrelEnum now)
      		 PrelEither  (all in PrelMaybe now)
      
      There are also a lot of RULES, of course.
      8e16c2d2
    • simonpj's avatar
      [project @ 1999-05-18 15:19:15 by simonpj] · 927b3cbb
      simonpj authored
      Renamer changes
      		~~~~~~~~~~~~~~~
      
      [The real commit preceded this, but had the stupid message "msg_rn"
       because I used "cvs commit -m" instead of "cvs commit -F"]
      
      Fairly substantial changes to the renamer:
      
      * opt_PruneTyDecls is gone, gone, gone. Hurrah.  Ditto the 'deferred
        data decls' which was a bug farm.
      
        Instead, the compiler slurps in the transitive closure of all type
        declarations.  It is nevertheless still parsimonious about slurping
        in instance decls and rewrite rules.
      
      * The renamer now uses the usage information stored in each interface
        file to figure out whether to look for A.hi or A.hi-boot when looking
        for a declaration for A.f (say).
      
      * Because of the above, there are no "A!f" symbols in interface files any more.
        However, the header of the interface file does contain a "!" to indicate
        that the mdoule contains "orphan" instance decls or rewrite rules.
      	__interface Foo 3 ! 403 where
      
        Likewise, the usage info contains a "!" to indicate that the module
        mentioned has orphans:
      	import Foo 3 ! :: a 1 b 7 ;
      
      * The renamer now only reads an interface looking for fixities if it
        finds an occurrence of an operator from that module.  (Previously
        it pessimistically read the home modlese of all in-scope variables.)
      
      * Some flags have changed to more consistent names:
      	-ddump-rn-stats		(was -dshow-rn-stats)
      	-ddump-rn-trace		(was -dshow-rn-trace)
      
      * Exports now come before imports in interface files.  (This was an
        un-forced change.)
      
      * The usage info is now explicit when a module imports the whole of another:
      	import M 3 ;		-- Imports the whole of M
      	import M 3 :: a 2 b 7 ;	-- Imports M.a, M.b
      	import M 3 :: ;		-- Imports nothing from M
        The last one is still vital to record that this module depends indirectly
        on M, even though it didn't use anything from M directly.
      
      * The renamer warns if you import {- SOURCE -} unnecessarily.
      927b3cbb
    • simonpj's avatar
      [project @ 1999-05-18 15:17:58 by simonpj] · 3f694c56
      simonpj authored
      SMALL TYPECHECKER FIXES
      
      [The real commit preceded this, but had the stupid message "RULES-NOTES"
       because I used "cvs commit -m" instead of "cvs commit -F"]
      
      1. Allow type synonyms with kind other than '*'
      
      2. Check that the default methods declared in a class decl are
         from that class decl
      3f694c56
    • simonpj's avatar
      [project @ 1999-05-18 15:16:33 by simonpj] · c5b15182
      simonpj authored
      SIMON's MASSIVE COMMIT
      
      [The real commit preceded this, but had the stupid message "RULES-NOTES"
       because I used "cvs commit -m" instead of "cvs commit -F"]
      
      Module reorganisation
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~
      coreSyn/CoreFVs		replaces coreSyn/FreeVars
      coreSyn/CoreTidy	is new (was code in simplCore/SimplCore)
      coreSyn/Subst 		is new (implements substitution incl 
      				dealing with name clashes
      main/CodeOutput		is new (was gruesome code in main/Main)
      parser/rulevar.ugn	Ugen file for rules
      prelude/ThinAir.lhs	is new (defns for "thin air" ids; was in
      				prelude/PrelVals)
      specialise/Rules	is new (implements rewrite rule matching)
      typecheck/TcRules	is new (typechecks rewrite rules)
      types/InstEnv		is new (implements the instance env in Class;
      
      				replaces SpecEnv)
      specialise/SpecEnv	has gone
      simplCore/MagicUFs	has gone (hurrah)
      
      Rewrite rules
      ~~~~~~~~~~~~~
      This major commit adds the ability to specify transformation rules.
      
         E.g. 
         
         {-# RULES
      	   forall f,g,xs. map f (map g xs) = map (f . g) xs
         #-}
      
      The rules are typechecked, and survive across separate compilation.
      
      * specialise/SpecEnv.lhs has gone, replaced by specialise/Rules.lhs.
        Rules.lhs implements transformation-rule matching.
      
      * Info about class instances is no longer held in a SpecEnv in the class;
        instead classes have their own thing, typecheck/InstEnv.lhs
      
      * Specialisations are held in list of rules, held inside an Id.
        So although specialisations arise from SPECIALISE pragmas and
        uses of overloaded functions, they are still expressed as transformation
        rules.  However these rules are held inside the relevant Id, as
        before.  The RULES ones are held globally.
      
      Cloning
      ~~~~~~~
      I've removed -fplease-clone as a simplifier flag.  It complicates the 
      plumbing quite a bit.  The simplifier now simply ensures that there's
      no shadowing in its output.
      
      It's up to other passes to solve their own cloning problems.  It turned
      out to be easy:
      	- SetLevels clones where necessary, so that floating out
      	  doesn't cause a problem.
      
      	- CoreToStg clones so that the code generator can use uniques
      	  for labels
      
      Instead, the simplifier clones by using VarSet.uniqAway to find a unique
      that doesn't conflict with any that are in scope.  If you say -dppr-debug
      you get a trace of how many times uniqAway had to loop before finding a
      suitable unique.  It's too much at present; something to improve.
      
      Flags
      ~~~~~
      * I have stopped -fcase-of-case and friends being 'per-simplfication' 
        flags, and instead made them global 'opt_' things.  This is simpler
        and more efficient, and the extra expressiveness was never used anyway.
      
      * -dsimplifier-stats has been renamed to -ddump-simpl-stats
        and prints much more coherent info than before.
        If you add -dppr-debug you get much more detailed information.
      
      * -ddump-inlinings is more or less as before, but a bit improved.
      
      
      Inlining and inline phase
      ~~~~~~~~~~~~~~~~~~~~~~~~~
      I've moved the crucial inline-control function (now called callSiteInline)
      to CoreUnfold from Simplify, so that all the key inlining decisions are
      made in CoreUnfold.
      
      I've removed IWantToBeINLINEd as an InlinePragInfo on an Id.  Instead, I've
      added a new Note on expressions, InlineMe.  This is much more robust to
      program transformations than the old way.  Essentially, an expression
      wrapped in an InlineMe note looks small to the inliner.
      
      In order to prevent variables on the LHS of transformation rules being inlined
      prematurely, the simplifier maintains a "black list" of variables that should
      not be inlined.  Before each run of the simplifier, it constructs its black
      list based on the "inline phase number", controlled by the per-simplification
      flag -finline-phase1, -finline-phase2 etc.  Details of what happens in the
      different phases are defined by the function CoreUnfold.blackListed.
      
      
      Function and primop arguments
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      I've improved the way that the simplifier deals with strict arguments of functions
      and primops.  These are now both dealt with by Simplify.prepareArgs.  As as result
      strict arguments are no longer case-ifyd in Core.  That happens in the core-to-stg
      transformation. This is important so that transformation rules work easily.
      We want to see		foldr k z (build g)
      	and not		case build g of { x -> foldr k z x }
      
      CoreToStg now takes accouunt of the strictness of functions and primops, to
      ensure that strict arguments are done with case.
      
      
      Cheap primops
      ~~~~~~~~~~~~~
      Primops that are cheap and can't fail (i.e not divide!) reply True to primOpOkForSpeculation.
      Applications of such primops are now allowed to appear in lets (rather than cases),
      so that they are easier to float.  They are honorary lets, in the sense that they can 
      float out or in without damage.  Again core-to-stg turns them into cases.
      
      
      Class op selectors
      ~~~~~~~~~~~~~~~~~~
      Generate bindings for class-op selectors.  The immediate reason for doing this
      is so we can write transformation rules involving them; black-listing won't
      work if they have to be inlined!  The longer-term reason is because Hugs will
      need these bindings. Also there's no point in inling them if the dictionary
      is lambda bound.
      
      
      Simplifier
      ~~~~~~~~~~
      I've made a number of detailed changes to the innards of the simplifier.
      Result is (a bit) less code, and fewer iterations.  Only the biggest modules
      provoke the "more than 4 iterations" complaint.
      
      
      
      ... And tons of other minor stuff ...
      c5b15182
    • simonpj's avatar
      [project @ 1999-05-18 15:03:54 by simonpj] · 69e14f75
      simonpj authored
      RULES-NOTES
      69e14f75
    • simonpj's avatar
      [project @ 1999-05-18 15:03:53 by simonpj] · c9dfd084
      simonpj authored
      Driver updates for Simons main commit; rewrite rules and flaggery
      c9dfd084
    • simonpj's avatar
      [project @ 1999-05-18 15:03:33 by simonpj] · 506fa77d
      simonpj authored
      RULES-NOTES
      506fa77d
    • simonpj's avatar
      [project @ 1999-05-18 14:59:04 by simonpj] · c415cd35
      simonpj authored
      ../compiler/msg_prel
      c415cd35
    • simonpj's avatar
      [project @ 1999-05-18 14:56:06 by simonpj] · 0d8269cc
      simonpj authored
      msg_rn
      0d8269cc
    • simonpj's avatar
      [project @ 1999-05-18 14:55:47 by simonpj] · ab8279d6
      simonpj authored
      msg_tc
      ab8279d6
    • simonm's avatar
      [project @ 1999-05-18 09:19:23 by simonm] · 7e17f862
      simonm authored
      Another sparc/egcs fix.
      7e17f862
  7. 17 May, 1999 2 commits
  8. 14 May, 1999 2 commits
  9. 13 May, 1999 5 commits
    • simonm's avatar
      [project @ 1999-05-13 17:30:50 by simonm] · 589b7946
      simonm authored
      Support for "unregisterised" builds.  An unregisterised build doesn't
      use the assembly mangler, doesn't do tail jumping (uses the
      mini-interpreter), and doesn't use global register variables.
      
      Plenty of cleanups and bugfixes in the process.
      
      Add way 'u' to GhcLibWays to get unregisterised libs & RTS.
      
      [ note: not *quite* working fully yet... there's still a bug or two
        lurking ]
      589b7946
    • sof's avatar
      [project @ 1999-05-13 13:08:24 by sof] · 8997af62
      sof authored
      Added documentation for (yield :: IO ())
      8997af62
    • sof's avatar
      [project @ 1999-05-13 11:03:10 by sof] · 40fc171e
      sof authored
      Testing the Random library (not complete).
      40fc171e
    • sof's avatar
      [project @ 1999-05-13 11:00:07 by sof] · dc83b06b
      sof authored
      randomIvalInteger: The difference between '1' and 'l' is rather slight
      at the level of pixels. At the level of Haskell programs however, the
      difference is rather more pronounced :)
      dc83b06b
    • sof's avatar
      [project @ 1999-05-13 10:52:55 by sof] · f4a9632f
      sof authored
      wibble
      f4a9632f