summaryrefslogtreecommitdiff
path: root/libraries/base/System
Commit message (Collapse)AuthorAgeFilesLines
* `M-x delete-trailing-whitespace` & `M-x untabify`Herbert Valerio Riedel2014-09-244-36/+36
| | | | ...several modules in `base` recently touched by me
* Simplify import-graph a bit moreHerbert Valerio Riedel2014-09-211-1/+1
| | | | | | This is preparatory refactoring for avoiding import cycles when `Data.Traversable` will be imported by `Control.Monad` and `Data.List` for implementing #9586
* Move Applicative/MonadPlus into GHC.BaseHerbert Valerio Riedel2014-09-181-4/+0
| | | | | | | | | | | This is necessary in order to invert the import-dependency between Data.Foldable and Control.Monad (for addressing #9586) This also updates the `binary` submodule to qualify a GHC.Base import Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D223
* Move `when` to GHC.BaseHerbert Valerio Riedel2014-09-181-4/+1
| | | | | | | | | This allows several modules to avoid importing Control.Monad and thus break import cycles that manifest themselves when implementing #9586 Reviewed By: austin, ekmett Differential Revision: https://phabricator.haskell.org/D222
* base: replace ver 4.7.1.0 references by 4.8.0.0Herbert Valerio Riedel2014-09-091-1/+1
| | | | | | | Since we now had to major bump due to AMP being landed, `base-4.7.1.0` is not gonna happen, as we're going straight for a `base-4.8.0.0` release. [skip ci] since this is a doc-only change
* Fix validate falloutAustin Seipp2014-07-281-1/+0
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* base: make System.IO.openTempFile generate less predictable namesSergei Trofimovich2014-07-281-8/+16
| | | | | | | | | | | | | | | | | It basically changes prefix ++ getpid() ++ seq_no ++ suffix for prefix ++ rand() ++ rand() ++ suffix Which make any call to 'openTempFile' finish without loops. Bug-report: https://ghc.haskell.org/trac/ghc/ticket/9058 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Signed-off-by: Austin Seipp <austin@well-typed.com>
* Replace DeriveDataTypeable by AutoDeriveTypeableHerbert Valerio Riedel2014-05-273-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a first step towards addressing #9111 This results in the following additional Typeable (exported) instances being generated (list was compiled by diff'ing hoogle txt output): instance Typeable CFile instance Typeable 'CFile instance Typeable CFpos instance Typeable 'CFpos instance Typeable CJmpBuf instance Typeable 'CJmpBuf instance Typeable ChItem instance Typeable QSem instance Typeable ID instance Typeable 'ID instance Typeable CONST instance Typeable Qi instance Typeable Qr instance Typeable Mp instance Typeable ConstrRep instance Typeable Fixity instance Typeable 'Prefix instance Typeable 'Infix instance Typeable Constr instance Typeable DataType instance Typeable DataRep instance Typeable Data instance Typeable HasResolution instance Typeable IsList Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Generalise type of recently added System.Exit.dieHerbert Valerio Riedel2014-04-211-1/+1
| | | | | | | | | | This is a follow-up to 77ea2eb0ab36d1a (re #9016) which added `die` with a return type of `IO ()` even though all other functions in System.Exit have the more general return type `IO a`. It is assumed this was an oversight in the original proposal. Acked-by: Edward Kmett <ekmett@gmail.com> Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Add System.Exit.die (re #9016)Simon Hengel2014-04-211-0/+7
| | | | | | | | | The original proposal discussion can be found at http://thread.gmane.org/gmane.comp.lang.haskell.libraries/20872 Note this also updates the Haddock submodule to remove Hadock's local `die` implementation.
* Add a couple of `/Since: 4.7.0.0/` annotationsHerbert Valerio Riedel2013-11-011-0/+4
| | | | Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Fix Windows build.Austin Seipp2013-10-011-8/+8
| | | | | | | | | | | In dfb52c3d the default language was set to Haskell2010 - by default, GHC is less strict about the layout rule (controlled by -XNonincreasingIndentation), but not when we explicitly set the language to H2010. It turns out we relied on this behavior in the Windows build. Thanks to Reid Barton for pointing this out. Signed-off-by: Austin Seipp <austin@well-typed.com>
* System.IO.Unsafe: cleanup: make unsafeFixIO pseudocode more validSergei Trofimovich2013-09-301-1/+1
| | | | Signed-off-by: Sergei Trofimovich <slyfox at gentoo.org>
* Fix name of minor GC function.Austin Seipp2013-09-301-1/+1
| | | | | | I accidentally forgot to commit this. Signed-off-by: Austin Seipp <austin@well-typed.com>
* Expose performMinorGC (#8257)Austin Seipp2013-09-291-6/+14
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Drop redundant `{-# LANGUAGE #-}` pragmasHerbert Valerio Riedel2013-09-286-7/+4
| | | | | | | | | | | | | This removes language pragmas from Haskell modules which are implicitly active with `default-language: Haskell2010`. Specifically, the following language extension pragmas are removed by this commit: - PatternGuards - ForeignFunctionInterface - EmptyDataDecls - NoBangPatterns Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Remove obsolete pre-Haddock-2 `#hide` pragmasHerbert Valerio Riedel2013-09-231-1/+0
| | | | | | | | | | | | The now obsolete (and redundant) `#hide` pragmas have been superseded by `{-# OPTIONS_HADDOCK hide #-}` pragmas which are used by most of the affected modules anyway. This commit also adds proper `{-# OPTIONS_HADDOCK hide #-}` pragmas to `GHC.Desugar` and `GHC.IO.Encoding.Iconv` which had only the ineffective `#hide` annotation. Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Add Haddock `/Since: 4.4.0.0/` comments to symbolsHerbert Valerio Riedel2013-09-221-0/+4
| | | | | | | | | | This commit retroactively adds `/Since: 4.4.0.0/` annotations to symbols newly added/exposed in `base-4.4.0.0` (as shipped with GHC 7.2.1). See also 6368362f which adds the respective annotation for symbols newly added in `base-4.7.0.0` (that goes together with GHC 7.8.1). Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Add Haddock `/Since: 4.5.[01].0/` comments to symbolsHerbert Valerio Riedel2013-09-221-0/+1
| | | | | | | | | | This commit retroactively adds `/Since: 4.5.[01].0/` annotations to symbols newly added/exposed in `base-4.5.[01].0` (as shipped with GHC 7.4.[12]). See also 6368362f which adds the respective annotation for symbols newly added in `base-4.7.0.0` (that goes together with GHC 7.8.1). Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Add Haddock `/Since: 4.6.0.0/` comments to symbolsHerbert Valerio Riedel2013-09-212-0/+5
| | | | | | | | | | This commit retroactively adds `/Since: 4.6.0.0/` annotations to symbols newly added/exposed in `base-4.6.0.0` (as shipped with GHC 7.6.1). See also 6368362f which adds the respective annotation for symbols newly added in `base-4.7.0.0` (that goes together with GHC 7.8.1). Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Add Haddock `/Since: 4.7.0.0/` comments to new symbolsHerbert Valerio Riedel2013-09-212-0/+6
| | | | | | | | | | | | | | | | | | These annotations were added in such a way, that the line {{{ /Since: 4.7.0.0/ }}} represents the last paragraph of the Haddock comment. Maybe Haddock will have support for this meta-syntax at some point, and be able to inherited the since-version property to the children of an annotated symbol and display the since-version property in the rendered documentation only in cases when it's not visually obvious (for instance, when re-exporting documentation strings). Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Make `<Typeable.h>` obsolete and refactor away its useHerbert Valerio Riedel2013-09-173-22/+16
| | | | | | | | | | | With GHC 7.8's PolyKinds the macros in `<Typeable.h>` are no longer of any use, and their use is clearly obsolete. The sites using those macros are replaced by auto-derivations of `Typeable` instances. This reduces reliance on the CPP extension and the compile dependency on `Typeable.h` in a couple of modules. Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Constant-fold `__GLASGOW_HASKELL__` CPP conditionalsHerbert Valerio Riedel2013-09-1713-105/+11
| | | | | | | | | | Now that HUGS and NHC specific code has been removed, this commit "folds" the now redundant `#if((n)def)`s containing `__GLASGOW_HASKELL__`. This renders `base` officially GHC only. This commit also removes redundant `{-# LANGUAGE CPP #-}`. Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Remove Hugs98 specific codeHerbert Valerio Riedel2013-09-1711-76/+2
| | | | | | | For rationale. see http://permalink.gmane.org/gmane.comp.lang.haskell.ghc.devel/2349 Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Add setEnv/unsetEnv to System.Environment; fixes #7427Ian Lynagh2013-06-151-2/+94
| | | | Patch from Simon Hengel.
* Remove an import loopIan Lynagh2013-06-021-9/+0
|
* Fix build on WindowsIan Lynagh2013-04-281-2/+7
|
* Fix warningsIan Lynagh2013-04-211-3/+2
|
* Implement faster System.Timeout.timeout for the threaded RTS.Bertram Felgenhauer2013-04-211-0/+33
| | | | | | | | | The basic idea is to use the Timer Manager rather than spawning an auxilliary thread to handle timeouts; this was proposed by Bas van Dijk two years ago (#4963), and recently by Herbert Valerio. The key idea to make this work is to spawn an auxilliary thread for the delivery of the Timeout exception. This idea as well as most of the code is due to Akio Takano.
* Fix System.Timeout.timeout leaking Timeout exceptions (#7719).Bertram Felgenhauer2013-04-211-1/+3
|
* Remove some always-true CPP tests from System.IO.ErrorIan Lynagh2013-02-171-8/+0
| | | | | | | If defined(__GLASGOW_HASKELL__) || defined(__HUGS__) was False then compilation would have failed anyway, e.g. due to a missing definition for annotateIOError.
* Define Functor instances for ArgOrder, OptDescr and ArgDescrBas van Dijk2013-02-171-0/+13
|
* Remove nhc98-specific files and contentIan Lynagh2013-02-1510-258/+9
|
* Use capi for mkfifo, tcsetattr and tcgetattr (for Android)Simon Marlow2013-01-301-3/+6
| | | | Submitted by: Nathan Hüsken <nathan.huesken@posteo.de>
* Removes the assumption that CLK_TCK is a constant (#7519)Simon Marlow2013-01-231-21/+3
| | | | | | (which is not true on QNXNTO). Submitted by: Stephen Paul Weber <singpolyma@singpolyma.net>
* Make a class for asynchronous exceptions in the exception hierarchySimon Marlow2012-12-101-2/+8
| | | | | | | | | | | | | | | | | | | | | | Right now, we only have data AsyncException = StackOverflow | HeapOverflow | ThreadKilled | ... so it is not possible to add another async exception. For instance, the Timeout exception in System.Timeout should really be an async exception. This patch adds a superclass for all async exceptions: data SomeAsyncException = forall e . Exception e => SomeAsyncException e deriving Typeable and makes the existing AsyncException and Timeout children of SomeAsyncException in the hierarchy.
* Add newFilePath to System.Posix.InternalsIan Lynagh2012-12-011-0/+6
| | | | Needed for #7342
* GHC.Windows: more error support (guards, system error strings)Joey Adams2012-11-171-1/+1
| | | | | | | | | | | | | | | This changes the output of throwGetLastError to include the system error message, rather than the message of our fictitious errno. It also adds several definitions to GHC.Windows, mostly from the Win32 package. The exceptions are: * getErrorMessage: returns a String, unlike in System.Win32.Types, where it returns an LPWSTR. * errCodeToIOError: new * c_maperrno_func: new
* Remove commented types in module export listsIan Lynagh2012-10-278-101/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These comments are rather less useful now that haddock can give docs with the same informatino in the module synopsis. Having to maintain them when making changes to the library is a pain, and when people forget about doing so there is nothing that checks that the comments are right, so mistakes tend to linger. Of the comments that my script detected, 78 of 684 were already incorrect in one way or another, e.g. missing context: Text.Show.showsPrec Comment type: Int -> a -> ShowS Actual type: Show a => Int -> a -> ShowS wrong context: Numeric.readInt Comment type: Integral a => a -> (Char -> Bool) -> (Char -> Int) -> ReadS a Actual type: Num a => a -> (Char -> Bool) -> (Char -> Int) -> ReadS a not following a class change (e.g. Num losing its Eq superclass): Text.Read.Lex.readOctP Comment type: Num a => ReadP a Actual type: (Eq a, Num a) => ReadP a not following the Exceptions change: GHC.Conc.childHandler Comment type: Exception -> IO () Actual type: SomeException -> IO () or just always been wrong: GHC.Stable.deRefStablePtr Comment type: StablePtr a -> a Actual type: StablePtr a -> IO a
* Add a big warning to the documentation for Weak (#7250)Simon Marlow2012-09-211-9/+4
|
* add eqStableName :: StableName a -> StableName b -> BoolSimon Marlow2012-08-281-0/+11
|
* Add System.Environment.getExecutablePath (#7029)Paolo Capriotti2012-06-272-4/+179
| | | | Patch by Johan Tibell <johan.tibell@gmail.com>
* Remove Prelude.catch and System.IO.Error.{catch,try}Ian Lynagh2012-06-191-20/+2
| | | | This completes the proposal from trac #4865.
* Fix warning.Paolo Capriotti2012-06-081-0/+2
|
* Allow openTempFile to retry when it hits a directory (#4968).Paolo Capriotti2012-06-071-3/+25
| | | | | | Windows returns an EACCES error instead of EEXIST when a call to `open` fails due to an existing directory, so add a special case for this situation.
* Refactor findTempName: factor out file creation.Paolo Capriotti2012-06-071-25/+39
| | | | | Add openNewFile function, which creates a new file and returns a file descriptor for it.
* Change a few FFI imports to use CAPIIan Lynagh2012-05-201-4/+20
| | | | | | | | | | | | | | On Win64, ssize_t is 64 bit, but functions like read return 32 bit ints. The CAPI wrapper means the C compiler takes care of doing all the necessary casting. Technically we should instead be making the types of the FFI imports different on different platforms, but I think this will work out simpler overall. Before this fix, when the functions failed with -1, we thought they were returning with 4294967295, and so didn't throw an exception. This lead to a segfault in echo001(ghci).
* Don't use stdcall on Win64: It isn't supported; ccall is used insteadIan Lynagh2012-05-162-6/+27
|
* Fix build.Paolo Capriotti2012-05-081-1/+1
|
* Fix an off-by-one error in freeProgArgvIan Lynagh2012-05-021-1/+2
|