1. 25 Apr, 2007 1 commit
  2. 11 Apr, 2007 1 commit
    • Simon Marlow's avatar
      Rationalise GhcMode, HscTarget and GhcLink · 3c22606b
      Simon Marlow authored
      This patch cleans up the GHC API, and adds some functionality: we can
      now compile to object code inside GHCi.
      
      Previously we had:
      
        data GhcMode
          = BatchCompile
          | Interactive
          | OneShot
          | JustTypecheck
          | MkDepend
        
        data HscTarget
          = HscC
          | HscAsm
          | HscJava
          | HscInterpreted
          | HscNothing
      
      There was redundancy here; if GhcMode is Interactive, then only
      HscInterpreted makes sense, and JustTypecheck required HscNothing.
      Now we have:
      
        data GhcMode
          = CompManager       -- ^ --make, GHCi, etc.
          | OneShot           -- ^ ghc -c Foo.hs
          | MkDepend          -- ^ ghc -M, see Finder for why we need this
      
      and HscTarget remains as before.
      
      Previously GhcLink looked like this:
      
        data GhcLink = NoLink | StaticLink
      
      Now we have:
      
        data GhcLink = NoLink | LinkBinary | LinkInMemory
      
      The idea being that you can have an HscTarget of HscAsm (for example)
      and still link in memory.
      
      There are two new flags:
      
        -fobject-code selects object code as the target (selects
                      either -fasm or -fvia-C, whichever is the default)
                      This can be usd with ':set' in GHCi, or on the command line.
      
        -fbyte-code   sets byte-code as the target.  Only works in GHCi.
                      One day maybe this could save the byte code in a file
                      when used outside GHCi.
      
        (names chosen for consistency with -fno-code).
      
      Changes to the GHC API: newSession no longer takes the GhcMode
      argument.  The GhcMode defaults to CompManager, which is usually what
      you want.  To do JustTypecheck now, just set hscTarget to HscNothing.
      3c22606b
  3. 13 Mar, 2007 1 commit
  4. 07 Feb, 2007 1 commit
  5. 31 Jan, 2007 1 commit
  6. 01 Feb, 2007 1 commit
  7. 20 Jan, 2007 1 commit
  8. 12 Jan, 2007 1 commit
  9. 10 Dec, 2006 1 commit
  10. 10 Oct, 2006 1 commit
  11. 03 Oct, 2006 5 commits
  12. 27 Sep, 2006 2 commits
  13. 25 Sep, 2006 1 commit
  14. 04 Sep, 2006 1 commit
  15. 25 Aug, 2006 1 commit
  16. 24 Aug, 2006 1 commit
  17. 07 Aug, 2006 1 commit
    • simonpj@microsoft.com's avatar
      Add -fextended-default-rules and -fmono-pat-binds · 6e0c3f50
      simonpj@microsoft.com authored
      Add -fextended-deafult-rules (in response to Don Stewart's message below),
      and document them.
      
      Also doucument -fmono-pat-binds/-fno-mono-pat-binds, which has been in 
      GHC a few weeks now. 
      
      (The two are in one patch because the diffs were so close together
      that Darcs combined them.)
      
      Simon
      
      
      From: Donald Bruce Stewart [mailto:dons@cse.unsw.edu.au] 
      Sent: 07 August 2006 10:52
      
      While we're thinking about defaulting, I have a question..
      
      ghci uses an extended defaulting system, to allow things like:
              Prelude> reverse []
              []
      to work, and to have the right instance of Show found. The manual says:
      
          "..it is tiresome for the user to have to specify the type, so GHCi extends
          Haskell's type-defaulting rules (Section 4.3.4 of the Haskell 98 Report
          (Revised)) as follows. If the expression yields a set of type constraints
          that are all from standard classes (Num, Eq etc.), and at least one is
          either a numeric class or the Show, Eq, or Ord class, GHCi will try to use
          one of the default types, just as described in the Report. The standard
          defaulting rules require that one of the classes is numeric; the difference
          here is that defaulting is also triggered at least one is Show, Eq, or Ord."
      
      Currently, there is no way to get at this "extended" defaulting for compiled
      modules. However, I have a use case for in fact doing this.
      
      With runtime evaluated Haskell, embedding 'interpreters' (over hs-plugins) is
      easy. lambdabot, for example, implements a sandboxed haskell eval system. But
      it doesn't have access to the defaulting mechanism of ghci, so we have:
      
          dons:: > reverse []
          lambdabot:: Add a type signature
          dons:: > reverse [] :: [()]
          lambdabot:: []
      
      Which is annoying -- newbies wonder why they have to add these extra
      constraints to get a Show instance.
      
      I'm wondering, since the extended defaulting mechanisms are already
      implemented, could they be made available to compiled modules as well,
      perhaps using a flag, -fextended-defaulting? 
      6e0c3f50
  18. 27 Jul, 2006 1 commit
  19. 26 Apr, 2006 1 commit
  20. 07 Apr, 2006 1 commit
    • Simon Marlow's avatar
      Reorganisation of the source tree · 0065d5ab
      Simon Marlow authored
      Most of the other users of the fptools build system have migrated to
      Cabal, and with the move to darcs we can now flatten the source tree
      without losing history, so here goes.
      
      The main change is that the ghc/ subdir is gone, and most of what it
      contained is now at the top level.  The build system now makes no
      pretense at being multi-project, it is just the GHC build system.
      
      No doubt this will break many things, and there will be a period of
      instability while we fix the dependencies.  A straightforward build
      should work, but I haven't yet fixed binary/source distributions.
      Changes to the Building Guide will follow, too.
      0065d5ab
  21. 18 Mar, 2006 2 commits
  22. 25 Feb, 2006 1 commit
  23. 06 Jan, 2006 1 commit
  24. 23 Nov, 2005 1 commit
  25. 28 Oct, 2005 1 commit
  26. 10 Oct, 2005 1 commit
  27. 05 Oct, 2005 1 commit
  28. 21 Sep, 2005 1 commit
  29. 28 Jul, 2005 1 commit
  30. 21 Jul, 2005 1 commit
  31. 29 Apr, 2005 1 commit
  32. 07 Apr, 2005 1 commit
  33. 01 Mar, 2005 1 commit
  34. 27 Jan, 2005 1 commit