summaryrefslogtreecommitdiff
path: root/ghc/compiler/ghci/InteractiveUI.hs
Commit message (Collapse)AuthorAgeFilesLines
* Reorganisation of the source treeSimon Marlow2006-04-071-1534/+0
| | | | | | | | | | | | | | | 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.
* GHC.Base.breakpoint isn't vaporware anymore.Lemmih2006-04-061-1/+78
| | | | | -fignore-breakpoints can be used to ignore breakpoints.
* add ':set prompt' commandSimon Marlow2006-03-011-9/+31
| | | | contributed by Neil Mitchell <ndmitchell@gmail.com>, with docs by me.
* If we don't have libreadline then we need some dummy definition for ↵kr.angelov@gmail.com2006-02-121-2/+12
| | | | complete* functions.
* Bugfix in completion code for :set and :unset.Lemmih2006-02-101-5/+12
|
* Completion for :set, :unset and :undef.Lemmih2006-02-101-27/+45
|
* Basic completion in GHCiSimon Marlow2006-02-061-43/+157
| | | | | | | | This patch adds completion support to GHCi when readline is being used. Completion of identifiers (in scope only, but including qualified identifiers) in expressions is provided. Also, completion of commands (:cmd), and special completion for certain commands (eg. module names for the :module command) are also provided.
* [project @ 2006-01-18 10:49:32 by simonmar]simonmar2006-01-181-8/+15
| | | | | | | | | | | | Implement :main (see ticket #662) Patch from Volker Stolz, minor mods by me When matching commands, we now look for (a) an exact match, and (b) the first prefix match we find in the list. This is so that :module can still be abbreviated by :m, to avoid surprise. Docs still to do.
* [project @ 2006-01-12 16:16:28 by simonmar]simonmar2006-01-121-5/+8
| | | | | | | | | | | | | GHC.runStmt: run the statement in a new thread to insulate the environment from bad things that the user code might do, such as fork a thread to send an exception back at a later time. In order to do this, we had to keep track of which thread the ^C exception should go to in a global variable. Also, bullet-proof the top-level exception handler in GHCi a bit; there was a small window where an exception could get through, so if you lean on ^C for a while then press enter you could cause GHCi to exit.
* [project @ 2006-01-06 16:30:17 by simonmar]simonmar2006-01-061-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for UTF-8 source files GHC finally has support for full Unicode in source files. Source files are now assumed to be UTF-8 encoded, and the full range of Unicode characters can be used, with classifications recognised using the implementation from Data.Char. This incedentally means that only the stage2 compiler will recognise Unicode in source files, because I was too lazy to port the unicode classifier code into libcompat. Additionally, the following synonyms for keywords are now recognised: forall symbol (U+2200) forall right arrow (U+2192) -> left arrow (U+2190) <- horizontal ellipsis (U+22EF) .. there are probably more things we could add here. This will break some source files if Latin-1 characters are being used. In most cases this should result in a UTF-8 decoding error. Later on if we want to support more encodings (perhaps with a pragma to specify the encoding), I plan to do it by recoding into UTF-8 before parsing. Internally, there were some pretty big changes: - FastStrings are now stored in UTF-8 - Z-encoding has been moved right to the back end. Previously we used to Z-encode every identifier on the way in for simplicity, and only decode when we needed to show something to the user. Instead, we now keep every string in its UTF-8 encoding, and Z-encode right before printing it out. To avoid Z-encoding the same string multiple times, the Z-encoding is cached inside the FastString the first time it is requested. This speeds up the compiler - I've measured some definite improvement in parsing at least, and I expect compilations overall to be faster too. It also cleans up a lot of cruft from the OccName interface. Z-encoding is nicely hidden inside the Outputable instance for Names & OccNames now. - StringBuffers are UTF-8 too, and are now represented as ForeignPtrs. - I've put together some test cases, not by any means exhaustive, but there are some interesting UTF-8 decoding error cases that aren't obvious. Also, take a look at unicode001.hs for a demo.
* [project @ 2006-01-03 16:15:37 by simonmar]simonmar2006-01-031-13/+35
| | | | | | | | | setContextAfterLoad: try to load a target if possible, otherwise load the topmost module in the graph. Previously we were loading the first module in the list, which happened to be right a lot of the time, but not always. Fixes ticket #642
* [project @ 2005-10-25 12:48:35 by simonmar]simonmar2005-10-251-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Two changes from Krasimir Angelov, which were required for Visual Haskell: - messaging cleanup throughout the compiler. DynFlags has a new field: log_action :: Severity -> SrcSpan -> PprStyle -> Message -> IO () this action is invoked for every message generated by the compiler. This means a client of the GHC API can direct messages to any destination, or collect them up in an IORef for later perusal. This replaces previous hacks to redirect messages in the GHC API (hence some changes to function types in GHC.hs). - The JustTypecheck mode of GHC now does what it says. It doesn't run any of the compiler passes beyond the typechecker for each module, but does generate the ModIface in order that further modules can be typechecked. And one change from me: - implement the LANGUAGE pragma, finally
* [project @ 2005-10-20 00:52:38 by sof]sof2005-10-201-11/+12
| | | | [mingw]delay flushing console buffer until last possible moment. Merge to STABLE
* [project @ 2005-07-11 10:25:43 by simonmar]simonmar2005-07-111-3/+7
| | | | | | | mingw32: ignore isDoesNotExistError failure from GHC.ConsoleHandler.flushConsole Submitted-by: Brian Smith <brianlsmith at gmail.com>
* [project @ 2005-07-06 10:43:36 by simonmar]simonmar2005-07-061-11/+21
| | | | | | | | ghc -e should exit(1) if the statement fails to compile. Fixes #1233146 (this was already partially fixed, in that ghc -e would exit(1) if the modules fail to compile, but if the expression itself was invalid it would still exit(0)).
* [project @ 2005-07-01 09:41:24 by simonmar]simonmar2005-07-011-1/+1
| | | | | setContextAfterLoad: include the Prelude if the top module is compiled (this broke at some point in the HEAD, 6.4 works fine).
* [project @ 2005-06-27 08:54:51 by simonmar]simonmar2005-06-271-1/+1
| | | | help text wibble
* [project @ 2005-06-27 08:53:03 by simonmar]simonmar2005-06-271-6/+11
| | | | | | | | | Rename :tags to :etags and :ctags. The problem was that :tags prevented the common abbreviation of :type, namely :t. Also, :etags and :ctags match the *nix commands of the same name, and this way makes it easier for them to take an optional filename argument (which they now do).
* [project @ 2005-06-21 10:30:41 by simonmar]simonmar2005-06-211-2/+2
| | | | we should be using PprTyThingInContext instead of PprTyThing here
* [project @ 2005-06-15 12:03:19 by simonmar]simonmar2005-06-151-137/+48
| | | | | | | | | | | | | | | | | | | | | | | | Re-implement GHCi's :info and :browse commands in terms of TyThings rather than IfaceSyn. The GHC API now exposes its internal types for Haskell entities: TyCons, Classes, DataCons, Ids and Instances (collectively known as TyThings), so we can inspect these directly to pretty-print information about an entity. Previously the internal representations were converted to IfaceSyn for passing to InteractiveUI, but we can now remove that code. Some of the new code comes via Visual Haskell, but I've changed it around a lot to fix various dark corners and properly print things like GADTs. The pretty-printing interfaces for TyThings are exposed by a new module PprTyThing, which is implemented purely in terms of the GHC API (and is probably a good source of sample code). Visual Haskell should be able to use the functions exported by this module directly. Lots of new goodies are exported by the GHC module, mainly for inspecting TyThings.
* [project @ 2005-06-13 14:16:03 by simonmar]simonmar2005-06-131-1/+1
| | | | fix layout in the help text
* [project @ 2005-06-13 14:12:59 by simonmar]simonmar2005-06-131-5/+117
| | | | | | | | | | Implement :tags command Patch supplied by Claus Reinke, with some modifications by me. Ideally we'd like this to be a command line option too, and we'd like to drop the restriction that all the source files must be interpreted, but that needs some work elsewhere (interface files have to store definition source locations).
* [project @ 2005-05-16 13:47:57 by simonmar]simonmar2005-05-161-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | Implement -x <suffix> flag to override the suffix of a filename for the purposes of determinig how it should be compiled. The usage is similar to gcc, except that we just use a suffix rather than a name for the language. eg. ghc -c -x hs hello.blah will pretend hello.blah is a .hs file. Another possible use is -x hspp, which skips preprocessing. This works for one-shot compilation, --make, GHCi, and ghc -e. The original idea was to make it possible to use runghc on a file that doesn't end in .hs, so changes to runghc will follow. Also, I made it possible to specify .c files and other kinds of files on the --make command line; these will be compiled to objects as normal and linked into the final executable. GHC API change: I had to extend the Target type to include an optional start phase, and also GHC.guessTarget now takes a (Maybe Phase) argument. I thought this would be half an hour, in fact it took half a day, and I still haven't documented it. Sigh.
* [project @ 2005-05-14 09:59:32 by panne]panne2005-05-141-2/+2
| | | | Fixed previous commit
* [project @ 2005-05-13 10:59:28 by simonmar]simonmar2005-05-131-2/+22
| | | | Add undocumented :check command, for testing GHC.checkModule
* [project @ 2005-05-11 09:51:50 by simonmar]simonmar2005-05-111-7/+16
| | | | | restore rev. 1.189, which appears to have been spammed in rev. 1.190 (my fault, by the looks of it).
* [project @ 2005-05-06 00:30:56 by sof]sof2005-05-061-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [mingw only] Work around bug in win32 Console API which showed up in the GHCi UI: if the user typed in characters prior to the appearance of the prompt, the first of these characters always came out as a 'g'. The GHCi UI does for good reasons one-character reads from 'stdin', which causes the underlying APIs to become confused. A simple repro case is the following piece of C code: /*----------------------*/ #include <stdio.h> #include <windows.h> int main() { char ch1,ch2; HANDLE hStdIn = GetStdHandle(STD_INPUT_HANDLE); DWORD dw; /* Type in some characters before the prompt appears and be amused.. */ sleep(1000); printf("? "); ReadConsoleA(hStdIn,&ch1,1,&dw,NULL); ReadConsoleA(hStdIn,&ch2,1,&dw,NULL); /* or, if you want to use libc: read(0,&ch1,1); read(0,&ch2,1); */ printf("%c%c\n", ch1,ch2); return 0; } /*----------------------*/ This happens across win32 OSes, and I can't see anything untoward as far as API usage goes (the GHC IO implementation uses read(), but that reduces to ReadConsoleA() calls.) People inside the Behemoth might want to have a closer look at this.. Not much we can do about this except work around the problem by flushing the input buffer prior to reading from stdin. Not ideal, as type-ahead is a useful feature. Flushing is handled by GHC.ConsoleHandler.flushConsole Merge to STABLE.
* [project @ 2005-04-29 23:39:12 by simonpj]simonpj2005-04-291-5/+2
| | | | Wibbles to new hs-boot instance story
* [project @ 2005-04-28 10:09:41 by simonpj]simonpj2005-04-281-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This big commit does several things at once (aeroplane hacking) which change the format of interface files. So you'll need to recompile your libraries! 1. The "stupid theta" of a newtype declaration ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Retain the "stupid theta" in a newtype declaration. For some reason this was being discarded, and putting it back in meant changing TyCon and IfaceSyn slightly. 2. Overlap flags travel with the instance ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Arrange that the ability to support overlap and incoherence is a property of the *instance declaration* rather than the module that imports the instance decl. This allows a library writer to define overlapping instance decls without the library client having to know. The implementation is that in an Instance we store the overlap flag, and preseve that across interface files 3. Nuke the "instnce pool" and "rule pool" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A major tidy-up and simplification of the way that instances and rules are sucked in from interface files. Up till now an instance decl has been held in a "pool" until its "gates" (a set of Names) are in play, when the instance is typechecked and added to the InstEnv in the ExternalPackageState. This is complicated and error-prone; it's easy to suck in too few (and miss an instance) or too many (and thereby be forced to suck in its type constructors, etc). Now, as we load an instance from an interface files, we put it straight in the InstEnv... but the Instance we put in the InstEnv has some Names (the "rough-match" names) that can be used on lookup to say "this Instance can't match". The detailed dfun is only read lazily, and the rough-match thing meansn it is'nt poked on until it has a chance of being needed. This simply continues the successful idea for Ids, whereby they are loaded straightaway into the TypeEnv, but their TyThing is a lazy thunk, not poked on until the thing is looked up. Just the same idea applies to Rules. On the way, I made CoreRule and Instance into full-blown records with lots of info, with the same kind of key status as TyCon or DataCon or Class. And got rid of IdCoreRule altogether. It's all much more solid and uniform, but it meant touching a *lot* of modules. 4. Allow instance decls in hs-boot files ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Allowing instance decls in hs-boot files is jolly useful, becuase in a big mutually-recursive bunch of data types, you want to give the instances with the data type declarations. To achieve this * The hs-boot file makes a provisional name for the dict-fun, something like $fx9. * When checking the "mother module", we check that the instance declarations line up (by type) and generate bindings for the boot dfuns, such as $fx9 = $f2 where $f2 is the dfun generated by the mother module * In doing this I decided that it's cleaner to have DFunIds get their final External Name at birth. To do that they need a stable OccName, so I have an integer-valued dfun-name-supply in the TcM monad. That keeps it simple. This feature is hardly tested yet. 5. Tidy up tidying, and Iface file generation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ main/TidyPgm now has two entry points: simpleTidyPgm is for hi-boot files, when typechecking only (not yet implemented), and potentially when compiling without -O. It ignores the bindings, and generates a nice small TypeEnv. optTidyPgm is the normal case: compiling with -O. It generates a TypeEnv rich in IdInfo MkIface.mkIface now only generates a ModIface. A separate procedure, MkIface.writeIfaceFile, writes the file out to disk.
* [project @ 2005-04-22 17:00:48 by sof]sof2005-04-221-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | [mingw only] Better handling of I/O request abortions upon throwing an exception to a Haskell thread. As was, a thread blocked on an I/O request was simply unblocked, but its corresponding worker thread wasn't notified that the request had been abandoned. This manifested itself in GHCi upon Ctrl-C being hit at the prompt -- the worker thread blocked waiting for input on stdin prior to Ctrl-C would stick around even though its corresponding Haskell thread had been thrown an Interrupted exception. The upshot was that the worker would consume the next character typed in after Ctrl-C, but then just dropping it. Dealing with this turned out to be even more interesting due to Win32 aborting any console reads when Ctrl-C/Break events are delivered. The story could be improved upon (at the cost of portability) by making the Scheduler able to abort worker thread system calls; as is, requests are cooperatively abandoned. Maybe later. Also included are other minor tidyups to Ctrl-C handling under mingw. Merge to STABLE.
* [project @ 2005-04-08 13:40:55 by simonmar]simonmar2005-04-081-2/+3
| | | | Refine the imports a bit
* [project @ 2005-03-31 15:16:53 by simonmar]simonmar2005-03-311-7/+7
| | | | | | | | | | | | | | | | | More hacking on the GHC API to get it into shape for VS - load now takes a LoadHowMuch argument, which is either LoadAllTargets LoadUpTo Module LoadDependenciesOf Module which should be self-explanatory. LoadDependenciesOf might go away in the future, it's necessary at the moment because it is used in the implementation of: - checkModule :: Session -> Module -> MessageHandler -> IO CheckResult which is currently the only way to get at the parsed & typechecked abstract syntax for a module.
* [project @ 2005-03-30 16:24:04 by simonmar]simonmar2005-03-301-3/+8
| | | | | | | | | | | | | | Add support for partial reloads in the GHC API. This is mainly for VS: when editing a file you don't want to continually reload the entire project whenever the current file changes, you want to reload up to and including the current file only. However, you also want to retain any other modules in the session that are still stable. I added a variant of :reload in GHCi to test this. You can say ':reload M' to reload up to module M only. This will bring M up to date, and throw away any invalidated modules from the session.
* [project @ 2005-03-22 17:13:12 by simonmar]simonmar2005-03-221-173/+197
| | | | | | | | | | | | | | | A start on the GHC API: Flesh out the GHC module so that it can replace CompManager. Now, the clients that used CompManager consume the GHC API instead (namely Main, DriverMkDepend, and InteractiveUI). Main is significantly cleaner as a result. The interface needs more work: in particular, getInfo returns results in the form of IfaceDecls but we want to use full HsSyn and Id/DataCon/Class across the boundary instead. The interfaces for inspecting loaded modules are not yet implemented.
* [project @ 2005-03-18 17:16:00 by simonpj]simonpj2005-03-181-14/+11
| | | | Fix stage-2 build
* [project @ 2005-03-18 13:37:27 by simonmar]simonmar2005-03-181-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Flags cleanup. Basically the purpose of this commit is to move more of the compiler's global state into DynFlags, which is moving in the direction we need to go for the GHC API which can have multiple active sessions supported by a single GHC instance. Before: $ grep 'global_var' */*hs | wc -l 78 After: $ grep 'global_var' */*hs | wc -l 27 Well, it's an improvement. Most of what's left won't really affect our ability to host multiple sessions. Lots of static flags have become dynamic flags (yay!). Notably lots of flags that we used to think of as "driver" flags, like -I and -L, are now dynamic. The most notable static flags left behind are the "way" flags, eg. -prof. It would be nice to fix this, but it isn't urgent. On the way, lots of cleanup has happened. Everything related to static and dynamic flags lives in StaticFlags and DynFlags respectively, and they share a common command-line parser library in CmdLineParser. The flags related to modes (--makde, --interactive etc.) are now private to the front end: in fact private to Main itself, for now.
* [project @ 2005-03-08 09:47:35 by simonpj]simonpj2005-03-081-5/+5
| | | | Print full instances in ghci; merge
* [project @ 2005-02-28 16:01:52 by simonpj]simonpj2005-02-281-2/+4
| | | | Print empty classes right
* [project @ 2005-02-25 13:06:31 by simonpj]simonpj2005-02-251-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --------------------------------------------- Type signatures are no longer instantiated with skolem constants --------------------------------------------- Merge to STABLE Consider p :: a q :: b (p,q,r) = (r,r,p) Here, 'a' and 'b' end up being the same, because they are both bound to the type for 'r', which is just a meta type variable. So 'a' and 'b' can't be skolems. Sigh. This commit goes back to an earlier way of doing things, by arranging that type signatures get instantiated with *meta* type variables; then at the end we must check that they have not been unified with types, nor with each other. This is a real bore. I had to do quite a bit of related fiddling around to make error messages come out right. Improved one or two. Also a small unrelated fix to make :i (:+) print with parens in ghci. Sorry this got mixed up in the same commit.
* [project @ 2005-02-23 15:38:52 by simonmar]simonmar2005-02-231-37/+39
| | | | Make :info behave like :type, and show foralls when -fglasgow-exts is on.
* [project @ 2005-02-23 12:44:17 by simonmar]simonmar2005-02-231-8/+18
| | | | | In -e mode, if there is an error loading the modules on the command line, stop immediately rather than going on to evaluate the expression.
* [project @ 2005-02-15 12:15:25 by simonmar]simonmar2005-02-151-3/+13
| | | | | | | | ghc -e 'System.Exit.exitWith (System.Exit.ExitFailure 99)' should just exit 99, rather than printing out the exception. Also while I'm here, make all other exceptions cause 'ghc -e' to exit(1), which is probably what we want.
* [project @ 2005-02-04 13:32:28 by simonmar]simonmar2005-02-041-4/+4
| | | | | In the fragments of Haskell code which setup buffering and flushing for the std Handles in GHCi, qualify names with System.IO rather than IO.
* [project @ 2005-01-28 17:44:55 by simonpj]simonpj2005-01-281-11/+13
| | | | | | | | | | | | | | Arrange that when seeking instance decls in GHCi, in response to a :info command, we only print ones whose types are in scope unqualified. This eliminates an alarmingly long list when simply typing ':info Show', say. On the way, I reorganised a bit. GHCi printing happens by converting a TyThing to an IfaceDecl, and printing that. I now arrange to generate unqualifed IfaceExtNames directly during this conversion, based on what is in scope. Previously it was done during the pretty-printing part via the UserStyle. But this is nicer.
* [project @ 2005-01-28 12:55:17 by simonmar]simonmar2005-01-281-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rationalise the BUILD,HOST,TARGET defines. Recall that: - build is the platform we're building on - host is the platform we're running on - target is the platform we're generating code for The change is that now we take these definitions as applying from the point of view of the particular source code being built, rather than the point of view of the whole build tree. For example, in RTS and library code, we were previously testing the TARGET platform. But under the new rule, the platform on which this code is going to run is the HOST platform. TARGET only makes sense in the compiler sources. In practical terms, this means that the values of BUILD, HOST & TARGET may vary depending on which part of the build tree we are in. Actual changes: - new file: includes/ghcplatform.h contains platform defines for the RTS and library code. - new file: includes/ghcautoconf.h contains the autoconf settings only (HAVE_BLAH). This is so that we can get hold of these settings independently of the platform defines when necessary (eg. in GHC). - ghcconfig.h now #includes both ghcplatform.h and ghcautoconf.h. - MachRegs.h, which is included into both the compiler and the RTS, now has to cope with the fact that it might need to test either _TARGET_ or _HOST_ depending on the context. - the compiler's Makefile now generates stage{1,2,3}/ghc_boot_platform.h which contains platform defines for the compiler. These differ depending on the stage, of course: in stage2, the HOST is the TARGET of stage1. This was wrong before. - The compiler doesn't get platform info from Config.hs any more. Previously it did (sometimes), but unless we want to generate a new Config.hs for each stage we can't do this. - GHC now helpfully defines *_{BUILD,HOST}_{OS,ARCH} automatically in CPP'd Haskell source. - ghcplatform.h defines *_TARGET_* for backwards compatibility (ghcplatform.h is included by ghcconfig.h, which is included by config.h, so code which still #includes config.h will get the TARGET settings as before). - The Users's Guide is updated to mention *_HOST_* rather than *_TARGET_*. - coding-style.html in the commentary now contains a section on platform defines. There are further doc updates to come. Thanks to Wolfgang Thaller for pointing me in the right direction.
* [project @ 2005-01-26 12:58:09 by simonmar]simonmar2005-01-261-3/+10
| | | | | | | fileLoop: catch InvalidArgument and behave as for EOF (i.e. terminate the session). This means that the user can close stdin to end a GHCi session, but it also means that the tests that run programs which use getContents inside GHCi won't crash because stdin has been closed.
* [project @ 2005-01-18 12:18:11 by simonpj]simonpj2005-01-181-18/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ------------------------ Reorganisation of hi-boot files ------------------------ The main point of this commit is to arrange that in the Compilation Manager's dependendency graph, hi-boot files are proper nodes. This is important to make sure that we compile everything in the right order. It's a step towards hs-boot files. * The fundamental change is that CompManager.ModSummary has a new field, ms_boot :: IsBootInterface I also tided up CompManager a bit. No change to the Basic Plan. ModSummary is now exported abstractly from CompManager (was concrete) * Hi-boot files now have import declarations. The idea is they are compulsory, so that the dependency analyser can find them * I changed an invariant: the Compilation Manager used to ensure that hscMain was given a HomePackageTable only for the modules 'below' the one being compiled. This was really only important for instances and rules, and it was a bit inconvenient. So I moved the filter to the compiler itself: see HscTypes.hptInstances and hptRules. * Module Packages.hs now defines data PackageIdH = HomePackage -- The "home" package is the package -- curently being compiled | ExtPackage PackageId -- An "external" package is any other package It was just a Maybe type before, so this makes it a bit clearer. * I tried to add a bit better location info to the IfM monad, so that errors in interfaces come with a slightly more helpful error message. See the if_loc field in TcRnTypes --- and follow-on consequences * Changed Either to Maybes.MaybeErr in a couple of places (more perspicuous)
* [project @ 2005-01-12 12:44:25 by ross]ross2005-01-121-3/+3
| | | | fix System.IO.Error breakage
* [project @ 2005-01-12 09:46:06 by simonmar]simonmar2005-01-121-1/+2
| | | | import System.IO.Error
* [project @ 2004-11-26 16:19:45 by simonmar]simonmar2004-11-261-38/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Further integration with the new package story. GHC now supports pretty much everything in the package proposal. - GHC now works in terms of PackageIds (<pkg>-<version>) rather than just package names. You can still specify package names without versions on the command line, as long as the name is unambiguous. - GHC understands hidden/exposed modules in a package, and will refuse to import a hidden module. Also, the hidden/eposed status of packages is taken into account. - I had to remove the old package syntax from ghc-pkg, backwards compatibility isn't really practical. - All the package.conf.in files have been rewritten in the new syntax, and contain a complete list of modules in the package. I've set all the versions to 1.0 for now - please check your package(s) and fix the version number & other info appropriately. - New options: -hide-package P sets the expose flag on package P to False -ignore-package P unregisters P for this compilation For comparison, -package P sets the expose flag on package P to True, and also causes P to be linked in eagerly. -package-name is no longer officially supported. Unofficially, it's a synonym for -ignore-package, which has more or less the same effect as -package-name used to. Note that a package may be hidden and yet still be linked into the program, by virtue of being a dependency of some other package. To completely remove a package from the compiler's internal database, use -ignore-package. The compiler will complain if any two packages in the transitive closure of exposed packages contain the same module. You *must* use -ignore-package P when compiling modules for package P, if package P (or an older version of P) is already registered. The compiler will helpfully complain if you don't. The fptools build system does this. - Note: the Cabal library won't work yet. It still thinks GHC uses the old package config syntax. Internal changes/cleanups: - The ModuleName type has gone away. Modules are now just (a newtype of) FastStrings, and don't contain any package information. All the package-related knowledge is in DynFlags, which is passed down to where it is needed. - DynFlags manipulation has been cleaned up somewhat: there are no global variables holding DynFlags any more, instead the DynFlags are passed around properly. - There are a few less global variables in GHC. Lots more are scheduled for removal. - -i is now a dynamic flag, as are all the package-related flags (but using them in {-# OPTIONS #-} is Officially Not Recommended). - make -j now appears to work under fptools/libraries/. Probably wouldn't take much to get it working for a whole build.