1. 17 Dec, 2004 1 commit
  2. 30 Sep, 2004 1 commit
    • simonpj's avatar
      [project @ 2004-09-30 10:35:15 by simonpj] · 23f40f0e
      simonpj authored
      ------------------------------------
      	Add Generalised Algebraic Data Types
      	------------------------------------
      
      This rather big commit adds support for GADTs.  For example,
      
          data Term a where
       	  Lit :: Int -> Term Int
      	  App :: Term (a->b) -> Term a -> Term b
      	  If  :: Term Bool -> Term a -> Term a
      	  ..etc..
      
          eval :: Term a -> a
          eval (Lit i) = i
          eval (App a b) = eval a (eval b)
          eval (If p q r) | eval p    = eval q
          		    | otherwise = eval r
      
      
      Lots and lots of of related changes throughout the compiler to make
      this fit nicely.
      
      One important change, only loosely related to GADTs, is that skolem
      constants in the typechecker are genuinely immutable and constant, so
      we often get better error messages from the type checker.  See
      TcType.TcTyVarDetails.
      
      There's a new module types/Unify.lhs, which has purely-functional
      unification and matching for Type. This is used both in the typechecker
      (for type refinement of GADTs) and in Core Lint (also for type refinement).
      23f40f0e
  3. 13 Aug, 2004 1 commit
  4. 23 Mar, 2004 1 commit
  5. 22 Mar, 2004 1 commit
    • ralf's avatar
      [project @ 2004-03-22 09:00:28 by ralf] · cfd7a0d5
      ralf authored
      Boot-strapping ghc revealed an issue related to yesterday's renaming
      of Data.Typeable. I can now build a stage1 compiler again. Let me try
      a stage2 one as well.
      
      ralf        2004/03/21 11:06:04 PST
      
        Modified files:
          ghc/compiler/prelude PrelNames.lhs
          ghc/compiler/typecheck TcGenDeriv.lhs
        Log:
        Implemented renaming for Data.Typeable
        as far as deriving mechanism is involved.
        See http://www.haskell.org//pipermail/libraries/2004-March/001846.html
      
        Revision  Changes    Path
        1.88      +1 -1      fptools/ghc/compiler/prelude/PrelNames.lhs
        1.107     +1 -1      fptools/ghc/compiler/typecheck/TcGenDeriv.lhs
      cfd7a0d5
  6. 10 Mar, 2003 1 commit
  7. 04 Mar, 2003 1 commit
  8. 24 Feb, 2003 1 commit
    • simonpj's avatar
      [project @ 2003-02-24 12:39:24 by simonpj] · 395917a0
      simonpj authored
      Three Template Haskell improvements
      
      a) Add type synonyms to THSyntax (and DsMeta, Convert)
      
      b) Make Q into a newtype instead of a type synonym
      
      c) Eliminate tiresome and error prone argument to DsMeta.wrapGenSyms
         and similarly addTyVarBinds
      395917a0
  9. 21 Feb, 2003 2 commits
  10. 18 Feb, 2003 1 commit
  11. 17 Feb, 2003 1 commit
  12. 15 Oct, 2002 1 commit
  13. 14 Oct, 2002 1 commit
  14. 11 Oct, 2002 1 commit
  15. 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
  16. 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
  17. 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
  18. 05 Dec, 2001 2 commits
  19. 28 Mar, 2001 1 commit
    • simonmar's avatar
      [project @ 2001-03-28 16:45:35 by simonmar] · 896b0afe
      simonmar authored
      Clean up GHC's error reporting
      
        - the GhcException type has some more constructors: CmdLineError,
          ProgramError, and InstallationError.  OtherError has gone.
      
        - most error messages should begin with "<location>:".  When the
          error is on the command-line or in GHC itself, <location> is
          "ghc", for consistency with std Unix semantics.
      896b0afe
  20. 23 Feb, 2001 1 commit
  21. 12 Dec, 2000 1 commit
  22. 12 Oct, 2000 1 commit
    • simonmar's avatar
      [project @ 2000-10-12 13:11:45 by simonmar] · 30d55993
      simonmar authored
      Move FAST_INT and FAST_BOOL into their own module FastTypes, replacing
      the macro definitions in HsVersions.h with real definitions.  Change
      most of the names in the process.
      
      Now we don't get bogus imports of GlaExts all over the place, and
      -fwarn-unused-imports is less noisy.
      30d55993
  23. 27 Apr, 1999 1 commit
  24. 01 Mar, 1999 1 commit
  25. 21 Dec, 1998 1 commit