| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Signed-off-by: Austin Seipp <austin@well-typed.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
To address #2521 ("Trailing colon on GHC_PACKAGE_PATH doesn't work with
ghc-pkg"), we were using a custom version of splitSearchPath (e4f46f5de). This
solution however caused issue #9698 ("GHC_PACKAGE_PATH should be more lenient
for empty paths").
This patch reverts back to System.FilePath.splitSearchPath (fixes #9698) and
adresses (#2521) by testing for a trailing search path separators explicitly
(instead of implicitly using empty search path elements).
Empty paths are now allowed (ignored on Windows, interpreted as current
directory on Posix systems), and trailing path separator still tack on the
user and system package databases.
Also update submodule filepath, which has a version of splitSearchPath which
handles quotes in the same way as our custom version did.
Test Plan:
$ GHC_PACKAGE_PATH=/::/home: ./ghc-pkg list
...
db stack: ["/",".","/home","<userdb>","<systemdb>"]
...
Reviewers: austin
Reviewed By: austin
Subscribers: thomie, carter, simonmar
Differential Revision: https://phabricator.haskell.org/D414
GHC Trac Issues: #2521, #9698
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Using `dropWhileEndLE` tends to be faster and easier to read
than the `reverse . dropWhile p . reverse` idiom. This also cleans up
some other, nearby, messes. Fix #9616 (incorrect number formatting
potentially leading to incorrect numbers in output).
Test Plan: Run validate
Reviewers: thomie, rwbarton, nomeata, austin
Reviewed By: nomeata, austin
Subscribers: simonmar, ezyang, carter, thomie
Projects: #ghc
Differential Revision: https://phabricator.haskell.org/D259
GHC Trac Issues: #9623, #9616
Conflicts:
compiler/basicTypes/OccName.lhs
|
|
|
|
| |
This reverts commit 2a8856884de7d476e26b4ffa829ccb3a14d6f63e.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Using `dropWhileEndLE` tends to be faster and easier to read
than the `reverse . dropWhile p . reverse` idiom. This also cleans up
some other, nearby, messes. Fix #9616 (incorrect number formatting
potentially leading to incorrect numbers in output).
Test Plan: Run validate
Reviewers: thomie, rwbarton, nomeata, austin
Reviewed By: nomeata, austin
Subscribers: simonmar, ezyang, carter, thomie
Projects: #ghc
Differential Revision: https://phabricator.haskell.org/D259
GHC Trac Issues: #9623, #9616
Conflicts:
compiler/basicTypes/OccName.lhs
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
```
git grep -l '\(#ifdef \|#if defined\)(\?__GLASGOW_HASKELL__)\?'
```
Test Plan: validate
Reviewers: rwbarton, hvr, austin
Reviewed By: rwbarton, hvr, austin
Subscribers: rwbarton, simonmar, ezyang, carter
Differential Revision: https://phabricator.haskell.org/D218
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Since commits 8fe1f8 and bb6731 in the filepath packages (ticket #2034, closed
in 2010), takeDirectory "foo" returns ".", and not "", so this check is no
longer needed.
Other commits:
* Remove trailing whitespace
* Update comments for #2278
Test Plan: harbormaster
Reviewers: austin
Reviewed By: austin
Subscribers: simonmar, ezyang, carter
Differential Revision: https://phabricator.haskell.org/D213
GHC Trac Issues: #2034
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Per the usual standards, a build of GHC is only compileable
by the last two releases (e.g. 7.8 only by 7.4 and 7.6). To make sure
we don't get suckered into supporting older compilers, let's remove
this support now.
Signed-off-by: Austin Seipp <austin@well-typed.com>
Test Plan:
Try to bootstrap with GHC 7.4, watch it fail. Bootstrap
with 7.6 or better, and everything works.
Reviewers: hvr
Reviewed By: hvr
Subscribers: simonmar, ezyang, carter
Differential Revision: https://phabricator.haskell.org/D167
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Currently, if the same identifier is imported via multiple modules, ghci
shows multiple completions for it. Use the nub of the completions
instead so that it only shows up once.
Signed-off-by: Shachaf Ben-Kiki <shachaf@gmail.com>
Test Plan: by hand
Reviewers: simonmar, austin, hvr
Reviewed By: austin, hvr
Subscribers: hvr, simonmar, relrod, carter
Differential Revision: https://phabricator.haskell.org/D58
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Roles are a solution to the GeneralizedNewtypeDeriving type-safety
problem.
Roles were first described in the "Generative type abstraction" paper,
by Stephanie Weirich, Dimitrios Vytiniotis, Simon PJ, and Steve Zdancewic.
The implementation is a little different than that paper. For a quick
primer, check out Note [Roles] in Coercion. Also see
http://ghc.haskell.org/trac/ghc/wiki/Roles
and
http://ghc.haskell.org/trac/ghc/wiki/RolesImplementation
For a more formal treatment, check out docs/core-spec/core-spec.pdf.
This fixes Trac #1496, #4846, #7148.
|
|
|
|
|
|
|
|
|
|
|
| |
I'd been meaning to do this for some time, but finally got around to it
due to the overflowing literals warning. With that enabled, we were
getting a warning for
-128 :: Int8
as that is parsed as
negate (fromInteger 128)
which just happens to do the right thing, as
negate (fromInteger 128) = negate (-128) = -128
|
|
|
|
|
|
| |
Somtimes we need (xs ++ ys) in situations where ys is
almost always empty. Utils.chkAppend checks for that
case first.
|
|
|
|
|
| |
In particular, this means that GHCi will use DLLs, rather than loading
object files itself.
|
| |
|
| |
|
|
|
|
|
| |
Data.HashTable is now deprecated and will soon be removed, but
deSugar/Coverage.lhs uses hashString.
|
|
|
|
| |
We now use Data.List's sort(By)
|
|
|
|
|
|
| |
Technically the behaviour of sortWith has changed, as it used
x `le` y = get_key x < get_key y
(note "<" rather than "<="), but I assume that that was just a mistake.
|
| |
|
|
|
|
| |
We can now rely on it being available from Data.Function
|
|
|
|
|
|
|
|
|
|
|
| |
This is done by a 'unarisation' pre-pass at the STG level which
translates away all (live) binders binding something of unboxed
tuple type.
This has the following knock-on effects:
* The subkind hierarchy is vastly simplified (no UbxTupleKind or ArgKind)
* Various relaxed type checks in typechecker, 'foreign import prim' etc
* All case binders may be live at the Core level
|
|
|
|
|
|
| |
createDirectoryHierarchy consisted of an existence test followed by
createDirectory, which failed if that directory was creted just after
the test. createDirectoryifMissing does not have this problem.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
We only use it for "compiler" sources, i.e. not for libraries.
Many modules have a -fno-warn-tabs kludge for now.
|
| |
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
compiler/iface/BuildTyCl.lhs
compiler/iface/MkIface.lhs
compiler/iface/TcIface.lhs
compiler/typecheck/TcTyClsDecls.lhs
compiler/types/Class.lhs
compiler/utils/Util.lhs
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Basically as documented in http://hackage.haskell.org/trac/ghc/wiki/KindFact,
this patch adds a new kind Constraint such that:
Show :: * -> Constraint
(?x::Int) :: Constraint
(Int ~ a) :: Constraint
And you can write *any* type with kind Constraint to the left of (=>):
even if that type is a type synonym, type variable, indexed type or so on.
The following (somewhat related) changes are also made:
1. We now box equality evidence. This is required because we want
to give (Int ~ a) the *lifted* kind Constraint
2. For similar reasons, implicit parameters can now only be of
a lifted kind. (?x::Int#) => ty is now ruled out
3. Implicit parameter constraints are now allowed in superclasses
and instance contexts (this just falls out as OK with the new
constraint solver)
Internally the following major changes were made:
1. There is now no PredTy in the Type data type. Instead
GHC checks the kind of a type to figure out if it is a predicate
2. There is now no AClass TyThing: we represent classes as TyThings
just as a ATyCon (classes had TyCons anyway)
3. What used to be (~) is now pretty-printed as (~#). The box
constructor EqBox :: (a ~# b) -> (a ~ b)
4. The type LCoercion is used internally in the constraint solver
and type checker to represent coercions with free variables
of type (a ~ b) rather than (a ~# b)
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Basically, now you can write:
class Cls a where
type Typ a
type Typ a = Just a
And now if an instance does not specify an explicit associated type
instance, one will be generated afresh based on that default. So for
example this instance:
instance Cls Int where
Will be equivalent to this one:
instance Cls Int where
type Typ Int = Just Int
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a plugin is loaded, it currently gets linked against a *newly loaded* copy
of the GHC package. This would not be a problem, except that the new copy has its
own mutable state that is not shared with that state that has already been initialized by
the original GHC package.
This leads to loaded plugins calling GHC code which pokes the static flags,
and then dying with a panic because the static flags *it* sees are uninitialized.
There are two possible solutions:
1. Export the symbols from the GHC executable from the GHC library and link
against this existing copy rather than a new copy of the GHC library
2. Carefully ensure that the global state in the two copies of the GHC
library matches
I tried 1. and it *almost* works (and speeds up plugin load times!) except
on Windows. On Windows the GHC library tends to export more than 65536 symbols
(see #5292) which overflows the limit of what we can export from the EXE and
causes breakage.
(Note that if the GHC exeecutable was dynamically linked this wouldn't be a problem,
because we could share the GHC library it links to.)
We are going to try 2. instead. Unfortunately, this means that every plugin
will have to say `reinitializeGlobals` before it does anything, but never mind.
I've threaded the cr_globals through CoreM rather than giving them as an
argument to the plugin function so that we can turn this function into
(return ()) without breaking any plugins when we eventually get 1. working.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and use it to report module loops nicely
This fixes Trac #5307. Now we get
Module imports form a cycle:
module `M8' (.\M8.hs)
imports `M1' (M1.hs)
which imports `M9' (.\M9.hs-boot)
which imports `M8' (.\M8.hs)
And the algorithm is linear time.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A common sequence of commands (at least for me) is this:
$ ghc hello
1 of 1] Compiling Main ( hello.hs, hello.o )
Linking hello ...
$ ./hello +RTS -s
hello: Most RTS options are disabled. Link with -rtsopts to enable them.
$ ghc hello -rtsopts
$
grr, nothing happened. I could use -fforce-recomp, but if this was a
large program I probably don't want to recompile it all again, so:
$ rm hello
removed `hello'
$ ghc hello -rtsopts
Linking hello ...
$ ./hello +RTS -s
./hello +RTS -s
Hello World!
51,264 bytes allocated in the heap
2,904 bytes copied during GC
43,808 bytes maximum residency (1 sample(s))
17,632 bytes maximum slop
etc.
With this patch, GHC notices when the options have changed and forces
a relink, so you don't need to rm the binary or use -fforce-recomp.
This is done by adding the pertinent stuff to the binary in a special
section called ".debug-ghc-link-info":
$ readelf -p .debug-ghc-link-info ./hello
String dump of section 'ghc-linker-opts':
[ 0] (["-lHSbase-4.3.1.0","-lHSinteger-gmp-0.2.0.2","-lgmp","-lHSghc-prim-0.2.0.0","-lHSrts","-lm","-lrt","-ldl","-u","ghczmprim_GHCziTypes_Izh_static_info","-u","ghczmprim_GHCziTypes_Czh_static_info","-u","ghczmprim_GHCziTypes_Fzh_static_info","-u","ghczmprim_GHCziTypes_Dzh_static_info","-u","base_GHCziPtr_Ptr_static_info","-u","base_GHCziWord_Wzh_static_info","-u","base_GHCziInt_I8zh_static_info","-u","base_GHCziInt_I16zh_static_info","-u","base_GHCziInt_I32zh_static_info","-u","base_GHCziInt_I64zh_static_info","-u","base_GHCziWord_W8zh_static_info","-u","base_GHCziWord_W16zh_static_info","-u","base_GHCziWord_W32zh_static_info","-u","base_GHCziWord_W64zh_static_info","-u","base_GHCziStable_StablePtr_static_info","-u","ghczmprim_GHCziTypes_Izh_con_info","-u","ghczmprim_GHCziTypes_Czh_con_info","-u","ghczmprim_GHCziTypes_Fzh_con_info","-u","ghczmprim_GHCziTypes_Dzh_con_info","-u","base_GHCziPtr_Ptr_con_info","-u","base_GHCziPtr_FunPtr_con_info","-u","base_GHCziStable_StablePtr_con_info","-u","ghczmprim_GHCziTypes_False_closure","-u","ghczmprim_GHCziTypes_True_closure","-u","base_GHCziPack_unpackCString_closure","-u","base_GHCziIOziException_stackOverflow_closure","-u","base_GHCziIOziException_heapOverflow_closure","-u","base_ControlziExceptionziBase_nonTermination_closure","-u","base_GHCziIOziException_blockedIndefinitelyOnMVar_closure","-u","base_GHCziIOziException_blockedIndefinitelyOnSTM_closure","-u","base_ControlziExceptionziBase_nestedAtomically_closure","-u","base_GHCziWeak_runFinalizzerBatch_closure","-u","base_GHCziTopHandler_runIO_closure","-u","base_GHCziTopHandler_runNonIO_closure","-u","base_GHCziConcziIO_ensureIOManagerIsRunning_closure","-u","base_GHCziConcziSync_runSparks_closure","-u","base_GHCziConcziSignal_runHandlers_closure","-lHSffi"],Nothing,RtsOptsAll,False,[],[])
And GHC itself uses the readelf command to extract it when deciding
whether to relink. The reason for the name ".debug-ghc-link-info" is
that sections beginning with ".debug" are removed automatically by
strip.
This currently only works on Linux; Windows and OS X still have the
old behaviour.
|
|
|
|
|
| |
For single-character identifiers we now don't make any suggestions
See comments in Util.fuzzyLookup
|
|
|
|
| |
Plus, I changed quite a bit of layout to make the lines shorter.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
The instances (and deriving declarations) have been taken from the ghc-syb
package.
|
| |
|
|
|
|
|
| |
also replace picIsOn with isDynamicGhcLib, as __PIC__ is not the
correct test for whether the GHC library is dynamically linked.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The main purpose of this patch is to add a bunch of new rules
to the coercion optimiser. They are documented in the (revised)
Appendix of the System FC paper.
Some code has moved about:
- OptCoercion is now a separate module, mainly because it
now uses tcMatchTy, which is defined in Unify, so OptCoercion
must live higehr up in the hierarchy
- Functions that manipulate Kinds has moved from
Type.lhs to Coercion.lhs. Reason: the function typeKind
now needs to call coercionKind. And in any case, a Kind is
a flavour of Type, so it builds on top of Type; indeed Coercions
and Kinds are both flavours of Type.
This change required fiddling with a number of imports, hence
the one-line changes to otherwise-unrelated modules
- The representation of CoTyCons in TyCon has changed. Instead of
an extensional representation (a kind checker) there is now an
intensional representation (namely TyCon.CoTyConDesc). This was
needed for one of the new coercion optimisations.
|
|
|
|
| |
rather than our own copies
|