- 20 Jan, 2014 6 commits
-
-
cactus authored
Signed-off-by:
Austin Seipp <austin@well-typed.com>
-
cactus authored
This patch implements Pattern Synonyms (enabled by -XPatternSynonyms), allowing y ou to assign names to a pattern and abstract over it. The rundown is this: * Named patterns are introduced by the new 'pattern' keyword, and can be either *unidirectional* or *bidirectional*. A unidirectional pattern is, in the simplest sense, simply an 'alias' for a pattern, where the LHS may mention variables to occur in the RHS. A bidirectional pattern synonym occurs when a pattern may also be used in expression context. * Unidirectional patterns are declared like thus: pattern P x <- x:_ The synonym 'P' may only occur in a pattern context: foo :: [Int] -> Maybe Int foo (P x) = Just x foo _ = Nothing * Bidirectional patterns are declared like thus: pattern P x y = [x, y] Here, P may not only occur as a pattern, but also as an expression when given values for 'x' and 'y', i.e. bar :: Int -> [Int] bar x = P x 10 * Patterns can't yet have their own type signatures; signatures are inferred. * Pattern synonyms may not be recursive, c.f. type synonyms. * Pattern synonyms are also exported/imported using the 'pattern' keyword in an import/export decl, i.e. module Foo (pattern Bar) where ... Note that pattern synonyms share the namespace of constructors, so this disambiguation is required as a there may also be a 'Bar' type in scope as well as the 'Bar' pattern. * The semantics of a pattern synonym differ slightly from a typical pattern: when using a synonym, the pattern itself is matched, followed by all the arguments. This means that the strictness differs slightly: pattern P x y <- [x, y] f (P True True) = True f _ = False g [True, True] = True g _ = False In the example, while `g (False:undefined)` evaluates to False, `f (False:undefined)` results in undefined as both `x` and `y` arguments are matched to `True`. For more information, see the wiki: https://ghc.haskell.org/trac/ghc/wiki/PatternSynonyms https://ghc.haskell.org/trac/ghc/wiki/PatternSynonyms/ImplementationReviewed-by:
Simon Peyton Jones <simonpj@microsoft.com> Signed-off-by:
Austin Seipp <austin@well-typed.com>
-
Joachim Breitner authored
-
Joachim Breitner authored
(artificial test cases are so nice: 90.7% improvement!)
-
Joachim Breitner authored
-
Joachim Breitner authored
by passing the FamInstEnvs all the way down. This closes #7619.
-
- 19 Jan, 2014 1 commit
-
-
Herbert Valerio Riedel authored
Signed-off-by:
Herbert Valerio Riedel <hvr@gnu.org>
-
- 18 Jan, 2014 1 commit
-
-
pali.gabor@gmail.com authored
On FreeBSD, /usr/lib has to be added to the library path on linking when libthr is needed but -nostdlib is used (which is the case when the -prof and -threaded flags are combined).
-
- 17 Jan, 2014 10 commits
-
-
pali.gabor@gmail.com authored
All actively supported releases (8.4-RELEASE, 9.2-RELEASE and the upcoming 10.0-RELEASE) now support resolution of $ORIGIN properly.
-
pali.gabor@gmail.com authored
-
pali.gabor@gmail.com authored
-
Austin Seipp authored
Haddock no longer has a generated parser, so we don't need it in the sdist and we certainly don't want to check for it in the ./configure script (as that would be bogus.) Signed-off-by:
Austin Seipp <austin@well-typed.com>
-
Joachim Breitner authored
-
Joachim Breitner authored
-
Simon Peyton Jones authored
See Trac #8672
-
Simon Peyton Jones authored
Fixes Trac #8674
-
Simon Peyton Jones authored
The former adds a newline at the end (restoring the previous behaviour) while the latter does not (which previously happened by turning the thuing into a string and only then printing it).
-
Simon Peyton Jones authored
-
- 16 Jan, 2014 17 commits
-
-
Krzysztof Gogolewski authored
-
Joachim Breitner authored
-
Joachim Breitner authored
-
Joachim Breitner authored
Instead of first checking whether splitting is useful, and then firing up the worker-wrapper-machinery, which will do the same checks again, we now simply generate a worker and wrapper, and while doing so keep track of whether what we did was in any way useful. So now there is only one place left where we decide whether we want to do w/w, and that place has access to more information, in particular the actual types at hand.
-
Joachim Breitner authored
these functions were almost equal, and neither validate nor nofib show any difference replacing one by the other. So lets simplify this. (This also prepares for a refactoring that will get rid of worthSplittingArgDmd completely.)
-
Herbert Valerio Riedel authored
This should contain a fix that addresses the Solaris build breakage (see #8670) Signed-off-by:
Herbert Valerio Riedel <hvr@gnu.org>
-
Simon Marlow authored
By using the constant-folder to reduce it to an integer.
-
Simon Marlow authored
We occasionally need to reserve some temporary memory in a primop for passing to a foreign function. We've been using the stack for this, but when we moved to high-level Cmm it became quite fragile because primops are in high-level Cmm and the stack is supposed to be under the control of the Cmm pipeline. So this change puts things on a firmer footing by adding a new Cmm construct 'reserve'. e.g. in decodeFloat_Int#: reserve 2 = tmp { mp_tmp1 = tmp + WDS(1); mp_tmp_w = tmp; /* Perform the operation */ ccall __decodeFloat_Int(mp_tmp1 "ptr", mp_tmp_w "ptr", arg); r1 = W_[mp_tmp1]; r2 = W_[mp_tmp_w]; } reserve is described in CmmParse.y. Unfortunately the argument to reserve must be a compile-time constant. We might have to extend the parser to allow expressions with arithmetic operators if this is too restrictive. Note also that the return instruction for the procedure must be outside the scope of the reserved stack area, so we have to extract the values from the reserved area before we close the scope. This means some more local variables (r1, r2 in the example above). The generated code is more or less identical to what we had before though.
-
Gabor Greif authored
-
Simon Marlow authored
Presumably broken by an earlier change, anyone know which one?
-
Simon Marlow authored
-
Simon Marlow authored
-
Joachim Breitner authored
in which case it is a wontfix (see #8569)
-
Herbert Valerio Riedel authored
Signed-off-by:
Herbert Valerio Riedel <hvr@gnu.org>
-
Austin Seipp authored
Clang warns about implicit return values by default. Signed-off-by:
Austin Seipp <austin@well-typed.com>
-
Austin Seipp authored
This fixes a large majority of the testsuite failures on Mavericks with Clang. Signed-off-by:
Austin Seipp <austin@well-typed.com>
-
Austin Seipp authored
Signed-off-by:
Austin Seipp <austin@well-typed.com>
-
- 15 Jan, 2014 5 commits
-
-
Edward Z. Yang authored
Signed-off-by:
Edward Z. Yang <ezyang@cs.stanford.edu>
-
Arash Rouhani authored
When printing an update frame in printClosure(), it will not print the unspecific UPDATE_FRAME, instead it prints BH_UPDATE_FRAME, NORMAL_UPDATE_FRAME or MARKED_UPDATE_FRAME. Signed-off-by:
Austin Seipp <austin@well-typed.com>
-
Austin Seipp authored
Signed-off-by:
Austin Seipp <austin@well-typed.com>
-
Herbert Valerio Riedel authored
These new versions get rid of AMP warnings Signed-off-by:
Herbert Valerio Riedel <hvr@gnu.org>
-
Austin Seipp authored
After some discussion on ghc-devs@ and elsewhere, it seemed favorable to make this change as type holes don't let any invalid programs though, they merely change what the compiler reports in case of certain errors (namely unbound occurrences, or _ appearing on a LHS.) Now, the warning mechanism is controlled by -f[no-]warn-type-errors, just like any other regular warning. Again, on by default. The documentation and tests have been updated accordingly. Signed-off-by:
Austin Seipp <austin@well-typed.com>
-