summaryrefslogtreecommitdiff
path: root/compiler/utils/IOEnv.hs
Commit message (Collapse)AuthorAgeFilesLines
* Modules: Utils and Data (#13009)Sylvain Henry2020-04-261-219/+0
| | | | | | | Update Haddock submodule Metric Increase: haddock.compiler
* Require GHC 8.8 as the minimum compiler for bootstrappingRyan Scott2020-03-311-5/+1
| | | | | | | | This allows us to remove several bits of CPP that are either always true or no longer reachable. As an added bonus, we no longer need to worry about importing `Control.Monad.Fail.fail` qualified to avoid clashing with `Control.Monad.fail`, since the latter is now the same as the former.
* Modules: Types (#13009)Sylvain Henry2020-03-291-1/+1
| | | | | | | Update Haddock submodule Metric Increase: haddock.compiler
* Modules: Driver (#13009)Sylvain Henry2020-02-211-1/+1
| | | | submodule updates: nofib, haddock
* Use DeriveFunctor throughout the codebase (#15654)Krzysztof Gogolewski2019-06-121-4/+2
|
* Prepare source-tree for base-4.13 MFP bumpHerbert Valerio Riedel2019-01-181-0/+3
|
* Fix space leaksSimon Marlow2018-07-161-1/+1
| | | | | | | | | | | | | | | | | | | | | Summary: All these were detected by -fghci-leak-check when GHC was compiled *without* optimisation (e.g. using the "quick" build flavour). Unfortunately I don't know of a good way to keep this working. I'd like to just disable the -fghci-leak-check flag when the compiler is built without optimisation, but it doesn't look like we have an easy way to do that. And even if we could, it would be fragile anyway, Test Plan: `cd testsuite/tests/ghci; make` Reviewers: bgamari, hvr, erikd, tdammers Subscribers: tdammers, rwbarton, thomie, carter GHC Trac Issues: #15246 Differential Revision: https://phabricator.haskell.org/D4872
* compiler: introduce custom "GhcPrelude" PreludeHerbert Valerio Riedel2017-09-191-0/+2
| | | | | | | | | | | | | | | | | | This switches the compiler/ component to get compiled with -XNoImplicitPrelude and a `import GhcPrelude` is inserted in all modules. This is motivated by the upcoming "Prelude" re-export of `Semigroup((<>))` which would cause lots of name clashes in every modulewhich imports also `Outputable` Reviewers: austin, goldfire, bgamari, alanz, simonmar Reviewed By: bgamari Subscribers: goldfire, rwbarton, thomie, mpickering, bgamari Differential Revision: https://phabricator.haskell.org/D3989
* Canonicalise MonoidFail instances in GHCHerbert Valerio Riedel2017-09-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | IOW, code compiles -Wnoncanonical-monoidfail-instances clean now This is easy now since we require GHC 8.0/base-4.9 or later for bootstrapping. Note that we can easily enable `MonadFail` via default-extensions: MonadFailDesugaring in compiler/ghc.cabal.in which currently would point out that NatM doesn't have a proper `fail` method, even though failable patterns are made use of: compiler/nativeGen/SPARC/CodeGen.hs:425:25: error: * No instance for (Control.Monad.Fail.MonadFail NatM) arising from a do statement with the failable pattern ‘(dyn_c, [dyn_r])’
* Drop GHC 7.10 compatibilityRyan Scott2017-08-011-7/+0
| | | | | | | | | | | | | | | | GHC 8.2.1 is out, so now GHC's support window only extends back to GHC 8.0. This means we can delete gobs of code that was only used for GHC 7.10 support. Hooray! Test Plan: ./validate Reviewers: hvr, bgamari, austin, goldfire, simonmar Reviewed By: bgamari Subscribers: Phyx, rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3781
* Remove 'deriving Typeable' statementsRyan Scott2016-05-241-3/+0
| | | | | | | | | | | | | | | | | Summary: Deriving `Typeable` has been a no-op since GHC 7.10, and now that we require 7.10+ to build GHC, we can remove all the redundant `deriving Typeable` statements in GHC. Test Plan: ./validate Reviewers: goldfire, austin, hvr, bgamari Reviewed By: austin, hvr, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2260
* Canonicalise `MonadPlus` instancesHerbert Valerio Riedel2016-01-011-9/+5
| | | | | | | This refactoring exploits the fact that since AMP, in most cases, `instance MonadPlus` can be automatically derived from the respective `Alternative` instance. This is because `MonadPlus`'s default method implementations are fully defined in terms of `Alternative(empty, (<>))`.
* Remove some redundant definitions/constraintsHerbert Valerio Riedel2015-12-311-1/+0
| | | | | | Starting with GHC 7.10 and base-4.8, `Monad` implies `Applicative`, which allows to simplify some definitions to exploit the superclass relationship. This a first refactoring to that end.
* MonadFail proposal, phase 1David Luposchainsky2015-11-171-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | This implements phase 1 of the MonadFail proposal (MFP, #10751). - MonadFail warnings are all issued as desired, tunable with two new flags - GHC was *not* made warning-free with `-fwarn-missing-monadfail-warnings` (but it's disabled by default right now) Credits/thanks to - Franz Thoma, whose help was crucial to implementing this - My employer TNG Technology Consulting GmbH for partially funding us for this work Reviewers: goldfire, austin, #core_libraries_committee, hvr, bgamari, fmthoma Reviewed By: hvr, bgamari, fmthoma Subscribers: thomie Projects: #ghc Differential Revision: https://phabricator.haskell.org/D1248 GHC Trac Issues: #10751
* Make Monad/Applicative instances MRP-friendlyHerbert Valerio Riedel2015-10-171-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | This patch refactors pure/(*>) and return/(>>) in MRP-friendly way, i.e. such that the explicit definitions for `return` and `(>>)` match the MRP-style default-implementation, i.e. return = pure and (>>) = (*>) This way, e.g. all `return = pure` definitions can easily be grepped and removed in GHC 8.1; Test Plan: Harbormaster Reviewers: goldfire, alanz, bgamari, quchen, austin Reviewed By: quchen, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1312
* Add ExceptionMonad instance for IOEnv.Edward Z. Yang2015-07-221-0/+10
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Error out on `Main` without `main` in GHCi (#7765)Thomas Miedema2015-02-231-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: GHC does 2 validation checks for module `Main`: * does `main` exist * is `main` exported (#414) The second check is done in ghc as well as in ghci (and runghc and ghc -e). The first check however is currently not done in ghci, to prevent "'main' is not in scope" errors when loading simple scripts. See commit d28ba8c8009 for more information. This commit tightens the special case for ghci. When the file does not contain a main function, but does contain an explicit module header (i.e. "module Main where"), then /do/ raise an error in ghci (and runghc and ghc -e) as well Test Plan: module/T7765: a module Main with an explicit module header but without a main function should be an error for all Ways. Additionaly: delete test module/mod174. It was added in commit 5a54c38, but it is a duplicate of module/T414. Reviewers: austin Reviewed By: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D649 GHC Trac Issues: #7765
* Use strict atomicModifyIORef' (added in GHC 7.6).Edward Z. Yang2015-01-281-5/+2
| | | | | | | | | | | | Summary: Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: austin, hvr Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D635
* Don't re-export `Alternative(..)` from Control.Monad (re #9586)Herbert Valerio Riedel2014-09-261-2/+0
| | | | | | | | | | | | | | | | | 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
* Make Applicative a superclass of MonadAustin Seipp2014-09-091-0/+3
| | | | | | | | | | | | | | | | | | | | | 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
* Add LANGUAGE pragmas to compiler/ source filesHerbert Valerio Riedel2014-05-151-1/+2
| | | | | | | | | | | | | | | | | | In some cases, the layout of the LANGUAGE/OPTIONS_GHC lines has been reorganized, while following the convention, to - place `{-# LANGUAGE #-}` pragmas at the top of the source file, before any `{-# OPTIONS_GHC #-}`-lines. - Moreover, if the list of language extensions fit into a single `{-# LANGUAGE ... -#}`-line (shorter than 80 characters), keep it on one line. Otherwise split into `{-# LANGUAGE ... -#}`-lines for each individual language extension. In both cases, try to keep the enumeration alphabetically ordered. (The latter layout is preferable as it's more diff-friendly) While at it, this also replaces obsolete `{-# OPTIONS ... #-}` pragma occurences by `{-# OPTIONS_GHC ... #-}` pragmas.
* Mask async exceptions in forkM_Edsko de Vries2013-12-031-1/+3
| | | | See #8006 for the reason why. This is not a fix as such; more of a workaround.
* Fix AMP warnings.Austin Seipp2013-09-111-1/+6
| | | | | Authored-by: David Luposchainsky <dluposchainsky@gmail.com> Signed-off-by: Austin Seipp <austin@well-typed.com>
* Remove some commented out SPECIALIZE pragmasIan Lynagh2013-03-101-20/+0
| | | | As far as I can see, they've never been enabled
* Refactoring: Make a HasModule class for getModuleIan Lynagh2012-11-021-0/+5
|
* Fix validateIan Lynagh2012-01-191-0/+5
| | | | | | | | This patch defines a flag -fno-warn-pointless-pragmas, and uses it to disable some warnings in the containers package. Along the way, also made a ContainsDynFlags class, and added a HasDynFlags instance for IOEnv (and thus TcRnIf and DsM).
* Add some documentation to IOEnv.David Terei2011-10-251-0/+4
|
* Make updates to the external package state atomic.Thomas Schilling2009-08-161-2/+15
|
* Support for -fwarn-unused-do-bind and -fwarn-wrong-do-bind, as per #3263Max Bolingbroke2009-07-011-1/+1
|
* Remove legacy code that isn't used now that we require GHC >= 6.8Ian Lynagh2009-05-241-6/+0
|
* disable MonadPlus instance that doesn't compile with 6.6Simon Marlow2008-11-061-0/+6
|
* Add (a) CoreM monad, (b) new Annotations featuresimonpj@microsoft.com2008-10-301-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch, written by Max Bolingbroke, does two things 1. It adds a new CoreM monad (defined in simplCore/CoreMonad), which is used as the top-level monad for all the Core-to-Core transformations (starting at SimplCore). It supports * I/O (for debug printing) * Unique supply * Statistics gathering * Access to the HscEnv, RuleBase, Annotations, Module The patch therefore refactors the top "skin" of every Core-to-Core pass, but does not change their functionality. 2. It adds a completely new facility to GHC: Core "annotations". The idea is that you can say {#- ANN foo (Just "Hello") #-} which adds the annotation (Just "Hello") to the top level function foo. These annotations can be looked up in any Core-to-Core pass, and are persisted into interface files. (Hence a Core-to-Core pass can also query the annotations of imported things.) Furthermore, a Core-to-Core pass can add new annotations (eg strictness info) of its own, which can be queried by importing modules. The design of the annotation system is somewhat in flux. It's designed to work with the (upcoming) dynamic plug-ins mechanism, but is meanwhile independently useful. Do not merge to 6.10!
* Use a proper exception for IOEnvFailure, not just a UserErrorIan Lynagh2008-10-031-3/+14
|
* Use an extensible-exceptions package when bootstrappingIan Lynagh2008-10-031-4/+0
| | | | | | | Ifdefs for whether we had extensible exceptions or not were spreading through GHC's source, and things would only have got worse for the next 2-3 years, so instead we now use an implementation of extensible exceptions built on top of the old exception type.
* Don't capture error calls in tryUserpepe2008-09-261-1/+1
| | | | | | | A previous patch slightly changed the semantics of tryUser. This patch restores the original behaviour (as expected in :print)
* Follow changes in the base libraryIan Lynagh2008-07-311-3/+9
| | | | | TopHandler now uses the new extensible exceptions module, so we need to interact with it using the new types.
* Properly comment out unused pragmasIan Lynagh2008-07-201-14/+14
| | | | | | | We now say -- {-# SPECIALIZE ... rather than {-# -- SPECIALIZE ...
* Fix warnings in IOEnvIan Lynagh2008-02-181-14/+8
|
* Whitespace onlyIan Lynagh2008-02-181-24/+24
|
* Remove unused custom versions of monad combinators from IOEnvTwan van Laarhoven2008-01-171-70/+21
|
* Replace remaining uses of ioToIOEnv by liftIO, remove ioToIOEnvTwan van Laarhoven2008-01-171-4/+0
|
* MonadIO instance for IOEnvTwan van Laarhoven2008-01-171-6/+9
|
* Added Applicative instance for IOEnvTwan van Laarhoven2008-01-171-6/+10
|
* Add anyM to IOEnvsimonpj@microsoft.com2007-10-271-1/+6
|
* Comments onlysimonpj@microsoft.com2007-10-101-1/+3
|
* Move OPTIONS pragmas above commentsIan Lynagh2007-09-211-6/+6
| | | | Fixes building with -Werror (i.e. validate) and GHC < 6.6
* Fix CodingStyle#Warnings URLsIan Lynagh2007-09-041-1/+1
|
* Use OPTIONS rather than OPTIONS_GHC for pragmasIan Lynagh2007-09-031-2/+2
| | | | | | | Older GHCs can't parse OPTIONS_GHC. This also changes the URL referenced for the -w options from WorkingConventions#Warnings to CodingStyle#Warnings for the compiler modules.
* Add {-# OPTIONS_GHC -w #-} and some blurb to all compiler modulesIan Lynagh2007-09-011-0/+7
|
* Make a Functor (IOEnv m) instance so it satisfies the new Quasi requirementsIan Lynagh2007-03-221-0/+3
|