1. 17 Feb, 2003 1 commit
  2. 13 Feb, 2003 1 commit
    • sof's avatar
      [project @ 2003-02-13 01:50:04 by sof] · d3b10fea
      sof authored
      Be sensitive to filenames containing spaces when processing
      :load & :add commands. Ditto when interpreting filenames given
      on GHCi's cmd-line.
      
      Merge to STABLE.
      d3b10fea
  3. 12 Feb, 2003 1 commit
    • simonpj's avatar
      [project @ 2003-02-12 15:01:31 by simonpj] · 42b63073
      simonpj authored
      -------------------------------------
        Big upheaval to the way that constructors are named
      	-------------------------------------
      
      This commit enshrines the new story for constructor names.  We could never
      really get External Core to work nicely before, but now it does.
      
      The story is laid out in detail in the Commentary
      	ghc/docs/comm/the-beast/data-types.html
      so I will not repeat it here.
      
      	[Manuel: the commentary isn't being updated, apparently.]
      
      However, the net effect is that in Core and in External Core, contructors look
      like constructors, and the way things are printed is all consistent.
      
      It is a fairly pervasive change (which is why it has been so long postponed),
      but I hope the question is now finally closed.
      
      All the libraries compile etc, and I've run many tests, but doubtless there will
      be some dark corners.
      42b63073
  4. 27 Dec, 2002 1 commit
    • panne's avatar
      [project @ 2002-12-27 12:20:06 by panne] · 24a7d2d2
      panne authored
      -#include cleanup. What we really need here are additional prototypes
      for 'getAllocations' and 'revertCAFs', but these are only available
      via RTS headers. I'm not sure if -#including them somehow would be OK,
      so I left this out. A few lines of documentation who is allowed to
      #include (or -#include) what would be helpful...
      24a7d2d2
  5. 19 Dec, 2002 2 commits
  6. 12 Dec, 2002 1 commit
  7. 05 Dec, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-12-05 12:36:54 by simonmar] · 6dda11d0
      simonmar authored
      Don't put a recursive exception handler around the flushing of
      stdout/stderr after running a command.  If the user closes stdout or
      stderr, we now fail rather than going into an infinite loop.
      6dda11d0
  8. 17 Oct, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-10-17 14:49:52 by simonmar] · f9449b97
      simonmar authored
      - Don't flush the finder cache after adding a new package.  We'll
        assume that packages don't overlap.
      
      - Add the extra command-line flags specified by a package when we
        add a package from the GHCi prompt.
      f9449b97
  9. 15 Oct, 2002 1 commit
  10. 14 Oct, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-10-14 14:54:16 by simonmar] · 3312cb59
      simonmar authored
      Put stdin back into non-blocking mode after calling readline, because
      readline sometimes clears the O_NONBLOCK flag (done using the
      GHC.Posix interface, so it shouldn't break Win32).
      3312cb59
  11. 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
  12. 06 Sep, 2002 1 commit
  13. 29 Aug, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-08-29 15:44:11 by simonmar] · ce9687a5
      simonmar authored
      Housekeeping:
      
        - The main goal is to remove dependencies on hslibs for a
          bootstrapped compiler, leaving only a requirement that the
          packages base, haskell98 and readline are built in stage 1 in
          order to bootstrap.  We're almost there: Posix is still required
          for signal handling, but all other dependencies on hslibs are now
          gone.
      
          Uses of Addr and ByteArray/MutableByteArray array are all gone
          from the compiler.  PrimPacked defines the Ptr type for GHC 4.08
          (which didn't have it), and it defines simple BA and MBA types to
          replace uses of ByteArray and MutableByteArray respectively.
      
        - Clean up import lists.  HsVersions.h now defines macros for some
          modules which have moved between GHC versions.  eg. one now
          imports 'GLAEXTS' to get at unboxed types and primops in the
          compiler.
      
          Many import lists have been sorted as per the recommendations in
          the new style guidelines in the commentary.
      
      I've built the compiler with GHC 4.08.2, 5.00.2, 5.02.3, 5.04 and
      itself, and everything still works here.  Doubtless I've got something
      wrong, though.
      ce9687a5
  14. 05 Aug, 2002 1 commit
  15. 26 Jul, 2002 1 commit
    • sof's avatar
      [project @ 2002-07-26 03:06:58 by sof] · 6b269a43
      sof authored
      interactiveLoop{mingw32}: always show prompt under mingw.
      
      hIsTerminalDevice returns True iff stdin is connected to a Console
      under Win32. Which it is when running in a command shell
      (DOS,bash etc.), but Emacs sub-shells don't get a Console of their
      own when invoked. So, just disable this feature (whose motivation
      somewhat escapes me.)
      6b269a43
  16. 17 Jul, 2002 1 commit
  17. 02 Jul, 2002 2 commits
  18. 12 Jun, 2002 1 commit
    • wolfgang's avatar
      [project @ 2002-06-12 22:04:25 by wolfgang] · 643a2f70
      wolfgang authored
      Added support for Frameworks on MacOS X.
      *) On MacOS X, two additional command-line options are supported:
      -framework <FRAMEWORK>    link with framework, gets passed on to ld
      -framework-path <PATH>    gets passed on to ld as "-F<PATH>". (-F is already taken for GHC).
      *) Two corresponding additional options for package.conf files:
      framework_dirs
      extra_frameworks
      These options are allowed on any platform. They are ignored everywhere except on MacOS X.
      *) ghc-pkg no longer uses Read. Instead, it uses a Happy parser. ghc/utils/ghc-pkg/ParsePkgConfLite.y is basically a copy of ghc/compiler/main/ParsePkgConf.y. "Light" refers to the fact that it doesn't depend on other GHC modules and has less sophisticated error reporting.
      *) Frameworks will need some additional work for GHCi.
      643a2f70
  19. 04 Jun, 2002 1 commit
  20. 01 May, 2002 3 commits
    • sof's avatar
      [project @ 2002-05-01 17:56:52 by sof] · 2ac92d88
      sof authored
      mapM ~> mapM_
      2ac92d88
    • simonmar's avatar
      [project @ 2002-05-01 15:48:48 by simonmar] · 80082734
      simonmar authored
      Clean up the code to load a dynamic library some more and hopefully
      make it work on Windows (untested).
      80082734
    • simonmar's avatar
      [project @ 2002-05-01 15:46:14 by simonmar] · 786db576
      simonmar authored
      Cleanup and overhaul the bogus dynamic library loading code in
      InteractiveUI.  Bugs fixed:
      
        - when linking in extra_libraries from a package,
          we now search library_paths in addition to the default
          dlopen() paths.
      
        - the path-searching machinery for dynamic libraries specified
          on the command line was broken, it didn't work unless the library
          was found on the first path in the list.
      786db576
  21. 24 Apr, 2002 1 commit
  22. 18 Apr, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-04-18 11:27:59 by simonmar] · 51173e3c
      simonmar authored
      Don't use doesFileExist on mingw32 as a replacement for checkPerms -
      the argument might be a directory, in which case the result will be
      False.  Just return True instead - if the file/directory doesn't
      exist, the open operation will fail later.
      51173e3c
  23. 11 Apr, 2002 1 commit
  24. 05 Apr, 2002 1 commit
  25. 02 Apr, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-04-02 10:18:07 by simonmar] · 8f3023cf
      simonmar authored
      - Reverse the meaning of the *-prefix in the :module and :browse
        commands: '*Foo' now means the full contents of Foo, whereas just
        'Foo' means Foo's exports only.  This seems more intuitive to me,
        but the downside is that ':m Foo' doesn't do the same thing in
        GHC as Hugs (you have to say ':m *Foo' to get Hugs's behaviour).
      
      - Update the help text
      8f3023cf
  26. 28 Feb, 2002 1 commit
  27. 13 Feb, 2002 2 commits
    • simonmar's avatar
      [project @ 2002-02-13 15:56:18 by simonmar] · e8d5235b
      simonmar authored
      Refer to stdout as IO.stdout, not PrelHandle.stdout, and similarly for stderr.
      e8d5235b
    • simonpj's avatar
      [project @ 2002-02-13 15:19:17 by simonpj] · 711e4d7a
      simonpj authored
      ----------------------------------
      	Do the Right Thing for TyCons where we
      	can't see all their constructors.
      	----------------------------------
      
      Inside a TyCon, three things can happen
      
      1. GHC knows all the constructors, and has them to hand.
         (Nowadays, there may be zero constructors.)
      
      2. GHC knows all the constructors, but has declined to slurp
         them all in, to avoid sucking in more declarations than
         necessary.  All we remember is the number of constructors,
         so we can get the return convention right.
      
      3. GHC doesn't know anything. This happens *only* for decls
         coming from .hi-boot files, where the programmer declines to
         supply a representation.
      
      Until now, these three cases have been conflated together.  Matters
      are worse now that a TyCon really can have zero constructors.  In
      fact, by confusing (3) with (1) we can actually generate bogus code.
      
      With this commit, the dataCons field of a TyCon is of type:
      
      data DataConDetails datacon
        = DataCons [datacon]	-- Its data constructors, with fully polymorphic types
      			-- A type can have zero constructors
      
        | Unknown		-- We're importing this data type from an hi-boot file
      			-- and we don't know what its constructors are
      
        | HasCons Int		-- In a quest for compilation speed we have imported
      			-- only the number of constructors (to get return
      			-- conventions right) but not the constructors themselves
      
      This says exactly what is going on.  There are lots of consequential small
      changes.
      711e4d7a
  28. 12 Feb, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-02-12 15:17:13 by simonmar] · 2cc5b907
      simonmar authored
      Switch over to the new hierarchical libraries
      ---------------------------------------------
      
      This commit reorganises our libraries to use the new hierarchical
      module namespace extension.
      
      The basic story is this:
      
         - fptools/libraries contains the new hierarchical libraries.
           Everything in here is "clean", i.e. most deprecated stuff has
           been removed.
      
      	- fptools/libraries/base is the new base package
      	  (replacing "std") and contains roughly what was previously
      	  in std, lang, and concurrent, minus deprecated stuff.
      	  Things that are *not allowed* in libraries/base include:
      		Addr, ForeignObj, ByteArray, MutableByteArray,
      		_casm_, _ccall_, ``'', PrimIO
      
      	  For ByteArrays and MutableByteArrays we use UArray and
      	  STUArray/IOUArray respectively now.
      
      	  Modules previously called PrelFoo are now under
      	  fptools/libraries/GHC.  eg. PrelBase is now GHC.Base.
      
      	- fptools/libraries/haskell98 provides the Haskell 98 std.
      	  libraries (Char, IO, Numeric etc.) as a package.  This
      	  package is enabled by default.
      
      	- fptools/libraries/network is a rearranged version of
      	  the existing net package (the old package net is still
      	  available; see below).
      
      	- Other packages will migrate to fptools/libraries in
      	  due course.
      
           NB. you need to checkout fptools/libraries as well as
           fptools/hslibs now.  The nightly build scripts will need to be
           tweaked.
      
         - fptools/hslibs still contains (almost) the same stuff as before.
           Where libraries have moved into the new hierarchy, the hslibs
           version contains a "stub" that just re-exports the new version.
           The idea is that code will gradually migrate from fptools/hslibs
           into fptools/libraries as it gets cleaned up, and in a version or
           two we can remove the old packages altogether.
      
         - I've taken the opportunity to make some changes to the build
           system, ripping out the old hslibs Makefile stuff from
           mk/target.mk; the new package building Makefile code is in
           mk/package.mk (auto-included from mk/target.mk).
      
           The main improvement is that packages now register themselves at
           make boot time using ghc-pkg, and the monolithic package.conf
           in ghc/driver is gone.
      
           I've updated the standard packages but haven't tested win32,
           graphics, xlib, object-io, or OpenGL yet.  The Makefiles in
           these packages may need some further tweaks, and they'll need
           pkg.conf.in files added.
      
         - Unfortunately all this rearrangement meant I had to bump the
           interface-file version and create a bunch of .hi-boot-6 files :-(
      2cc5b907
  29. 28 Jan, 2002 2 commits
  30. 24 Jan, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-01-24 16:55:35 by simonmar] · 03b874e7
      simonmar authored
      Add support for Hugs's :browse (or :b) command.  There are two forms:
      
      	- :b M   (interpreted modules only) shows everything
                defined in M - the types of top-level functions,
      	  and definitions of classes and datatypes.
      
      	- :b *M  shows everything exported from module M.
      	  Available for both compiled and interpreted modules.
      
      The user interface is subject to change, but for now it is consistent
      with the new semantics of the :module command.
      
      The implementation is a little tricky, since for a package module we
      have to be sure to slurp in all the required declarations first.
      03b874e7
  31. 23 Jan, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-01-23 16:50:46 by simonmar] · 92cdc09e
      simonmar authored
      - Implement an alternative :module syntax so we can play around with it.
      
      - Implement ':show bindings' and ':show modules'
      
      - Fix a bug whereby doing :info on a local binding would cause a panic
        (this needs to be merged to STABLE - the change is part of the patch
        to HscMain).
      
      - Some cleanups in InteractiveUI.hs
      92cdc09e
  32. 22 Jan, 2002 2 commits
  33. 09 Jan, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-01-09 12:41:45 by simonmar] · f587e76c
      simonmar authored
      First cut at enhancing the facilities for manipulating the scope in
      GHCi.  The scope now consists of
      
        1. the full top-level scope of zero or more interpreted modules
        2. the exports from zero or more modules
        3. the temporary bindings
      
      The sets 1 & 2 are manipulated using an extended :m command: eg :m +A
      will add module A to either set 1 or two depending on whether A is
      interpreted, and :m -A will remove it.  The user interface may change,
      pending feedback from the punters on the mailing list.
      
      'Prelude' is automatically added to the scope if set 1 is empty and
      set 2 doesn't already contain it.
      
      We now cache the GlobalRdrEnv for the current scope between
      evaluations in the InteractiveContext, and also the current
      PrintUnqualified setting (which also depends on the scope).
      
      Cvs: ----------------------------------------------------------------------
      f587e76c