summaryrefslogtreecommitdiff
path: root/libraries/base/GHC/Show.lhs
Commit message (Collapse)AuthorAgeFilesLines
* base: Manually unlit .lhs into .hs modulesHerbert Valerio Riedel2014-11-071-544/+0
| | | | | | | | | | | | | 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
* Remove redundant "Minimal complete definition"-commentsHerbert Valerio Riedel2014-11-041-3/+2
| | | | | | | | | | | | Those manual descriptions in Haddock strings have become redundant since Haddock gained the ability to print the minimal complete definition as specified via `{-# MINIMAL #-}` annotation (or otherwise inferred by GHC). Moreover, this commit moves all `{-# MINIMAL #-}` annotations in `base` to the start of the respective `class` definitions, as this is more readable and matches more closely the way Haddock renders that information.
* Fixed missing trailing newline bug in pretty printerMateusz Lenik2014-10-301-0/+1
| | | | | | | | | | | | | | | | Summary: Pretty printer didn't produce trailing newline in strings in error messages. Reviewers: simonpj, austin Reviewed By: austin Subscribers: thomie, carter, simonmar, mlen Differential Revision: https://phabricator.haskell.org/D405 GHC Trac Issues: #9681
* Auto-derive a few manually coded Show instancesHerbert Valerio Riedel2014-09-191-16/+4
| | | | | | | | | | | | | | | | | In `base`, the instances instance Show () instance Show Bool instance Show Ordering instance Show a => Show (Maybe a) where defined manually, even though we can leverage GHC's auto-deriver which is perfectly capable by standalone derivation to avoid boiler-plate code such as this. Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D219
* Move `Maybe`-typedef into GHC.BaseHerbert Valerio Riedel2014-09-161-1/+0
| | | | | | | This is preparatory work for reintroducing SPECIALISEs that were lost in d94de87252d0fe2ae97341d186b03a2fbe136b04 Differential Revision: https://phabricator.haskell.org/D214
* Specialise Eq, Ord, Read, Show at Int, Char, StringSimon Peyton Jones2014-08-281-1/+4
| | | | | These instances are quite common, so it's good to have pre-specialised versions available
* 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>
* Follow changes in comparison primops (see #6135)Jan Stolarek2013-09-181-9/+9
|
* Add `{-# MINIMAL #-}` annotations to typeclassesHerbert Valerio Riedel2013-09-181-0/+1
| | | | | | | | | | | | | | | | | This makes use of the new `{-# MINIMAL #-}` facility (see #7633) for the following typeclasses - `Bits` - `Foldable` - `Fractional` - `Num` - `MonadZip` - `Read` - `Show` - `Storable` - `Traversable` Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* typosGabor Greif2013-01-251-1/+1
|
* Fix Trac #7146, by displaying a "\n" in a multi-line stringSimon Peyton Jones2012-08-151-2/+2
|
* Move GHC.Generics to baseJose Pedro Magalhaes2012-06-211-10/+0
| | | | | There is no real reason for it to be in ghc-prim, and it complicates things.
* Move the Word type from base to ghc-primIan Lynagh2012-05-211-0/+10
|
* Remove some more specialise-Int codeIan Lynagh2012-05-211-5/+2
|
* Remove some unnecessary Int specialised valuesIan Lynagh2012-05-211-1/+1
| | | | We no longer need zeroInt and friends
* Use the new quotRemInt# primopIan Lynagh2012-02-141-4/+8
|
* De-orphan the Show Integer instanceIan Lynagh2011-10-121-1/+115
|
* Fixed documentation bugDaniel Fischer2011-10-021-1/+1
|
* Whitespace only in GHC.ShowDaniel Fischer2011-10-021-25/+25
|
* Correct a commentIan Lynagh2011-07-071-5/+3
|
* SafeHaskell: Added SafeHaskell to baseDavid Terei2011-06-181-0/+1
|
* Move Eq and Ord for Int from GHC.Base to GHC.Classes, so they are not longer ↵Jose Pedro Magalhaes2011-05-031-1/+10
| | | | | | orphan. Put Eq and Ord instances for Arity, Associativity, and Fixity in GHC.Classes, Show instances in GHC.Show, and Read instances in GHC.Read.
* Use explicit language extensions & remove extension fields from base.cabalsimonpj@microsoft.com2011-01-281-2/+2
| | | | | | | | | | 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.
* Add LANGUAGE BangPatterns to modules that use bang patternssimonpj@microsoft.com2010-11-121-0/+1
|
* Add showMultiLineString to GHC.Showsimonpj@microsoft.com2010-10-251-11/+37
| | | | | | | | | | | | | | This is part of the fix for #4436 showMultiLineString :: String -> [String] -- | Like 'showLitString' (expand escape characters using Haskell -- escape conventions), but -- * break the string into multiple lines -- * wrap the entire thing in double quotes -- Example: @breakMultiLineString "hello\ngoodbye\nblah"@ -- returns @["\"hello\\", "\\goodbye\\", "\\blah\"" ]@ -- where those "\\" are really just a single backslash -- (but I'm writing them here as Haskell literals)
* Use a bang pattern when we where/let-bind values with unlifted typesIan Lynagh2009-04-241-1/+1
|
* Remove unused conditional importIan Lynagh2008-08-061-5/+1
|
* Fix warningsIan Lynagh2008-08-051-4/+6
|
* Change some imports and derive Show (Either a b)Ian Lynagh2008-08-041-9/+0
| | | | rather than writing it by hand in GHC.Show
* Avoid using deprecated flagsIan Lynagh2008-06-161-1/+1
|
* untabifyDon Stewart2008-03-051-102/+102
|
* haddock attributes for haddock-2.0Ross Paterson2008-01-201-0/+1
|
* the "unknown" types are no longer requiredSimon Marlow2007-04-261-29/+0
|
* Added Unknowns for higher kindsPepe Iborra2006-11-081-0/+17
|
* Improved the Show instance for UnknownPepe Iborra2006-08-131-1/+2
|
* Show instance for GHC.Base.Unknownmnislaih@gmail.com2006-08-011-0/+11
|
* Rework previous: not a gcc bug after allSimon Marlow2006-03-231-6/+7
| | | | | | It turns out that we were relying on behaviour that is undefined in C, and undefined behaviour in C means "the compiler can do whatever the hell it likes with your entire program". So avoid that.
* [project @ 2005-03-09 17:47:50 by simonpj]simonpj2005-03-091-22/+70
| | | | Add instances for Bounded and Show up to 15-tuples
* [project @ 2005-02-03 10:32:11 by ross]ross2005-02-031-0/+1
| | | | hide GHC internals from Haddock
* [project @ 2005-01-11 16:04:08 by simonmar]simonmar2005-01-111-1/+1
| | | | Use OPTIONS_GHC instead of OPTIONS
* [project @ 2004-07-26 13:26:41 by ross]ross2004-07-261-1/+89
| | | | docs only
* [project @ 2003-08-26 10:39:55 by ross]ross2003-08-261-0/+8
| | | | | | | Document Data.Char from the H98 Report. Note that the new implementations of isSpace and isDigit are inconsistent with this documentation -- maybe two versions of them are needed?
* [project @ 2003-08-19 16:39:13 by simonmar]simonmar2003-08-191-143/+14
| | | | | | | | | | | | | | | Use the wide-char classifications from the C library if available. This gives us Unicode-aware isLower, isUpper, isAlpha etc. On Unix, you have to set your locale to something. This is usually done by setting the environment variable LANG, eg. export LANG=en This stuff *should* also work on Windows, except that Windows uses a 16-bit wchar_t so will get it wrong for characters > '\xffff'. However, I figured it was better to use the system-supplied functionality rather than trying to implement this stuff ourselves.
* [project @ 2002-07-23 14:52:46 by simonpj]simonpj2002-07-231-8/+14
| | | | | | | | | Various precedence errors in the code for read and show. A couple (the show instances for Ratio and Array) were actually errors in the Library Report. A couple more were to do with whether the precedence of application is 9 (wrong) or 10 (right).
* [project @ 2002-04-26 12:48:16 by simonmar]simonmar2002-04-261-9/+13
| | | | | | | | - 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.
* [project @ 2002-04-11 12:03:43 by simonpj]simonpj2002-04-111-7/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ------------------- 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.
* [project @ 2001-12-21 15:07:20 by simonmar]simonmar2001-12-211-3/+3
| | | | | Merge up to the ghc/lib/std on the HEAD (tagged as new-libraries-last-merged).
* [project @ 2001-07-03 14:13:32 by simonmar]simonmar2001-07-031-2/+3
| | | | | Move generic Maybe and Either definitions from GHC.Maybe to Data.Maybe and Data.Either, and remove GHC.Maybe.
* [project @ 2001-07-03 11:37:49 by simonmar]simonmar2001-07-031-2/+1
| | | | | | | | | | Latest round of changes, incorporating: - some changes to the portability/stability requested by Malcolm - Control.Monad.Fix is portable, IO/ST instances moved to System.IO, Control.Monad.ST respectively. - GHC.Tup moved to Data.Tuple, the code in here is mostly portable (and the interface better be).
* [project @ 2001-06-28 14:15:04 by simonmar]simonmar2001-06-281-0/+378
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...