- 16 Aug, 2011 1 commit
-
-
Simon Peyton Jones authored
This patch makes a number of related improvements a) Implements the Haskell Prime semantics for pattern bindings (Trac #2357). That is, a pattern binding p = e is typed just as if it had been written t = e f = case t of p -> f g = case t of p -> g ... etc ... where f,g are the variables bound by p. In paricular it's ok to say (f,g) = (\x -> x, \y -> True) and f and g will get propertly inferred types f :: a -> a g :: a -> Int b) Eliminates the MonoPatBinds flag altogether. (For the moment it is deprecated and has no effect.) Pattern bindings are now generalised as per (a). Fixes Trac #2187 and #4940, in the way the users wanted! c) Improves the OutsideIn algorithm generalisation decision. Given a definition without a type signature (implying "infer the type"), the published algorithm rule is this: - generalise *top-level* functions, and - do not generalise *nested* functions The new rule is - generalise a binding whose free variables have Guaranteed Closed Types - do not generalise other bindings Generally, a top-level let-bound function has a Guaranteed Closed Type, and so does a nested function whose free vaiables are top-level functions, and so on. (However a top-level function that is bitten by the Monomorphism Restriction does not have a GCT.) Example: f x = let { foo y = y } in ... Here 'foo' has no free variables, so it is generalised despite being nested. d) When inferring a type f :: ty for a definition f = e, check that the compiler would accept f :: ty as a type signature for that same definition. The type is rejected precisely when the type is ambiguous. Example: class Wob a b where to :: a -> b from :: b -> a foo x = [x, to (from x)] GHC 7.0 would infer the ambiguous type foo :: forall a b. Wob a b => b -> [b] but that type would give an error whenever it is called; and GHC 7.0 would reject that signature if given by the programmer. The new type checker rejects it up front. Similarly, with the advent of type families, ambiguous types are easy to write by mistake. See Trac #1897 and linked tickets for many examples. Eg type family F a :: * f ::: F a -> Int f x = 3 This is rejected because (F a ~ F b) does not imply a~b. Previously GHC would *infer* the above type for f, but was unable to check it. Now even the inferred type is rejected -- correctly. The main implemenation mechanism is to generalise the abe_wrap field of ABExport (in HsBinds), from [TyVar] to HsWrapper. This beautiful generalisation turned out to make everything work nicely with minimal programming effort. All the work was fiddling around the edges; the core change was easy!
-
- 14 Jul, 2011 1 commit
-
-
Ian Lynagh authored
The -w flag wasn't turning off a few warnings (Opt_WarnMissingImportList, Opt_WarnMissingLocalSigs, Opt_WarnIdentities). Rather than just adding them, I've separated the Opt_Warn* contructors off into their own type, so -w now just sets the list of warning flags to [].
-
- 12 Jul, 2011 1 commit
-
-
dterei authored
-
- 11 Jul, 2011 1 commit
-
-
Ian Lynagh authored
-
- 03 Jul, 2011 5 commits
-
-
Ian Lynagh authored
It was already deprecated, and marked for removal in 7.2.
-
Ian Lynagh authored
We no longer advertise that we support the Generics extension, although we still do accept -XGenerics and -XNoGenerics flags (but warn that we are ignoring them). I also remove the even older -fgenerics and -fno-generics flags.
-
Ian Lynagh authored
-
Ian Lynagh authored
It used to take a whole DynFlags, but that meant we had to create a DynFlags with (panic "No settings") for settings, as we didn't have any real settings. Now we just pass the LogAction, which is all that it actually needed. The default is exported from DynFlags as defaultLogAction.
-
Ian Lynagh authored
-
- 02 Jul, 2011 1 commit
-
-
batterseapower authored
-
- 30 Jun, 2011 2 commits
-
-
batterseapower authored
-
dterei authored
-
- 29 Jun, 2011 1 commit
-
-
batterseapower authored
-
- 24 Jun, 2011 1 commit
-
-
dterei authored
-
- 18 Jun, 2011 16 commits
-
-
dterei authored
-
dterei authored
-
dterei authored
-
dterei authored
-
dterei authored
-
dterei authored
-
dterei authored
-
dterei authored
This was done as we originally planned for SafeHaskell to provide some compilation safety. We have dropped this though and instead intend for a new static flag, '--safecompile' that provides this instead in an orthogonal way to SafeHaskell.
-
dterei authored
-
dterei authored
Now ghc supports: - trust => Set a package to be trusted - distrust => Set a package to be untrusted - distrust-all-package => Set all packages to be untrusted by default
-
dterei authored
-
dterei authored
Problem with -fforce-recomp not picking up changed Safe flags correctly fixed. Also now disable Template Haskell completely.
-
dterei authored
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.
-
dterei authored
-
dterei authored
-
dterei authored
-
- 16 Jun, 2011 1 commit
-
-
Simon Peyton Jones authored
This patch was originally developed by Max Bolingbroke, and worked on further by Austin Seipp. It allows you to write a Core-to-Core pass and have it dynamically linked into an otherwise-unmodified GHC, and run at a place you specify in the Core optimisation pipeline. Main components: - CoreMonad: new types Plugin, PluginPass plus a new constructor CoreDoPluginPass in CoreToDo - SimplCore: stuff to dynamically load any plugins, splice them into the core-to-core pipeline, and invoke them - Move "getCoreToDo :: DynFlags -> [CoreToDo]" which constructs the main core-to-core pipeline from CoreMonad to SimplCore SimplCore is the driver for the optimisation pipeline, and it makes more sense to have the pipeline construction in the driver not in the infrastructure module. - New module DynamicLoading: invoked by SimplCore to load any plugins Some consequential changes in Linker. - New module GhcPlugins: this should be imported by plugin modules; it it not used by GHC itself.
-
- 15 Jun, 2011 1 commit
-
-
Ian Lynagh authored
-
- 31 May, 2011 1 commit
-
-
dterei authored
-
- 26 May, 2011 1 commit
-
-
Simon Marlow authored
CoreUnfold.sizeExpr (oops, forgot to push this patch along with the others yesterday, and this caused a few test failures overnight).
-
- 25 May, 2011 1 commit
-
-
Simon Marlow authored
-
- 24 May, 2011 1 commit
-
-
Ian Lynagh authored
The Haskell' committee decided to remove datatype contexts from the language: http://www.haskell.org/pipermail/haskell-prime/2011-January/003335.html
-
- 15 May, 2011 3 commits
-
-
Edward Z. Yang authored
Signed-off-by:
Edward Z. Yang <ezyang@mit.edu>
-
Edward Z. Yang authored
Signed-off-by:
Edward Z. Yang <ezyang@mit.edu>
-
batterseapower authored
-
- 09 May, 2011 1 commit
-
-
dreixel authored
-