| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
This is preparatory work for reintroducing SPECIALISEs that were lost
in d94de87252d0fe2ae97341d186b03a2fbe136b04
Differential Revision: https://phabricator.haskell.org/D214
|
|
|
|
|
| |
These instances are quite common, so it's good to have
pre-specialised versions available
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
| |
|
|
|
|
|
| |
There is no real reason for it to be in ghc-prim, and it
complicates things.
|
| |
|
| |
|
|
|
|
| |
We no longer need zeroInt and friends
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
| |
|
| |
|
| |
|
|
|
|
| |
rather than writing it by hand in GHC.Show
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Add instances for Bounded and Show up to 15-tuples
|
|
|
|
| |
hide GHC internals from Haddock
|
|
|
|
| |
Use OPTIONS_GHC instead of OPTIONS
|
|
|
|
| |
docs only
|
|
|
|
|
|
|
| |
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?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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).
|
|
|
|
|
|
|
|
| |
- 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-------------------
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.
|
|
|
|
|
| |
Merge up to the ghc/lib/std on the HEAD (tagged as
new-libraries-last-merged).
|
|
|
|
|
| |
Move generic Maybe and Either definitions from GHC.Maybe to Data.Maybe
and Data.Either, and remove GHC.Maybe.
|
|
|
|
|
|
|
|
|
|
| |
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).
|
|
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...
|