1. 13 Jan, 2003 1 commit
  2. 10 Jan, 2003 1 commit
  3. 06 Jan, 2003 1 commit
    • simonpj's avatar
      [project @ 2003-01-06 15:30:14 by simonpj] · fcf37c94
      simonpj authored
      --------------------------------------------------------------
      	Several small but tiresome things shown up by Template Haskell
      	--------------------------------------------------------------
      
      1. Make the 'knot' in TcRnDriver much smaller; in fact move it to
         TcIfaceSig.tcInterfaceSigs.  Reasons
      	a) much tidier
      	b) avoids a loop in Template Haskell, when we try to run
      	   an expression during type checking (when the knot is
      	   not fully tied)
      
         See comments in TcIfaceSig
      
      2. Stop typechecking if tcGroup fails.  Reason: otherwise tcLookup can
         fail in the next group.
      
      3. Catch linking errors more gracefully when running a splice (in TcSplice)
      fcf37c94
  4. 28 Nov, 2002 1 commit
    • 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
  5. 21 Nov, 2002 1 commit
  6. 20 Nov, 2002 2 commits
    • simonpj's avatar
      [project @ 2002-11-20 15:40:32 by simonpj] · c0624c76
      simonpj authored
      Wibble to fix :info
      c0624c76
    • 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
  7. 25 Oct, 2002 2 commits
    • simonpj's avatar
      [project @ 2002-10-25 21:58:24 by simonpj] · 264cc860
      simonpj authored
      Import wibbles
      264cc860
    • simonpj's avatar
      [project @ 2002-10-25 15:23:03 by simonpj] · 4ef18ea2
      simonpj authored
      ------------------------
      	More dependency fiddling
      	------------------------
      
      	WARNING: Interface file format has changed (again)
      		 You need to 'make clean' in all library code
      
      * Orphan modules are now kept separately
        Home-package dependencies now contain only home-package dependencies!
        See HscTypes.Dependencies
      
      * Linker now uses the dependencies to do dynamic linking
      
      Result: Template Haskell should work even without --make (not yet tested)
      4ef18ea2
  8. 24 Oct, 2002 1 commit
    • simonpj's avatar
      [project @ 2002-10-24 14:17:46 by simonpj] · e0445ffa
      simonpj authored
      ------------------------------------------
      	1. New try and module and package dependencies
      	2. OrigNameCache always contains final info
      	------------------------------------------
      
      These things nearly complete sorting out the incremental
      linking problem that started us off!
      
      1. This commit separates two kinds of information:
      
        (a) HscTypes.Dependencies:
      	What (i)  home-package modules, and
      	     (ii) other packages
            this module depends on, transitively.
      
            That is, to link the module, it should be enough
            to link the dependent modules and packages (plus
            any C stubs etc).
      
            Along with this info we record whether the dependent module
            is (a) a boot interface or (b) an orphan module.  So in
            fact (i) can contain non-home-package modules, namely the
            orphan ones in other packages (sigh).
      
        (b) HscTypes.Usage:
            What version of imported things were used to
            actually compile the module.  This info is used for
            recompilation control only.
      
      
      
      2. The Finder now returns a correct Module (incl package indicator)
      first time, so we can install the absolutely final Name in the
      OrigNameCache when we first come across an occurrence of that name,
      even if it's only an occurrence in an unfolding in some other interface
      file.  This is much tidier.
      
      As a result Module.lhs is much cleaner
      	No DunnoYet
      	No mkVanillaModule
      ALl very joyful stuff.
      e0445ffa
  9. 18 Oct, 2002 1 commit
  10. 15 Oct, 2002 1 commit
    • simonpj's avatar
      [project @ 2002-10-15 11:52:31 by simonpj] · 5c614bc5
      simonpj authored
      ------------------------------------------------
      	Fix exports for a module with  no local bindings
      	------------------------------------------------
      
      Fix the export-list generation for a module with no local bindings.
      This one bug was breaking a bunch of modxxx tests, plus some renamer
      test, plus a desugarer test.
      5c614bc5
  11. 09 Oct, 2002 4 commits
  12. 27 Sep, 2002 1 commit
    • simonpj's avatar
      [project @ 2002-09-27 08:20:43 by simonpj] · dbc254c3
      simonpj authored
      --------------------------------
              Implement recursive do-notation
      	--------------------------------
      
      This commit adds recursive do-notation, which Hugs has had for some time.
      
      	mdo { x <- foo y ;
      	      y <- baz x ;
      	      return (y,x) }
      
      turns into
      
      	do { (x,y) <- mfix (\~(x,y) -> do { x <- foo y;
      					    y <- baz x }) ;
      	     return (y,x) }
      
      This is all based on work by Levent Erkok and John Lanuchbury.
      
      The really tricky bit is in the renamer (RnExpr.rnMDoStmts) where
      we break things up into minimal segments.  The rest is easy, including
      the type checker.
      
      Levent laid the groundwork, and Simon finished it off. Needless to say,
      I couldn't resist tidying up other stuff, so there's no guaranteed I
      have not broken something.
      dbc254c3
  13. 17 Sep, 2002 1 commit
    • simonpj's avatar
      [project @ 2002-09-17 13:00:14 by simonpj] · 451a42dc
      simonpj authored
      --------------------------------------
      	Another attempt to make unbound type
      	variables in RULES work right
      	--------------------------------------
      
      Sigh.  I'm trying to find the unbound type variables on the LHS of a
      RULE.  I thought I could just gather free vars, but that does not work
      well on an un-zonked LHS, because a big lambda might bind a type variable
      that looks different (pre-zonking) but isn't really.
      
      Oh well, back to plan B which is more work but more robust.
      
      Now the zonking phase (in TcHsSyn) arranges to zonk types in a different
      way (zonkTypeCollecting) on a rule LHS than in ordinary expressions
      (zonkTypeZapping).  This is less dependent on the exact form of the LHS
      (good) but involves another mutable variable (not unclean, but it's sad
      to have to admit that mutable variables do sometimes allow you to make
      non-invasive changes).
      451a42dc
  14. 13 Sep, 2002 1 commit
    • simonpj's avatar
      [project @ 2002-09-13 15:02:25 by simonpj] · 9af77fa4
      simonpj authored
      --------------------------------------
      	Make Template Haskell into the HEAD
      	--------------------------------------
      
      This massive commit transfers to the HEAD all the stuff that
      Simon and Tim have been doing on Template Haskell.  The
      meta-haskell-branch is no more!
      
      WARNING: make sure that you
      
        * Update your links if you are using link trees.
          Some modules have been added, some have gone away.
      
        * Do 'make clean' in all library trees.
          The interface file format has changed, and you can
          get strange panics (sadly) if GHC tries to read old interface files:
          e.g.  ghc-5.05: panic! (the `impossible' happened, GHC version 5.05):
      	  Binary.get(TyClDecl): ForeignType
      
        * You need to recompile the rts too; Linker.c has changed
      
      
      However the libraries are almost unaltered; just a tiny change in
      Base, and to the exports in Prelude.
      
      
      NOTE: so far as TH itself is concerned, expression splices work
      fine, but declaration splices are not complete.
      
      
      		---------------
      		The main change
      		---------------
      
      The main structural change: renaming and typechecking have to be
      interleaved, because we can't rename stuff after a declaration splice
      until after we've typechecked the stuff before (and the splice
      itself).
      
      * Combine the renamer and typecheker monads into one
      	(TcRnMonad, TcRnTypes)
        These two replace TcMonad and RnMonad
      
      * Give them a single 'driver' (TcRnDriver).  This driver
        replaces TcModule.lhs and Rename.lhs
      
      * The haskell-src library package has a module
      	Language/Haskell/THSyntax
        which defines the Haskell data type seen by the TH programmer.
      
      * New modules:
      	hsSyn/Convert.hs 	converts THSyntax -> HsSyn
      	deSugar/DsMeta.hs 	converts HsSyn -> THSyntax
      
      * New module typecheck/TcSplice type-checks Template Haskell splices.
      
      		-------------
      		Linking stuff
      		-------------
      
      * ByteCodeLink has been split into
      	ByteCodeLink	(which links)
      	ByteCodeAsm	(which assembles)
      
      * New module ghci/ObjLink is the object-code linker.
      
      * compMan/CmLink is removed entirely (was out of place)
        Ditto CmTypes (which was tiny)
      
      * Linker.c initialises the linker when it is first used (no need to call
        initLinker any more).  Template Haskell makes it harder to know when
        and whether to initialise the linker.
      
      
      	-------------------------------------
      	Gathering the LIE in the type checker
      	-------------------------------------
      
      * Instead of explicitly gathering constraints in the LIE
      	tcExpr :: RenamedExpr -> TcM (TypecheckedExpr, LIE)
        we now dump the constraints into a mutable varabiable carried
        by the monad, so we get
      	tcExpr :: RenamedExpr -> TcM TypecheckedExpr
      
        Much less clutter in the code, and more efficient too.
        (Originally suggested by Mark Shields.)
      
      
      		-----------------
      		Remove "SysNames"
      		-----------------
      
      Because the renamer and the type checker were entirely separate,
      we had to carry some rather tiresome implicit binders (or "SysNames")
      along inside some of the HsDecl data structures.  They were both
      tiresome and fragile.
      
      Now that the typechecker and renamer are more intimately coupled,
      we can eliminate SysNames (well, mostly... default methods still
      carry something similar).
      
      		-------------
      		Clean up HsPat
      		-------------
      
      One big clean up is this: instead of having two HsPat types (InPat and
      OutPat), they are now combined into one.  This is more consistent with
      the way that HsExpr etc is handled; there are some 'Out' constructors
      for the type checker output.
      
      So:
      	HsPat.InPat	--> HsPat.Pat
      	HsPat.OutPat	--> HsPat.Pat
      	No 'pat' type parameter in HsExpr, HsBinds, etc
      
      	Constructor patterns are nicer now: they use
      		HsPat.HsConDetails
      	for the three cases of constructor patterns:
      		prefix, infix, and record-bindings
      
      	The *same* data type HsConDetails is used in the type
      	declaration of the data type (HsDecls.TyData)
      
      Lots of associated clean-up operations here and there.  Less code.
      Everything is wonderful.
      9af77fa4