summaryrefslogtreecommitdiff
path: root/ghc/InteractiveUI.hs
Commit message (Collapse)AuthorAgeFilesLines
...
* Typo fix; Trac #9787Austin Seipp2014-11-101-2/+2
| | | | | | Also, reword :print description. Signed-off-by: Austin Seipp <austin@well-typed.com>
* Top-level comment for keepPackageImports.Edward Z. Yang2014-11-071-1/+4
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Extra CRs are now filtered out from the source file for :list.Gintautas Miliauskas2014-10-291-1/+2
| | | | | | | | | | | | | | Fixes #9367. Reviewers: austin Reviewed By: austin Subscribers: #ghc_windows_task_force, thomie, carter, simonmar Differential Revision: https://phabricator.haskell.org/D382 GHC Trac Issues: #9367
* Don't re-export `Alternative(..)` from Control.Monad (re #9586)Herbert Valerio Riedel2014-09-261-1/+1
| | | | | | | | | | | | | | | | | This was done in d94de87252d0fe2ae97341d186b03a2fbe136b04 to avoid orphans but since a94dc4c3067c6a0925e2e39f35ef0930771535f1 moved `Alternative` into GHC.Base, this isn't needed anymore. This is important, as otherwise this would require a non-neglectable amount of `Control.Monad hiding ((<|>), empty)` imports in user code. The Haddock submodule is updated as well Test Plan: partial local ./validate --fast, let Harbormaster doublecheck it Reviewed By: ekmett, austin Differential Revision: https://phabricator.haskell.org/D248
* Add the ability to :set -l{foo} in ghci, fix #1407.archblob2014-09-161-0/+11
| | | | | | | | | | | | | | | | | | Summary: The dynamic linking code was already there but it was not called on flag changes in ghci. Test Plan: validate Reviewers: hvr, simonmar, austin Reviewed By: austin Subscribers: simonmar, ezyang, carter Differential Revision: https://phabricator.haskell.org/D194 GHC Trac Issues: #1407
* Make Applicative a superclass of MonadAustin Seipp2014-09-091-1/+2
| | | | | | | | | | | | | | | | | | | | | Summary: This includes pretty much all the changes needed to make `Applicative` a superclass of `Monad` finally. There's mostly reshuffling in the interests of avoid orphans and boot files, but luckily we can resolve all of them, pretty much. The only catch was that Alternative/MonadPlus also had to go into Prelude to avoid this. As a result, we must update the hsc2hs and haddock submodules. Signed-off-by: Austin Seipp <austin@well-typed.com> Test Plan: Build things, they might not explode horribly. Reviewers: hvr, simonmar Subscribers: simonmar Differential Revision: https://phabricator.haskell.org/D13
* `M-x delete-trailing-whitespace` & `M-x untabify`...Herbert Valerio Riedel2014-08-311-6/+5
| | | | | | ...some files more or less recently touched by me [ci skip]
* ghci: tweak option list indentation in ':show packages'Sergei Trofimovich2014-08-071-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Caught by './validate --slow' in 'ghci/scripts/ghci024'. Commit 207875293fea07aa90efe215369629b657d1875a changed indentation a bit: --- ./ghci/scripts/ghci024.stdout 2014-07-31 12:05:34.000000000 +0300 +++ ./ghci/scripts/ghci024.run.stdout 2014-08-07 17:19:23.000000000 +0300 @@ -33,4 +33,4 @@ active package flags: none ~~~~~~~~~~ Testing :show packages, including the ghc package active package flags: - -package ghc +-package ghc Patch restores indentation. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Test Plan: passed validate, tested manually Reviewers: austin, ezyang Reviewed By: ezyang Subscribers: phaskell, simonmar, relrod, ezyang, carter Differential Revision: https://phabricator.haskell.org/D126
* Thinning and renaming modules from packages on the command line.Edward Z. Yang2014-08-051-10/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch set adds support for extra syntax on -package and related arguments which allow you to thin and rename modules from a package. For example, this argument: -package "base (Data.Bool as Bam, Data.List)" adds two more modules into scope, Bam and Data.List, without adding any of base's other modules to scope. These flags are additive: so, for example, saying: -hide-all-packages -package base -package "base (Data.Bool as Bam)" will provide both the normal bindings for modules in base, as well as the module Bam. There is also a new debug flag -ddump-mod-map which prints the state of the module mapping database. H = hidden, E = exposed (so for example EH says the module in question is exported, but in a hidden package.) Module suggestions have been minorly overhauled to work better with reexports: if you have -package "base (Data.Bool as Bam)" and mispell Bam, GHC will suggest "Did you mean Bam (defined via package flags to be base:Data.Bool)"; and generally you will get more accurate information. Also, fix a bug where we suggest the -package flag when we really need the -package-key flag. NB: The renaming afforded here does *not* affect what wired in symbols GHC generates. (But it does affect implicit prelude!) ToDo: add 'hiding' functionality, to make it easier to support the alternative prelude use-case. ToDo: Cabal support Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: new tests and validate Reviewers: simonpj, simonmar, hvr, austin Subscribers: simonmar, relrod, ezyang, carter Differential Revision: https://phabricator.haskell.org/D113 GHC Trac Issues: #9375
* Refactor PackageFlags so that ExposePackage is a single constructor.Edward Z. Yang2014-08-051-3/+4
| | | | | | | You can parametrize over the different selection by using a different PackageArg. This helps reduce code duplication. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Make PackageState an abstract type.Edward Z. Yang2014-08-051-15/+8
| | | | | | | | | | | | Summary: Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonpj, simonmar, hvr, austin Subscribers: simonmar, relrod, ezyang, carter Differential Revision: https://phabricator.haskell.org/D107
* Package keys (for linking/type equality) separated from package IDs.Edward Z. Yang2014-08-051-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch set makes us no longer assume that a package key is a human readable string, leaving Cabal free to "do whatever it wants" to allocate keys; we'll look up the PackageId in the database to display to the user. This also means we have a new level of qualifier decisions to make at the package level, and rewriting some Safe Haskell error reporting code to DTRT. Additionally, we adjust the build system to use a new ghc-cabal output Make variable PACKAGE_KEY to determine library names and other things, rather than concatenating PACKAGE/VERSION as before. Adds a new `-this-package-key` flag to subsume the old, erroneously named `-package-name` flag, and `-package-key` to select packages by package key. RFC: The md5 hashes are pretty tough on the eye, as far as the file system is concerned :( ToDo: safePkg01 test had its output updated, but the fix is not really right: the rest of the dependencies are truncated due to the fact the we're only grepping a single line, but ghc-pkg is wrapping its output. ToDo: In a later commit, update all submodules to stop using -package-name and use -this-package-key. For now, we don't do it to avoid submodule explosion. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonpj, simonmar, hvr, austin Subscribers: simonmar, relrod, carter Differential Revision: https://phabricator.haskell.org/D80
* Module reexports, fixing #8407.Edward Z. Yang2014-07-251-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | The general approach is to add a new field to the package database, reexported-modules, which considered by the module finder as possible module declarations. Unlike declaring stub module files, multiple reexports of the same physical package at the same name do not result in an ambiguous import. Has submodule updates for Cabal and haddock. NB: When a reexport renames a module, that renaming is *not* accessible from inside the package. This is not so much a deliberate design choice as for implementation expediency (reexport resolution happens only when a package is in the package database.) TODO: Error handling when there are duplicate reexports/etc is not very well tested. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Conflicts: compiler/main/HscTypes.lhs testsuite/.gitignore utils/haddock
* Rename PackageId to PackageKey, distinguishing it from Cabal's PackageId.Edward Z. Yang2014-07-211-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously, both Cabal and GHC defined the type PackageId, and we expected them to be roughly equivalent (but represented differently). This refactoring separates these two notions. A package ID is a user-visible identifier; it's the thing you write in a Cabal file, e.g. containers-0.9. The components of this ID are semantically meaningful, and decompose into a package name and a package vrsion. A package key is an opaque identifier used by GHC to generate linking symbols. Presently, it just consists of a package name and a package version, but pursuant to #9265 we are planning to extend it to record other information. Within a single executable, it uniquely identifies a package. It is *not* an InstalledPackageId, as the choice of a package key affects the ABI of a package (whereas an InstalledPackageId is computed after compilation.) Cabal computes a package key for the package and passes it to GHC using -package-name (now *extremely* misnamed). As an added bonus, we don't have to worry about shadowing anymore. As a follow on, we should introduce -current-package-key having the same role as -package-name, and deprecate the old flag. This commit is just renaming. The haddock submodule needed to be updated. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonpj, simonmar, hvr, austin Subscribers: simonmar, relrod, carter Differential Revision: https://phabricator.haskell.org/D79 Conflicts: compiler/main/HscTypes.lhs compiler/main/Packages.lhs utils/haddock
* Make GHCi permissions checks ignore root user.Mathieu Boespflug2014-07-201-14/+11
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: As a security precaution, GHCi helpfully refuses to run a .ghci file if it is owned by another user. But if the that other user is root, then arguably GHCi should not refuse to interpret the file, because if root really was malicious, then the user would be having a bad day anyways. This means that .ghci files installed in a global location, say under /usr/local/, can now be read. Fixes #9324 Test Plan: ``` $ sudo touch .ghci $ ghci ``` Notice that the warning about the file being owned by someone else is now gone. Reviewers: austin Reviewed By: austin Subscribers: phaskell, simonmar, carter, nomeata, relrod Projects: #ghc Differential Revision: https://phabricator.haskell.org/D75
* Fix ghci tab completion of duplicate identifiers.Shachaf Ben-Kiki2014-07-131-2/+2
| | | | | | | | | | | | | | | | | | | Summary: Currently, if the same identifier is imported via multiple modules, ghci shows multiple completions for it. Use the nub of the completions instead so that it only shows up once. Signed-off-by: Shachaf Ben-Kiki <shachaf@gmail.com> Test Plan: by hand Reviewers: simonmar, austin, hvr Reviewed By: austin, hvr Subscribers: hvr, simonmar, relrod, carter Differential Revision: https://phabricator.haskell.org/D58
* Do not print the result of 'main' after invoking ':main' (fixes #9086).Gintautas Miliauskas2014-07-071-3/+4
|
* Fixes #95 :edit command should jump to the last errorLorenzo Tabacchini2014-06-131-26/+61
|
* Do pretty-printing of TyThings via IfaceDecl (Trac #7730)Simon Peyton Jones2014-06-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All the initial work on this was done fy 'archblob' (fcsernik@gmail.com); thank you! I reviewed the patch, started some tidying, up and then ended up in a huge swamp of changes, not all of which I can remember now. But: * To suppress kind arguments when we have -fno-print-explicit-kinds, - IfaceTyConApp argument types are in a tagged list IfaceTcArgs * To allow overloaded types to be printed with =>, add IfaceDFunTy to IfaceType. * When printing data/type family instances for the user, I've made them print out an informative RHS, which is a new feature. Thus ghci> info T data family T a data instance T Int = T1 Int Int data instance T Bool = T2 * In implementation terms, pprIfaceDecl has just one "context" argument, of type IfaceSyn.ShowSub, which says - How to print the binders of the decl see note [Printing IfaceDecl binders] in IfaceSyn - Which sub-comoponents (eg constructors) to print * Moved FastStringEnv from RnEnv to OccName It all took a ridiculously long time to do. But it's done!
* Convert `ghc-bin.cabal` to use others-extensionsHerbert Valerio Riedel2014-05-151-0/+1
| | | | | | | This replaces the previous `default-extensions` by per-file declared `{-# LANGUAGE ... #-}` pragmas. Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Don't perform permission checks for scripts named with -ghci-script (#6017)Simon Marlow2014-03-271-8/+18
| | | | | | | | The user explicitly requested this script on the command-line, so it's unnecessary to require that the script is also owned by the user. Also, it is currently impossible to make a GHCi wrapper that invokes a custom script without first making a copy of the script to circumvent the permissions check, which seems wrong.
* A little refactoring so that we print package-qualified modules names if ↵Simon Peyton Jones2014-01-091-10/+11
| | | | necessary
* Fix #5209: Reset GHCi prompt in multiline modeBenno Fünfstück2014-01-031-2/+1
| | | | | | GHCi didn't reset the multiline prompt when an exception (in particular, the UserInterrupt exception) occured. This commit uses `finally` to reset the prompt in all cases.
* In ':show imports' take account of -XNoImplicitPreludeSimon Peyton Jones2014-01-021-0/+1
| | | | Fixes Trac #8640
* Refactored by Simon Marlow's suggestionEvan Hauck2013-12-041-4/+2
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Made ghc -e have a nonzero exit code upon failure (Trac #7962 )khyperia2013-12-041-4/+10
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Tweak lookup semantics for GHCi macrosHerbert Valerio Riedel2013-11-041-9/+17
| | | | | | | This changes the prefix-based lookup to prefer macros over builtins only if the macro name matches an existing builtin name. See #8305 for more details. Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* GHCi: Expand ~ in :script commandJoachim Breitner2013-10-091-3/+4
| | | | Fixes: #7685
* Remove glasgow-exts from :helpKrzysztof Gogolewski2013-10-021-1/+1
| | | | It's deprecated
* Wibble (change of flag name)Simon Peyton Jones2013-10-011-1/+1
|
* Improve pretty-printing of typesunknown2013-10-011-32/+20
| | | | | | | | | | | | | | | * The main change is to suppress printing (in types) of kind for-alls kind applications The new flag -fprint-explicit-kinds prints them as before (by analogy with the existing -fprint-explicit-foralls) * I also took advantage of the fact that SDoc now has access to DynFlags, to tidy up the way in which explicit for-alls are printed. Instead of passing a boolean flag around, we now simply consult the DynFlags. Much neater. I still need to add documentation for the flag
* Document remaining GHCi commands in users_guide (#7501)Ben Gamari2013-09-221-1/+1
| | | | Also a small formatting change in GHCi :help
* GHCi: Fix multi-line input line/column-number refsHerbert Valerio Riedel2013-09-111-7/+34
| | | | | | | | | | | | | | This commit addresses #8051 by fixing - Incorrect column indices reported in error messages for single-line and multi-line input, - incorrect line numbers reported in error messages for expressions entered in multi-line input, and - inhibiting the confusing interaction between `:{` and `:set +m` causing the triggering of implicit multi-line continuation mode right after `:}` terminates the multi-line entry block.
* Merge branch 'master' into ghc-parmake-gsocPatrick Palka2013-08-301-2/+18
|\ | | | | | | | | | | Conflicts: compiler/main/DynFlags.hs compiler/utils/FastString.lhs
| * Document :kind! in ghci built-in helpReid Barton2013-08-291-1/+2
| | | | | | | | Signed-off-by: Austin Seipp <aseipp@pobox.com>
| * GHCi: Implement new `:show paths` sub-commandHerbert Valerio Riedel2013-08-271-1/+16
| | | | | | | | | | | | | | | | | | `:show paths` dumps the current working directory as well as the current value of the `importPaths` dynamic flags field. This addresses #8172 Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* | Buffer stdout and stderr when we're compiling via GHCiPatrick Palka2013-08-261-3/+12
| |
* | Make stdout and stderr line-bufferedPatrick Palka2013-08-261-0/+1
|/ | | | | An unbuffered handle is very slow to output to and there doesn't seem to be any reason to have these handles unbuffered.
* Fix GHCi macros not shadowing builtins (#8113)Herbert Valerio Riedel2013-08-241-1/+1
| | | | | | | This restores the original behaviour that was broken accidentally during the refactoring peformed via 4f764d06f3b9899c09a6a459a22d4be694ee45d9. This has been broken effectively for all GHC 7.6.x releases.
* GHCi: Implement `%l` prompt substitution for line-numberHerbert Valerio Riedel2013-08-101-1/+2
| | | | | | | This commit also updates the GHC user guide section regarding the `set prompt` command and closes #8047. Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* use prompt2 in `:set +m` modeHerbert Valerio Riedel2013-07-211-1/+1
|
* Add `:show imports` to completion tableHerbert Valerio Riedel2013-07-211-1/+1
|
* Add `:show linker` command to `:help` outputHerbert Valerio Riedel2013-07-211-0/+1
|
* Fix buildIan Lynagh2013-07-071-7/+10
|
* Alpha rename some functions for consistencyIan Lynagh2013-07-071-6/+6
|
* emacs-friendly completion command for ghci; part of #5687. Patch from hvr.Ian Lynagh2013-07-071-0/+41
|
* Revise implementation of overlapping type family instances.Richard Eisenberg2013-06-211-2/+2
| | | | | | | | | | | | | | | | | | | This commit changes the syntax and story around overlapping type family instances. Before, we had "unbranched" instances and "branched" instances. Now, we have closed type families and open ones. The behavior of open families is completely unchanged. In particular, coincident overlap of open type family instances still works, despite emails to the contrary. A closed type family is declared like this: > type family F a where > F Int = Bool > F a = Char The equations are tried in order, from top to bottom, subject to certain constraints, as described in the user manual. It is not allowed to declare an instance of a closed family.
* Fix many ASSERT uses under Clang.Austin Seipp2013-06-181-1/+1
| | | | | | Clang doesn't like whitespace between macro and arguments. Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Fix ghci crash when the user code closes stdinIan Lynagh2013-06-151-0/+5
| | | | | | Now that we share stdin with the program, we have to check for handle-closed as well as EOF, as the program might have closed stdin.
* Whitespace onlyIan Lynagh2013-06-041-2/+2
|