1. 05 Jan, 2004 3 commits
  2. 04 Jan, 2004 1 commit
    • igloo's avatar
      [project @ 2004-01-04 01:48:04 by igloo] · 6da2fdc8
      igloo authored
      Split the pretty-printer out - pprint will now give you pretty much
      anything you are likely to want to pretty-print as a String. For a Doc
      you need (to_HPJ_Doc . ppr), which could be made nicer if it is widely
      used.
      
      Also took the opportunity to do a bit of module renaming and fixed the
      odd typo here and there.
      6da2fdc8
  3. 31 Dec, 2003 3 commits
    • simonpj's avatar
      [project @ 2003-12-31 16:55:17 by simonpj] · 1b75cf97
      simonpj authored
      point to bash, not sh
      1b75cf97
    • simonpj's avatar
      [project @ 2003-12-31 08:23:25 by simonpj] · 7473349e
      simonpj authored
      -----------------------------
              Improve deprecation reporting
      	-----------------------------
      
      	[PS: the 1.31 commit of basicTypes/RdrName.lhs
      	 also belongs in this commit.]
      
      Up to now, deprecated functions are only reported when imported
      from the module defining them, but not when re-exporting.  This
      seems wrong -- often a "root" module gathers exports from sub-modules.
      
      It turned out that there was a structural problem: the deprectaions
      were getting put in the GlobalRdrEnv, and it simply doesn't have
      the defining-module's interface to hand.
      
      So this commit removes gre_deprec from GRE, and moves deprecation
      reporting from the individual occurrences (RnEnv.lookupGreRn) to
      RnNames.reportUnusedNames.  In many ways this is a better place for it,
      because there we get a global view of the entire module.  For example,
      repeated use of a single deprecated thing will only give rise to one
      warning instead of multiple warnings.
      
      So here's what we now get:
      
        Foo.hs:3:0:
          Warning: Deprecated use of Variable `withObject'
      	     (imported from Foreign.Marshal, but defined in Foreign.Marshal.Utils)
      	     use `with' instead
      7473349e
    • simonpj's avatar
      [project @ 2003-12-31 08:21:52 by simonpj] · 94a28821
      simonpj authored
      Trim imports
      94a28821
  4. 30 Dec, 2003 4 commits
    • simonpj's avatar
      [project @ 2003-12-30 20:51:24 by simonpj] · 4ab2b24e
      simonpj authored
      Fix imports
      4ab2b24e
    • simonpj's avatar
      [project @ 2003-12-30 20:24:21 by simonpj] · c5a65b17
      simonpj authored
      Typo
      c5a65b17
    • simonpj's avatar
      [project @ 2003-12-30 16:29:17 by simonpj] · f714e6b6
      simonpj authored
      ----------------------------
              Re-do kind inference (again)
      	----------------------------
      
         [WARNING: interface file binary representation has
         (as usual) changed slightly; recompile your libraries!]
      
      Inspired by the lambda-cube, for some time GHC has used
      	type Kind = Type
      That is, kinds were represented by the same data type as types.
      
      But GHC also supports unboxed types and unboxed tuples, and these
      complicate the kind system by requiring a sub-kind relationship.
      Notably, an unboxed tuple is acceptable as the *result* of a
      function but not as an *argument*.  So we have the following setup:
      
      		 ?
      		/ \
      	       /   \
      	      ??   (#)
      	     /  \
                  *   #
      
      where	*    [LiftedTypeKind]   means a lifted type
      	#    [UnliftedTypeKind] means an unlifted type
      	(#)  [UbxTupleKind]     means unboxed tuple
      	??   [ArgTypeKind]      is the lub of *,#
      	?    [OpenTypeKind]	means any type at all
      
      In particular:
      
        error :: forall a:?. String -> a
        (->)  :: ?? -> ? -> *
        (\(x::t) -> ...)	Here t::?? (i.e. not unboxed tuple)
      
      All this has beome rather difficult to accommodate with Kind=Type, so this
      commit splits the two.
      
        * Kind is a distinct type, defined in types/Kind.lhs
      
        * IfaceType.IfaceKind disappears: we just re-use Kind.Kind
      
        * TcUnify.unifyKind is a distinct unifier for kinds
      
        * TyCon no longer needs KindCon and SuperKindCon variants
      
        * TcUnify.zapExpectedType takes an expected Kind now, so that
          in TcPat.tcMonoPatBndr we can express that the bound variable
          must have an argTypeKind (??).
      
      The big change is really that kind inference is much more systematic and
      well behaved.  In particular, a kind variable can unify only with a
      "simple kind", which is built from * and (->).  This deals neatly
      with awkward questions about how we can combine sub-kinding with type
      inference.
      
      Lots of small consequential changes, especially to the kind-checking
      plumbing in TcTyClsDecls.  (We played a bit fast and loose before, and
      now we have to be more honest, in particular about how kind inference
      works for type synonyms.  They can have kinds like (* -> #), so
      
      This cures two long-standing SourceForge bugs
      
      * 753777 (tcfail115.hs), which used erroneously to pass,
        but crashed in the code generator
            type T a = Int -> (# Int, Int #)
            f :: T a -> T a
            f t = \x -> case t x of r -> r
      
      * 753780 (tc167.hs), which used erroneously to fail
            f :: (->) Int# Int#
      
      
      Still, the result is not entirely satisfactory.  In particular
      
      * The error message from tcfail115 is pretty obscure
      
      * SourceForge bug 807249 (Instance match failure on openTypeKind)
        is not fixed.  Alas.
      f714e6b6
    • simonpj's avatar
      [project @ 2003-12-30 14:05:46 by simonpj] · 9e90a28e
      simonpj authored
      Import trimming
      9e90a28e
  5. 28 Dec, 2003 2 commits
  6. 23 Dec, 2003 1 commit
  7. 22 Dec, 2003 1 commit
    • simonmar's avatar
      [project @ 2003-12-22 16:27:10 by simonmar] · 354a661d
      simonmar authored
      Fix threaded RTS problem that is currently causing the conc007 test to
      loop indefinitely.  Comment from the source regarding this change:
      
      /* Major bogosity:
       *
       * In the threaded RTS, we can't set the virtual timer because the
       * thread which has the virtual timer might be sitting waiting for a
       * capability, and the virtual timer only ticks in CPU time.
       *
       * So, possible solutions:
       *
       * (1) tick in realtime.  Not very good, because this ticker is used for
       *     profiling, and this will give us unreliable time profiling
       *     results.  Furthermore, this requires picking a single OS thread
       *     to be the timekeeper, which is a bad idea because the thread in
       *     question might just be making a temporary call into Haskell land.
       *
       * (2) save/restore the virtual timer around excursions into STG land.
       *     Sounds great, but I tried it and the resolution of the virtual timer
       *     isn't good enough (on Linux) - most of our excursions fall
       *     within the timer's resolution and we never make any progress.
       *
       * (3) have a virtual timer in every OS thread.  Might be reasonable,
       *     because most of the time there is only ever one of these
       *     threads running, so it approximates a single virtual timer.
       *     But still quite bogus (and I got crashes when I tried this).
       *
       * For now, we're using (1), but this needs a better solution. --SDM
       */
      354a661d
  8. 19 Dec, 2003 3 commits
    • simonmar's avatar
      [project @ 2003-12-19 10:41:14 by simonmar] · fdb2b1fd
      simonmar authored
      Fix DEBUG & !RTS_SUPPORTS_THREADS build (bogus assertion failure)
      fdb2b1fd
    • simonpj's avatar
      [project @ 2003-12-19 10:39:54 by simonpj] · fc13ed2f
      simonpj authored
      Accept unboxed tuples in type signatures
      fc13ed2f
    • simonpj's avatar
      [project @ 2003-12-19 10:34:51 by simonpj] · 3674a5cc
      simonpj authored
      ---------------------------------------
        Precise locations for duplicate imports
        ---------------------------------------
      
      As a displacment activity I added reporting for duplicate imports
      And more precise locations for the imports themselves.  For example:
      
        module T where
      
        import Maybe (isJust,isJust)
        import Maybe (isJust)
      
      gives
      
      Foo.hs:
          Warning: `isJust' is imported more than once:
      	       imported from Maybe at Foo.hs:4:16-21
      	       imported from Maybe at Foo.hs:3:23-28
      	       imported from Maybe at Foo.hs:3:16-21
      3674a5cc
  9. 18 Dec, 2003 8 commits
  10. 17 Dec, 2003 6 commits
    • sof's avatar
      [project @ 2003-12-17 17:29:28 by sof] · 911a9fad
      sof authored
      merge rev. 1.106.2.3
      911a9fad
    • sof's avatar
      [project @ 2003-12-17 17:18:27 by sof] · 920a3de7
      sof authored
      merge rev. 1.128.2.11
      920a3de7
    • simonmar's avatar
      [project @ 2003-12-17 12:17:18 by simonmar] · 39dbe3c2
      simonmar authored
      Fix up following changes to the Capability API.  (strange, I'm *sure*
      I tested this stuff...)
      39dbe3c2
    • simonpj's avatar
      [project @ 2003-12-17 11:43:13 by simonpj] · 9d458d01
      simonpj authored
      ---------------------------------
        Gate in a few more instance decls
        ---------------------------------
      
      When we have
      	instance T a where...
      
      we need to suck in the instance decl rather more aggressively than we
      were.  (A case I hadn't thought of because it only happens with
      undecideable instances.)
      9d458d01
    • simonpj's avatar
      [project @ 2003-12-17 11:29:40 by simonpj] · ca0b7c66
      simonpj authored
      -----------------------------------------------------
        Fix a subtle loop in the context-reduction machinery
        ----------------------------------------------------
      
      This bug was provoked by a recent change: when trying to prove
      a constraint C, TcSimplify.reduce now adds C to the database before
      trying to prove C, thus building recursive dictionaries.
      
      Two bugs
      a) If we add C's superclasses (which we were) we can now build a
         bogusly-recursive dictionary (see Note [SUPERCLASS-LOOP]).
         Solution: in reduce, add C only (via addIrred NoSCs) and then
         later use addWanted to add its definition plus SCs.
      
      b) Since we can have recursive definitions, the superclass-loop
         handling machinery (findAllDeps) must carry its visited-set
         with it (which it was not doing before)
      
      
      The main file is TcSimplify; but I modified a bunch of others to
      take advantage of new function extendVarSetList
      ca0b7c66
    • panne's avatar
      [project @ 2003-12-17 08:38:14 by panne] · 69e27f1d
      panne authored
      To get wglGetProcAddress on Windows, we have to link with
      opengl32.dll, too, even when we are using Cygwin with X11.
      69e27f1d
  11. 16 Dec, 2003 8 commits