- 18 Jan, 2016 1 commit
-
-
I missed a crucial step in the wiring-in process of `CallStack` in D861, the bit where you actually wire-in the Name... This led to a nasty bug where GHC thought `CallStack` was not wired-in and tried to fingerprint it, which failed because the defining module was not loaded. But we don't need `CallStack` to be wired-in anymore since `error` and `undefined` no longer need to be wired-in. So we just remove them all. Updates haddock submodule. Test Plan: `./validate` and `make slowtest TEST=tc198` Reviewers: simonpj, goldfire, austin, hvr, bgamari Reviewed By: simonpj, bgamari Subscribers: goldfire, thomie Projects: #ghc Differential Revision: https://phabricator.haskell.org/D1739 GHC Trac Issues: #11331
-
- 23 Dec, 2015 1 commit
-
-
This introduces "freezing," an operation which prevents further locations from being appended to a CallStack. Library authors may want to prevent CallStacks from exposing implementation details, as a matter of hygiene. For example, in ``` head [] = error "head: empty list" ghci> head [] *** Exception: head: empty list CallStack (from implicit params): error, called at ... ``` including the call-site of `error` in `head` is not strictly necessary as the error message already specifies clearly where the error came from. So we add a function `freezeCallStack` that wraps an existing CallStack, preventing further call-sites from being pushed onto it. In other words, ``` pushCallStack callSite (freezeCallStack callStack) = freezeCallStack callStack ``` Now we can define `head` to not produce a CallStack at all ``` head [] = let ?callStack = freezeCallStack emptyCallStack in error "head: empty list" ghci> head [] *** Exception: head: empty list CallStack (from implicit params): error, called at ... ``` --- 1. We add the `freezeCallStack` and `emptyCallStack` and update the definition of `CallStack` to support this functionality. 2. We add `errorWithoutStackTrace`, a variant of `error` that does not produce a stack trace, using this feature. I think this is a sensible wrapper function to provide in case users want it. 3. We replace uses of `error` in base with `errorWithoutStackTrace`. The rationale is that base does not export any functions that use CallStacks (except for `error` and `undefined`) so there's no way for the stack traces (from Implicit CallStacks) to include user-defined functions. They'll only contain the call to `error` itself. As base already has a good habit of providing useful error messages that name the triggering function, the stack trace really just adds noise to the error. (I don't have a strong opinion on whether we should include this third commit, but the change was very mechanical so I thought I'd include it anyway in case there's interest) 4. Updates tests in `array` and `stm` submodules Test Plan: ./validate, new test is T11049 Reviewers: simonpj, nomeata, goldfire, austin, hvr, bgamari Reviewed By: simonpj Subscribers: thomie Projects: #ghc Differential Revision: https://phabricator.haskell.org/D1628 GHC Trac Issues: #11049
-
- 02 Oct, 2015 1 commit
-
-
CallStack requires tuples, instances of which are defined in GHC.Tuple. Unfortunately the change made in D757 to the `Typeable` deriving mechanism means that `GHC.Tuple` must import `GHC.Types` for types necessary to generate type representations. This results in a cycle. Test Plan: Validate Reviewers: gridaphobe, austin, hvr Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1298
-
- 02 Sep, 2015 1 commit
-
-
This patch modifies `error`, `undefined`, and `assertError` to use implicit call-stacks to provide better error messages to users. There are a few knock-on effects: - `GHC.Classes.IP` is now wired-in so it can be used in the wired-in types for `error` and `undefined`. - `TysPrim.tyVarList` has been replaced with a new function `TysPrim.mkTemplateTyVars`. `tyVarList` made it easy to introduce subtle bugs when you need tyvars of different kinds. The naive ``` tv1 = head $ tyVarList kind1 tv2 = head $ tyVarList kind2 ``` would result in `tv1` and `tv2` sharing a `Unique`, thus substitutions would be applied incorrectly, treating `tv1` and `tv2` as the same tyvar. `mkTemplateTyVars` avoids this pitfall by taking a list of kinds and producing a single tyvar of each kind. - The types `GHC.SrcLoc.SrcLoc` and `GHC.Stack.CallStack` now live in ghc-prim. - The type `GHC.Exception.ErrorCall` has a new constructor `ErrorCallWithLocation` that takes two `String`s instead of one, the 2nd one being arbitrary metadata about the error (but usually the call-stack). A bi-directional pattern synonym `ErrorCall` continues to provide the old API. Updates Cabal, array, and haddock submodules. Reviewers: nh2, goldfire, simonpj, hvr, rwbarton, austin, bgamari Reviewed By: simonpj Subscribers: rwbarton, rodlogic, goldfire, maoe, simonmar, carter, liyang, bgamari, thomie Differential Revision: https://phabricator.haskell.org/D861 GHC Trac Issues: #5273
-
- 07 Nov, 2014 1 commit
-
-
Herbert Valerio Riedel authored
This commit mostly converts literate comments into ordinary Haskell comments or sometimes even Haddock comments, while also removing literate comments in a few cases where they don't make much sense anymore. Moreover, in a few cases trailing whitespaces were removed as well. Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D456
-
- 22 Sep, 2013 1 commit
-
-
Herbert Valerio Riedel authored
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>
-
- 17 Sep, 2013 1 commit
-
-
Herbert Valerio Riedel authored
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>
-
- 07 Jun, 2013 1 commit
-
-
ian@well-typed.com authored
-
- 06 Jun, 2013 2 commits
-
-
Simon Peyton Jones authored
GHC relies internally on GCh.Integer.Type.mkInteger from integer-gmp, but the dependency isn't visible to the build system, so we need to add it here.
-
Simon Peyton Jones authored
* Do not have have an hs-boot file for Data.Typeable * Instead make all the loops go through GHC.Err (just a couple of magic functions) GHC.Exception (some non-exceptional functions) The main idea is a) don't involve classes in the hs-boot world b) loop through error cases where performance doesn't matter c) be careful not to SOURCE import things that are bottom, unless MkCore knows about them in eRROR_IDS, so that we see their strictness
-
- 27 Oct, 2012 1 commit
-
-
ian@well-typed.com authored
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
-
- 04 Jul, 2012 1 commit
-
-
Simon Marlow authored
As per discussion on the libraries list.
-
- 28 Feb, 2012 1 commit
-
-
Ian Lynagh authored
I think it was all to work around problems in old versions of haddock.
-
- 18 Jun, 2011 1 commit
-
-
dterei authored
-
- 28 Jan, 2011 1 commit
-
-
simonpj@microsoft.com authored
Add explicit {-# LANGUAGE xxx #-} pragmas to each module, that say what extensions that module uses. This makes it clearer where different extensions are used in the (large, variagated) base package. Now base.cabal doesn't need any extensions field Thanks to Bas van Dijk for doing all the work.
-
- 05 Aug, 2008 3 commits
-
-
Ian Lynagh authored
-
Ian Lynagh authored
-
Ian Lynagh authored
-
- 01 Aug, 2008 1 commit
-
-
Ian Lynagh authored
-
- 30 Jul, 2008 1 commit
-
-
Ian Lynagh authored
-
- 21 Jun, 2008 1 commit
-
-
Ian Lynagh authored
Everything above is largely unchanged; just the type of catch and throw.
-
- 16 Jun, 2008 1 commit
-
-
Ian Lynagh authored
-
- 05 Mar, 2008 1 commit
-
-
Don Stewart authored
-
- 20 Jan, 2008 1 commit
-
-
Ross Paterson authored
-
- 15 Jan, 2007 1 commit
-
-
Ian Lynagh authored
-
- 03 Feb, 2005 1 commit
-
-
ross authored
hide GHC internals from Haddock
-
- 11 Jan, 2005 1 commit
-
-
simonmar authored
Use OPTIONS_GHC instead of OPTIONS
-
- 26 Jul, 2004 1 commit
-
-
ross authored
a few odd docs
-
- 18 Sep, 2002 1 commit
-
-
simonmar authored
Sort out the divide-by-zero situation. Some integer division operations called error on a divide by zero, and some didn't test for it. Now we always raise the DivideByZero exception. MERGE TO STABLE
-
- 18 Jun, 2002 1 commit
-
-
simonpj authored
--------------------------------------- Rehash the handling of SeqOp --------------------------------------- See the comments in the commentary (Cunning Prelude Code). * Expunge SeqOp altogether * Add GHC.Base.lazy :: a -> a to GHC.Base * Add GHC.Base.lazy to basicTypes/MkId. The idea is that this defn will over-ride the info from GHC.Base.hi, thereby hiding strictness and unfolding * Make stranal/WorkWrap do a "manual inlining" for GHC.Base.lazy This happens nicely after the strictness analyser has run. * Expunge the SeqOp/ParOp magic in CorePrep * Expunge the RULE for seq in PrelRules * Change the defns of pseq/par in GHC.Conc to: {-# INLINE pseq #-} pseq :: a -> b -> b pseq x y = x `seq` lazy y {-# INLINE par #-} par :: a -> b -> b par x y = case (par# x) of { _ -> lazy y }
-
- 09 May, 2002 1 commit
-
-
simonmar authored
Omit the imports in Haddock, to avoid module recursion
-
- 26 Apr, 2002 1 commit
-
-
simonmar authored
- Add proper module headers to these guys - Remove \$Id\$ - Update copyrights - Int.lhs and Word.lhs were just wrapped in \begin{code}..\end{code}, so make them .hs files instead.
-
- 11 Apr, 2002 1 commit
-
-
simonpj authored
------------------- Mainly derived Read ------------------- This commit is a tangle of several things that somehow got wound up together, I'm afraid. The main course ~~~~~~~~~~~~~~~ Replace the derived-Read machinery with Koen's cunning new parser combinator library. The result should be * much smaller code sizes from derived Read * faster execution of derived Read WARNING: I have not thoroughly tested this stuff; I'd be glad if you did! All the hard work is done, but there may be a few nits. The Read class gets two new methods, not exposed in the H98 inteface of course: class Read a where readsPrec :: Int -> ReadS a readList :: ReadS [a] readPrec :: ReadPrec a -- NEW readListPrec :: ReadPrec [a] -- NEW There are the following new libraries: Text.ParserCombinators.ReadP Koens combinator parser Text.ParserCombinators.ReadPrec Ditto, but with precedences Text.Read.Lex An emasculated lexical analyser that provides the functionality of H98 'lex' TcGenDeriv is changed to generate code that uses the new libraries. The built-in instances of Read (List, Maybe, tuples, etc) use the new libraries. Other stuff ~~~~~~~~~~~ 1. Some fixes the the plumbing of external-core generation. Sigbjorn did most of the work earlier, but this commit completes the renaming and typechecking plumbing. 2. Runtime error-generation functions, such as GHC.Err.recSelErr, GHC.Err.recUpdErr, etc, now take an Addr#, pointing to a UTF8-encoded C string, instead of a Haskell string. This makes the *calls* to these functions easier to generate, and smaller too, which is a good thing. In particular, it means that MkId.mkRecordSelectorId doesn't need to be passed "unpackCStringId", which was GRUESOME; and that in turn means that tcTypeAndClassDecls doesn't need to be passed unf_env, which is a very worthwhile cleanup. Win/win situation. 3. GHC now faithfully translates do-notation using ">>" for statements with no binding, just as the report says. While I was there I tidied up HsDo to take a list of Ids instead of 3 (but now 4) separate Ids. Saves a bit of code here and there. Also introduced Inst.newMethodFromName to package a common idiom.
-
- 31 Jul, 2001 2 commits
- 28 Jun, 2001 1 commit
-
-
simonmar authored
First cut of the Haskell Core Libraries ======================================= NOTE: it's not meant to be a working snapshot. The code is just here to look at and so the NHC/Hugs guys can start playing around with it. There is no build system. For GHC, the libraries tree is intended to be grafted onto an existing fptools/ tree, and the Makefile in libraries/core is a quick hack for that setup. This won't work at the moment without the other changes needed in fptools/ghc, which I haven't committed because they'll cause breakage. However, with the changes required these sources build a working Prelude and libraries. The layout mostly follows the one we agreed on, with one or two minor changes; in particular the Data/Array layout probably isn't final (there are several choices here). The document is in libraries/core/doc as promised. The cbits stuff is just a copy of ghc/lib/std/cbits and has GHC-specific stuff in it. We should really separate the compiler-specific C support from any compiler-independent C support there might be. Don't pay too much attention to the portability or stability status indicated in the header of each source file at the moment - I haven't gone through to make sure they're all consistent and make sense. I'm using non-literate source outside of GHC/. Hope that's ok with everyone. We need to discuss how the build system is going to work...
-