1. 13 Sep, 2002 3 commits
    • 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
    • simonpj's avatar
      [project @ 2002-09-13 15:01:40 by simonpj] · 69e55e74
      simonpj authored
      Make ghc-pkg independent of hslibs
      69e55e74
    • simonpj's avatar
      [project @ 2002-09-13 08:54:44 by simonpj] · 7e2009cf
      simonpj authored
      Correct comments
      7e2009cf
  2. 11 Sep, 2002 2 commits
  3. 10 Sep, 2002 5 commits
  4. 09 Sep, 2002 13 commits
  5. 07 Sep, 2002 1 commit
  6. 06 Sep, 2002 10 commits
    • panne's avatar
      [project @ 2002-09-06 17:56:40 by panne] · 0716aa8f
      panne authored
      Nuke the unsupported hslibs version of HOpenGL on the HEAD, too. Now
      we are only left with two versions, which I think is OK: A stable one
      (not in the fptools repository, but on my web site) and a cool, but
      *very* incomplete one (currently only GLUT) for bleeding edge people
      in the hierarchical libraries parts of the repository.
      0716aa8f
    • simonmar's avatar
      [project @ 2002-09-06 14:40:28 by simonmar] · c92ddc55
      simonmar authored
      Disallow ForeignObj as well as ForeignPtr FFI arguments
      c92ddc55
    • simonmar's avatar
      [project @ 2002-09-06 14:35:42 by simonmar] · b3e4cb91
      simonmar authored
      Finally separate the compiler from hslibs.
      
      Mainly import wibbles, and use the new POSIX library when
      bootstrapping.
      b3e4cb91
    • simonmar's avatar
      [project @ 2002-09-06 14:34:13 by simonmar] · 77186ef4
      simonmar authored
      Partial rewrite of the POSIX library.
      
      The main purpose of this sweep is to remove the last dependencies of
      the compiler on hslibs.  When I've committed the associated compiler
      changes, only the 'base' package will be required to bootstrap the
      compiler.  Additionally to build GHCi, the 'readline' and 'unix'
      packages will be required.
      
      The new POSIX library lives mostly in libraries/unix, with a few bits
      required for compiler bootstrapping in libraries/base.  The 'base'
      package is mostly free of hsc2hs code to make bootstrapping from HC
      files easier, but the 'unix' package will use hsc2hs liberally.
      
      The old POSIX library continues to provide more-or-less the same
      interface as before, although some of the types are more correct now
      (previously lots of POSIX types were just mapped to Int).  The new
      interface is largely the same as the old, except that some new
      functionality from the latest POSIX spec has been added (eg. symbolic
      links).
      
      So far, the new POSIX library has signal support, directory/file
      operations and lots of stuff from unistd.h.  The module names are:
      
        System.Posix
      	The main dude, exports everything
      
        System.Posix.Types
      	All the POSIX types, using the same naming scheme as
              Foreign.C.Types, Eg. CUid, COff, etc.  Many of these types
              were previously exported by GHC.Posix.
      
              Additionally exports the "nicer" names used by the old POSIX
      	library for compatibility (eg. ProcessID == CPid, FileMode ==
      	CMode, etc.)
      
      	All reasonable instances are derived for these types.
      
        System.Posix.Signals
      	Signal support, contains most of which was in PosixProcPrim before.
      	The RTS interface to the signal handling support has been
      	rationalised slightly.
      
        System.Posix.Directory
       	Directory support, most were in PosixFiles before.
      
        System.Posix.Files
      	File operations, most were in PosixFiles before.
      
        System.Posix.Unistd
      	(for want of a better name) Miscellaneous bits that mostly come
      	from the unistd.h header file.  PosixProcEnv before.
      
      The rest of the library should pan out like so:
      
        System.Posix.IO
        System.Posix.Error   (maybe)
        System.Posix.Process
        System.Posix.Terminal
      
      (I've no doubt broken Win32 support, but I'm checking the build at the moment).
      77186ef4
    • simonmar's avatar
      [project @ 2002-09-06 14:00:25 by simonmar] · 0ceb6ee8
      simonmar authored
      Remove ForeignObj and ForeignPtr keys
      0ceb6ee8
    • simonmar's avatar
      [project @ 2002-09-06 13:58:58 by simonmar] · dc9c5583
      simonmar authored
      Remove foreignPtrTyCon and foreignObjTyCon
      dc9c5583
    • simonmar's avatar
      [project @ 2002-09-06 13:52:21 by simonmar] · 446fbcd7
      simonmar authored
      Disallow ForeignPtr as an FFI argument type.
      446fbcd7
    • simonmar's avatar
      [project @ 2002-09-06 13:51:38 by simonmar] · 21a8a75d
      simonmar authored
      Disallow 'ForeignPtr' as an FFI argument type.  It has been deprecated
      for some time (withForeignPtr is the approved way to pass a
      ForeignPtr).  The changes I'm about to make to ForeignPtr will stop it
      working anyhow.
      21a8a75d
    • simonmar's avatar
      [project @ 2002-09-06 09:56:12 by simonmar] · f8e722a4
      simonmar authored
      Selector Thunk Fix, take II.
      
      The previous version didn't deal well with selector thunks which point
      to more selector thunks, and on closer inspection the method was
      flawed.  Now I've introduced a function
      
      	StgClosure *eval_selector_thunk( int field, StgClosure * )
      
      which evaluates a selector thunk returning its value, in from-space,
      if possible.  It blackholes the thunk during evaluation.  It might
      recursively evaluate more selector thunks, but it does this in a
      bounded way and updates the thunks with indirections (NOT forwarding
      pointers) after evaluation.
      
      This cleans things up somewhat, and I believe it deals properly with
      both types of selector-thunk loops that arise.
      
      MERGE TO STABLE
      f8e722a4
    • ken's avatar
      [project @ 2002-09-06 01:00:04 by ken] · eca38799
      ken authored
      perl made uglier to work around the perl 5.7/5.8 bug documented at
      http://bugs6.perl.org/rt2/Ticket/Display.html?id=1760 and illustrated
      by the seg fault of perl -e '("x\n" x 5000) =~ /(.*\n)+/'
      
      MERGE TO STABLE
      eca38799
  7. 05 Sep, 2002 3 commits
    • simonmar's avatar
      [project @ 2002-09-05 16:26:33 by simonmar] · 8435b2e4
      simonmar authored
      Fix for infinite loop when there is a THUNK_SELECTOR which eventually
      refers to itself, such as might be generated by code like
      
      	let x = (fst x, snd x) in ...
      
      At the same time, I re-enabled the code to traverse multiple selector
      thunks with bounded depth, because I believe it now works.
      
      MERGE TO STABLE (but test thoroughly in the HEAD first, this is
      fragile stuff)
      8435b2e4
    • simonmar's avatar
      [project @ 2002-09-05 10:25:01 by simonmar] · 5ac854ef
      simonmar authored
      In code style, print negative floating point literals in parentheses
      to avoid interacting with surrounding syntax.
      
      Fixes SourceForge bug #604849
      
      MERGE TO STABLE
      5ac854ef
    • simonmar's avatar
      [project @ 2002-09-05 08:58:55 by simonmar] · ed6e7225
      simonmar authored
      Remove RtsAPIDeprec.c, since this is causing grief.  The upshot (I
      think) is that you won't be able to do foreign import "wrapper" with
      an Addr in the type.
      ed6e7225
  8. 04 Sep, 2002 3 commits