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. 09 Jan, 2003 1 commit
    • simonmar's avatar
      [project @ 2003-01-09 10:49:21 by simonmar] · 78dddbd2
      simonmar authored
      Further refine the criteria for deciding whether command line
      arguments should be passed to the compilation manager or the linker.
      See comments in the file.
      
      MERGE TO STABLE
      78dddbd2
  4. 17 Dec, 2002 3 commits
    • simonmar's avatar
      [project @ 2002-12-17 12:29:48 by simonmar] · 840871d4
      simonmar authored
      On second thoughts, use memcmp instead.
      840871d4
    • simonmar's avatar
      [project @ 2002-12-17 12:27:30 by simonmar] · 931f16bb
      simonmar authored
      Oops, cmpFS uses strcmp() to compare strings, so it has a '\0'
      terminator requirement.  Fix it to use strncmp() instead.
      931f16bb
    • simonmar's avatar
      [project @ 2002-12-17 11:39:41 by simonmar] · 4be8b8b3
      simonmar authored
      Fix recent breakage on the HEAD.  This was caused by the fix to
      Lex.lhs to treat primitive strings as "narrow" FastStrings in all
      cases, rather than Unicode ("wide") FastStrings if the string
      contained a '\0'.  The problem is that narrow FastStrings aren't set
      up to handle strings containing '\0'.  They used to be, but it got
      broken somewhere along the line.
      
      This commit:
      
       - remove the '\0' test from unpackCStringBA (it takes a length
         argument anyway), and rename it to unpackNBytesBA.  This fixes
         the bug.
      
       - remove the '\0' terminator from all strings generated by the
         functions in PrimPacked.  The terminators aren't required,
         as far as I can tell.  This should have a tiny but positive
         effect on compile times.
      
      MERGE TO STABLE
      4be8b8b3
  5. 12 Dec, 2002 2 commits
  6. 11 Nov, 2002 1 commit
    • simonpj's avatar
      [project @ 2002-11-11 10:53:28 by simonpj] · 0adb7175
      simonpj authored
      ------------------
        	   Fix a newtype-deriving bug
      		------------------
      
      The new newtype-deriving mechanism was erroneously using the
      *representation type* of the newtype.  The rep type looks through all
      ihtermediate newtypes, so that is wrong.  See Note [newtype
      representation] in TcDeriv.lhs
      
      deriving/should_run/drvrun013 now tests for this.
      0adb7175
  7. 15 Oct, 2002 2 commits
  8. 14 Oct, 2002 1 commit
  9. 11 Oct, 2002 1 commit
  10. 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
  11. 18 Sep, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-09-18 10:51:01 by simonmar] · fb1b5b07
      simonmar authored
      Fix up exception handling when reading an interface file, and make it
      compile with 4.08.x again.
      
      GhcExceptions weren't being caught by readIface, so an error when
      reading an interface could be unintentionally fatal (errors should be
      soft when reading the old interface file for the current module).
      Also, the Interrupted exception should not be caught by readIface,
      because we want ^C to behave as normal when reading interface files
      (currently it causes an interface-file read error rather than
      interrupting the whole compiler).
      
      Some exception-related compatibility functions have been moved from
      Util to Panic.
      fb1b5b07
  12. 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
  13. 10 Sep, 2002 1 commit
  14. 06 Sep, 2002 1 commit
  15. 30 Aug, 2002 1 commit
  16. 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
  17. 10 Jul, 2002 1 commit
  18. 04 Jul, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-07-04 10:38:49 by simonmar] · 91ccd272
      simonmar authored
      In hPutLitString, catch the empty string case before calling hPutBuf.
      Some older versions of hPutBufFull choke on a zero-length buffer.
      
      Fixes occasional problems with the Sparc native code generator, which
      uses SLIT("") in a couple of places.
      91ccd272
  19. 27 May, 2002 1 commit
  20. 24 May, 2002 1 commit
  21. 11 May, 2002 1 commit
  22. 10 May, 2002 1 commit
  23. 03 May, 2002 1 commit
  24. 01 May, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-05-01 09:30:04 by simonmar] · dd9e1672
      simonmar authored
      - When converting ModuleNames to Modules for use in the the module
        initialisation code, look them up in the IfaceTable(s) instead of
        calling findModule again.  They are guaranteed to be in either
        the HomeIfaceTable or the PackageIfaceTable after the renamer,
        so this saves some trips to the filesystem.  Also, move this
        code earlier in the compilation cycle to avoid holding on to the
        renamed syntax for too long (not sure if this makes a difference or
        not, but it definitely looked space-leakish before).
      
      - remove Util.unJust, it is a duplicate of Maybes.expectJust
      dd9e1672
  25. 29 Apr, 2002 2 commits
    • simonmar's avatar
      [project @ 2002-04-29 16:17:55 by simonmar] · 8c4bd898
      simonmar authored
      - Fix bootstrapped compilation,
      
      - Add the following RULE:
      
      	text "abc"  ==> ptext SLIT("abc")
      
        so most of the time there shouldn't be any need to use SLIT().
        I'll go around and apply the opposite of the above RULE once
        I've convinced myself that the RULE does what it should.
      8c4bd898
    • simonmar's avatar
      [project @ 2002-04-29 14:03:38 by simonmar] · b085ee40
      simonmar authored
      FastString cleanup, stage 1.
      
      The FastString type is no longer a mixture of hashed strings and
      literal strings, it contains hashed strings only with O(1) comparison
      (except for UnicodeStr, but that will also go away in due course).  To
      create a literal instance of FastString, use FSLIT("..").
      
      By far the most common use of the old literal version of FastString
      was in the pattern
      
      	  ptext SLIT("...")
      
      this combination still works, although it doesn't go via FastString
      any more.  The next stage will be to remove the need to use this
      special combination at all, using a RULE.
      
      To convert a FastString into an SDoc, now use 'ftext' instead of
      'ptext'.
      
      I've also removed all the FAST_STRING related macros from HsVersions.h
      except for SLIT and FSLIT, just use the relevant functions from
      FastString instead.
      b085ee40
  26. 22 Apr, 2002 2 commits
  27. 11 Apr, 2002 1 commit
    • simonpj's avatar
      [project @ 2002-04-11 12:03:29 by simonpj] · a7b95beb
      simonpj authored
      -------------------
      	Mainly derived Read
      	-------------------
      
      This commit is a tangle of several things that somehow got wound up
      together, I'm afraid.
      
      
      The main course
      ~~~~~~~~~~~~~~~
      Replace the derived-Read machinery with Koen's cunning new parser
      combinator library.   The result should be
      	* much smaller code sizes from derived Read
      	* faster execution of derived Read
      
      WARNING: I have not thoroughly tested this stuff; I'd be glad if you did!
      	 All the hard work is done, but there may be a few nits.
      
      The Read class gets two new methods, not exposed
      in the H98 inteface of course:
        class Read a where
          readsPrec    :: Int -> ReadS a
          readList     :: ReadS [a]
          readPrec     :: ReadPrec a		-- NEW
          readListPrec :: ReadPrec [a]	-- NEW
      
      There are the following new libraries:
      
        Text.ParserCombinators.ReadP		Koens combinator parser
        Text.ParserCombinators.ReadPrec	Ditto, but with precedences
      
        Text.Read.Lex				An emasculated lexical analyser
      					that provides the functionality
      					of H98 'lex'
      
      TcGenDeriv is changed to generate code that uses the new libraries.
      The built-in instances of Read (List, Maybe, tuples, etc) use the new
      libraries.
      
      
      Other stuff
      ~~~~~~~~~~~
      1. Some fixes the the plumbing of external-core generation. Sigbjorn
      did most of the work earlier, but this commit completes the renaming and
      typechecking plumbing.
      
      2. Runtime error-generation functions, such as GHC.Err.recSelErr,
      GHC.Err.recUpdErr, etc, now take an Addr#, pointing to a UTF8-encoded
      C string, instead of a Haskell string.  This makes the *calls* to these
      functions easier to generate, and smaller too, which is a good thing.
      
      In particular, it means that MkId.mkRecordSelectorId doesn't need to
      be passed "unpackCStringId", which was GRUESOME; and that in turn means
      that tcTypeAndClassDecls doesn't need to be passed unf_env, which is
      a very worthwhile cleanup.   Win/win situation.
      
      3.  GHC now faithfully translates do-notation using ">>" for statements
      with no binding, just as the report says.  While I was there I tidied
      up HsDo to take a list of Ids instead of 3 (but now 4) separate Ids.
      Saves a bit of code here and there.  Also introduced Inst.newMethodFromName
      to package a common idiom.
      a7b95beb
  28. 05 Apr, 2002 1 commit
  29. 02 Apr, 2002 2 commits
  30. 01 Apr, 2002 2 commits
  31. 25 Mar, 2002 1 commit
  32. 14 Mar, 2002 1 commit