| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Starting with GHC 7.10 and base-4.8, `Monad` implies `Applicative`,
which allows to simplify some definitions to exploit the superclass
relationship. This a first refactoring to that end.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since GHC 8.1/8.2 only needs to be bootstrap-able by GHC 7.10 and
GHC 8.0 (and GHC 8.2), we can now finally drop all that pre-AMP
compatibility CPP-mess for good!
Reviewers: austin, goldfire, bgamari
Subscribers: goldfire, thomie, erikd
Differential Revision: https://phabricator.haskell.org/D1724
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch refactors pure/(*>) and return/(>>) in MRP-friendly way, i.e.
such that the explicit definitions for `return` and `(>>)` match the
MRP-style default-implementation, i.e.
return = pure
and
(>>) = (*>)
This way, e.g. all `return = pure` definitions can easily be grepped and
removed in GHC 8.1;
Test Plan: Harbormaster
Reviewers: goldfire, alanz, bgamari, quchen, austin
Reviewed By: quchen, austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1312
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Parsing of static and mode flags happens before any session is started,
i.e., before the first call to 'GHC.withGhc'. Therefore, to report
errors for invalid usage of these two types of flags, we can not call
any function that needs DynFlags, as there are no DynFlags available yet
(unsafeGlobalDynFlags is not set either). So we always print "on the
commandline" as the location, which is true except for Api users, which
is probably ok.
When reporting errors for invalid usage of dynamic flags we /can/ make
use of DynFlags, and we do so explicitly in
DynFlags.parseDynamicFlagsFull.
Before, we called unsafeGlobalDynFlags when an invalid (combination of)
flag(s) was given on the commandline, resulting in panics (#9963). This
regression was introduced in 1d6124de.
Also rename showSDocSimple to showSDocUnsafe, to hopefully prevent this
from happening again.
Reviewed By: austin
Differential Revision: https://phabricator.haskell.org/D730
GHC Trac Issues: #9963
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: austin
Reviewed By: austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D618
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Package environments are files with package IDs that indicate which packages should be visible; see entry in user guide for details.
Reviewers: duncan, austin
Reviewed By: duncan, austin
Subscribers: carter, thomie
Differential Revision: https://phabricator.haskell.org/D558
|
|
|
|
| |
-fwarn-redundant-constraints
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Signed-off-by: Denis Redozubov <denis.redozubov@gmail.com>
SSE version handled by different dynamic flags
Signed-off-by: Denis Redozubov <denis.redozubov@gmail.com>
Test Plan: validate
Reviewers: austin, jstolarek
Reviewed By: austin, jstolarek
Subscribers: kolmodin, thomie, carter
Differential Revision: https://phabricator.haskell.org/D504
GHC Trac Issues: #9777
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Previously 'ghc --show-options' showed all options that GHC can possibly
accept. With this patch, it'll only show the options that have effect in
non-interactive modes.
This change also adds support for using 'ghc --interactive --show-options'
which previously was disallowed. This command will show all options that have
effect in the interactive mode.
The CmdLineParser is updated to know about the GHC modes, and then each flag
is annotated with which mode it has effect.
This fixes #9259.
Test Plan:
Try out --show-options with --interactive on the command line. With and without
--interactive should give different results.
Run the test suite, mode001 has been updated to verify this new flag
combination.
Reviewers: austin, jstolarek
Reviewed By: austin, jstolarek
Subscribers: jstolarek, thomie, carter, simonmar
Differential Revision: https://phabricator.haskell.org/D337
GHC Trac Issues: #9259
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: test T9776 under tests/driver
Reviewers: jstolarek, austin
Reviewed By: jstolarek, austin
Subscribers: jstolarek, thomie, carter
Differential Revision: https://phabricator.haskell.org/D503
GHC Trac Issues: #9776
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This includes pretty much all the changes needed to make `Applicative`
a superclass of `Monad` finally. There's mostly reshuffling in the
interests of avoid orphans and boot files, but luckily we can resolve
all of them, pretty much. The only catch was that
Alternative/MonadPlus also had to go into Prelude to avoid this.
As a result, we must update the hsc2hs and haddock submodules.
Signed-off-by: Austin Seipp <austin@well-typed.com>
Test Plan: Build things, they might not explode horribly.
Reviewers: hvr, simonmar
Subscribers: simonmar
Differential Revision: https://phabricator.haskell.org/D13
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
This sets the SSE "version" to 1.0.
|
|
|
|
|
| |
Authored-by: David Luposchainsky <dluposchainsky@gmail.com>
Signed-off-by: Austin Seipp <austin@well-typed.com>
|
|
|
|
|
| |
We know have a single flag that takes a version number, instead of one
flag per SSE version.
|
|
|
|
|
|
|
|
| |
I also removed the default values from the "Discounts and thresholds"
note: most of them were no longer up-to-date.
Along the way I added FloatSuffix to the argument parser, analogous to
IntSuffix.
|
|
|
|
|
|
|
| |
Pick longest flag when more than one matches in findArg.
This fixes an issue where -ignore-dot-ghci wasn't honored, because the
flag was parsed as "-i gnore-dot-ghci".
|
|
|
|
|
| |
Using 'unlines' meant that we get a trailing newline, which gave
different output.
|
|
|
|
|
|
|
|
| |
This shouldn't be any slower; the FilePaths were already going via
String so that we could normalise them.
This means that very early on, when printing flag parsing errors, we
can do so without having a DynFlags yet.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch implements the idea of deferring (most) type errors to
runtime, instead emitting only a warning at compile time. The
basic idea is very simple:
* The on-the-fly unifier in TcUnify never fails; instead if it
gets stuck it emits a constraint.
* The constraint solver tries to solve the constraints (and is
entirely unchanged, hooray).
* The remaining, unsolved constraints (if any) are passed to
TcErrors.reportUnsolved. With -fdefer-type-errors, instead of
emitting an error message, TcErrors emits a warning, AND emits
a binding for the constraint witness, binding it
to (error "the error message"), via the new form of evidence
TcEvidence.EvDelayedError. So, when the program is run,
when (and only when) that witness is needed, the program will
crash with the exact same error message that would have been
given at compile time.
Simple really. But, needless to say, the exercise forced me
into some major refactoring.
* TcErrors is almost entirely rewritten
* EvVarX and WantedEvVar have gone away entirely
* ErrUtils is changed a bit:
* New Severity field in ErrMsg
* Renamed the type Message to MsgDoc (this change
touches a lot of files trivially)
* One minor change is that in the constraint solver we try
NOT to combine insoluble constraints, like Int~Bool, else
all such type errors get combined together and result in
only one error message!
* I moved some definitions from TcSMonad to TcRnTypes,
where they seem to belong more
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This patch disables the use of some GHC extensions in
Safe mode and also the use of certain flags. Some
are disabled completely while others are only allowed
on the command line and not in source PRAGMAS.
We also check that Safe imports are indeed importing
a Safe or Trustworthy module.
|
|
|
|
|
|
|
| |
The SDoc type now passes around an abstract SDocContext rather than
just a PprStyle which required touching a few more files. This should
also make it easier to integrate DynFlags passing, so that we can get
rid of global variables.
|
|
|
|
|
|
|
|
|
|
|
| |
This change allows the client of CmdLineParser a bit more flexibility,
by giving him an arbitrary computation (not just a deprecation
message) for each flag.
There are several clients, so there are lots of boilerplate changes.
Immediate motivation: if RTS is not profiled, we want to make
Template Haskell illegal. That wasn't with the old setup.
|
|
|
|
|
|
| |
The problem is that showing SDoc's looks at the static flags global
variables, but those are panics while we are parsing the static flags.
We work around this by explicitly using a fixed prettyprinter style.
|
|
|
|
|
| |
We now have a DeprecatedFullText constructor, so we can override the
"-#include is deprecated: " part of the warning.
|
|
|
|
|
| |
We already require GHC 6.8 to build, and that included stripPrefix
in Data.List.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Modules that need it import it themselves instead.
|
| |
|
|
|
|
| |
Fixes building with -Werror (i.e. validate) and GHC < 6.6
|
| |
|
| |
|
|
|
|
|
|
|
| |
Older GHCs can't parse OPTIONS_GHC.
This also changes the URL referenced for the -w options from
WorkingConventions#Warnings to CodingStyle#Warnings for the compiler
modules.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We've often talked about having a separate flag for language extensions,
and now we have one. You can say
-XImplicitParams
-X=ImplicitParams
-Ximplicit-params
as you like. These replace the "-f" flags with similar names (though
the -f prefix will serve as a synonym for -X for a while).
There's an optional "=", and the flag is normalised by removing hyphens
and lower-casing, so all the above variants mean the same thing.
The nomenclature is intended to match the LANGUAGE pramgas, which are
defined by Cabal. So you can also say
{-# LANGUAGE ImplicitParams #-}
But Cabal doesn't have as many language options as GHC does, so the -X
things are a superset of the LANGUAGE things.
The optional "=" applies to all flags that take an argument, so you can,
for example, say
-pgmL=/etc/foo
I hope that's ok. (It's an unforced change; just fitted in.)
I hope we'll add more -X flags, to replace the portmanteau -fglasgow-exts
which does everything!
I have updated the manual, but doubtless missed something.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-fliberate-case-threshold dynamic
(Alas, Darcs failed to record my log-message for the above patch,
so this patch is an attempt to add the log message retrospectively.)
Parsing options numeric arguments, such as
-fliberate-case-threshold=30
for dynamic flags wasn't being handled well. I elaborated the
command-line parser to have a new constructor, OptIntSuffix, for this
case, and did the consequential changes.
This patch also makes the -fliberate-case-threshold flag into a
dynamic flag.
|
|
|
|
| |
-fliberate-case-threshold dynamic
|
|
|
|
|
|
|
|
|
| |
This allows you to put -fcontext-stack into an options pragma,
as requested by Trac #829
While I was at it, I added OptIntPrefix to the forms allowed
in CmdLineParser.
|
|
Most of the other users of the fptools build system have migrated to
Cabal, and with the move to darcs we can now flatten the source tree
without losing history, so here goes.
The main change is that the ghc/ subdir is gone, and most of what it
contained is now at the top level. The build system now makes no
pretense at being multi-project, it is just the GHC build system.
No doubt this will break many things, and there will be a period of
instability while we fix the dependencies. A straightforward build
should work, but I haven't yet fixed binary/source distributions.
Changes to the Building Guide will follow, too.
|