- 01 Mar, 2010 1 commit
-
-
simonpj@microsoft.com authored
This just ensures that an unsafe coercion is as localised as possible. For example, instead of UnsafeCo (Int -> t1) (Int -> t2) use Int -> UnsafeCo t1 t2
-
- 04 Jan, 2010 1 commit
-
-
simonpj@microsoft.com authored
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.
-
- 16 Dec, 2009 3 commits
-
-
simonpj@microsoft.com authored
-
simonpj@microsoft.com authored
* Fix a bug that meant that (right (inst (forall tv.co) ty)) wasn't getting optimised. This showed up in the compiled code for ByteCodeItbls * Add a substitution to optCoercion, so that it simultaneously substitutes and optimises. Both call sites wanted this, and optCoercion itself can use it, so it seems a win all round.
-
simonpj@microsoft.com authored
-
- 11 Dec, 2009 1 commit
-
-
simonpj@microsoft.com authored
In CSE we were getting lots of apprarently-unequal expressions with the same hash code. In fact they were perfectly equal -- but we were using a cheap-and-cheerful equality tests for CoreExpr that said False for any lambda expression! This patch adds a proper equality test for Core, with alpha-renaming. It's easy to do, and will avoid silly cases of CSE failing to fire. We should get less of this: WARNING: file compiler/simplCore/CSE.lhs line 326 extendCSEnv: long list, length 18 from a compiler built with -DDEBUG
-
- 12 Nov, 2009 1 commit
-
-
simonpj@microsoft.com authored
* Core Lint now does full checking of kinds and coercion terms which picks up kind errors in coercions that were previously simply not checked for * Coercion.lhs now provides optCoercion which optimises coercion terms. It implements all of Dimitrios's rules * The constructors for coercion terms now make no attempt to be "smart"; instead we rely solely on the coercion optimiser * CoercionTyCons in TyCon.lhs always had a "custom" kinding rule (the coKindFun field of CoercionTyCon) but its type was not clever enough to do both (a) *figure out the result kind*, assuming the whole thing is well-kinded in the first place (b) *check* the kinds of everything, failing gracefully if they aren't right. We need (b) for the new CoreLint stuff. The field now has type CoTyConKindChecker which does the job nicely.
-
- 08 Nov, 2009 1 commit
-
-
tom.schrijvers@cs.kuleuven.be authored
-
- 06 Nov, 2009 1 commit
-
-
simonpj@microsoft.com authored
In preparation for implementing the PushC rule for coercion-swizzling in the Simplifier, I had to inmplement the three new decomposition operators for coercions, which I've called csel1, csel2, and cselR. co :: ((s1~t1) => r1) ~ ((s2~t2) => r2) --------------------------------------- csel1 co :: s1~s2 and similarly csel2, cselR. On the way I fixed the coercionKind function for types of form (s1~t2) => r2 which currently are expressed as a forall type. And I refactored quite a bit to help myself understand what is going on.
-
- 30 Oct, 2009 1 commit
-
-
simonpj@microsoft.com authored
* Remove trace from optCoercion * Use simplCoercion for type arguments in the Simplifier (because they might be coercions)
-
- 28 Oct, 2009 1 commit
-
-
tom.schrijvers@cs.kuleuven.be authored
-
- 26 Oct, 2009 1 commit
-
-
simonpj@microsoft.com authored
Coercion terms can get big (see Trac #2859 for example), so this patch puts the infrastructure in place to optimise them: * Adds Coercion.optCoercion :: Coercion -> Coercion * Calls optCoercion in Simplify.lhs The optimiser doesn't work right at the moment, so it is commented out, but Tom is going to work on it.
-
- 06 Jul, 2009 1 commit
-
-
simonpj@microsoft.com authored
-
- 15 Mar, 2009 1 commit
-
-
chak@cse.unsw.edu.au. authored
- During fianlisation we use to occasionally swivel variable-variable equalities - Now, normalisation ensures that they are always oriented as appropriate for instantation. - Also fixed #1899 properly; the previous fix fixed a symptom, not the cause.
-
- 13 Jan, 2009 1 commit
-
-
simonpj@microsoft.com authored
-
- 29 Oct, 2008 1 commit
-
-
simonpj@microsoft.com authored
-
- 20 Sep, 2008 1 commit
-
-
simonpj@microsoft.com authored
-
- 31 Jul, 2008 1 commit
-
-
batterseapower authored
-
- 12 Apr, 2008 1 commit
-
-
Ian Lynagh authored
-
- 29 Mar, 2008 1 commit
-
-
Ian Lynagh authored
Modules that need it import it themselves instead.
-
- 15 Mar, 2008 1 commit
-
-
Ian Lynagh authored
-
- 06 Feb, 2008 1 commit
-
-
rl@cse.unsw.edu.au authored
Previously, cheapEqExpr would always return False if it encountered a cast. This was bad for two reasons. Firstly, CSE (which uses cheapEqExpr to compare expressions) never eliminated expressions which contained casts and secondly, it was inconsistent with exprIsBig. This patch fixes this.
-
- 26 Jan, 2008 1 commit
-
-
twanvl authored
-
- 03 Oct, 2007 1 commit
-
-
chak@cse.unsw.edu.au. authored
-
- 29 Sep, 2007 1 commit
-
-
chak@cse.unsw.edu.au. authored
-
- 10 Sep, 2007 1 commit
-
-
chak@cse.unsw.edu.au. authored
-
- 04 Sep, 2007 1 commit
-
-
Ian Lynagh authored
-
- 03 Sep, 2007 1 commit
-
-
Ian Lynagh authored
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.
-
- 01 Sep, 2007 1 commit
-
-
Ian Lynagh authored
-
- 28 Aug, 2007 1 commit
-
-
chak@cse.unsw.edu.au. authored
This patch introduces type checking for type families of which associated type synonyms are a special case. E.g. type family Sum n m type instance Sum Zero n = n type instance Sum (Succ n) m = Succ (Sum n m) where data Zero -- empty type data Succ n -- empty type In addition we support equational constraints of the form: ty1 ~ ty2 (where ty1 and ty2 are arbitrary tau types) in any context where type class constraints are already allowed, e.g. data Equals a b where Equals :: a ~ b => Equals a b The above two syntactical extensions are disabled by default. Enable with the -XTypeFamilies flag. For further documentation about the patch, see: * the master plan http://hackage.haskell.org/trac/ghc/wiki/TypeFunctions * the user-level documentation http://haskell.org/haskellwiki/GHC/Indexed_types The patch is mostly backwards compatible, except for: * Some error messages have been changed slightly. * Type checking of GADTs now requires a bit more type declarations: not only should the type of a GADT case scrutinee be given, but also that of any identifiers used in the branches and the return type. Please report any unexpected behavior and incomprehensible error message for existing code. Contributors (code and/or ideas): Tom Schrijvers Manuel Chakravarty Simon Peyton-Jones Martin Sulzmann with special thanks to Roman Leshchinskiy
-
- 09 Aug, 2007 1 commit
-
-
simonpj@microsoft.com authored
I've forgotten the precise details already, but this patch significantly refactors the way newtypes are handled, fixes the foreign-export problem Trac #736 (which concerned newtypes), and gets rid of a bogus unsafeCoerce in the foreign export desugaring.
-
- 23 May, 2007 1 commit
-
-
simonpj@microsoft.com authored
-
- 11 May, 2007 1 commit
-
-
TomSchrijvers authored
-
- 25 Apr, 2007 1 commit
-
-
chak@cse.unsw.edu.au. authored
- Type synonym instances are turned into representation synonym tycons - They are entered into the pool of family instances (FamInst environments) in the same way as data/newtype instances - Still missing is writing the parent tycon information into ifaces and various well-formedness checks.
-
- 05 Feb, 2007 1 commit
-
-
simonpj@microsoft.com authored
At the moment GHC really does very little simplification of coercions. This patch improves matters, but it's still not great, especially when you have chains linked together with 'trans'. I'm also concerned that I have not yet implemented the 'leftc' and 'rightc' coercions we added to the paper. But at least things are better than they were. In particular g `trans` sym g now cancels to give the identity.
-
- 11 Jan, 2007 1 commit
-
-
simonpj@microsoft.com authored
-
- 13 Oct, 2006 1 commit
-
-
simonpj@microsoft.com authored
A type variable has a flag saying whether it is a *type* variable or a *coercion* variable. This patch adds assertions to check the flag. And it adds fixes to places which were Wrong (and hence fired the assertion)! Also removed isCoVar from Coercion, since it's done by Var.isCoVar.
-
- 11 Oct, 2006 2 commits
-
-
Simon Marlow authored
-
Simon Marlow authored
This large commit combines several interrelated changes: - IfaceSyn now contains actual Names rather than the special IfaceExtName type. The binary interface file contains a symbol table of Names, where each entry is a (package, ModuleName, OccName) triple. Names in the IfaceSyn point to entries in the symbol table. This reduces the size of interface files, which should hopefully improve performance (not measured yet). The toIfaceXXX functions now do not need to pass around a function from Name -> IfaceExtName, which makes that code simpler. - Names now do not point directly to their parents, and the nameParent operation has gone away. It turned out to be hard to keep this information consistent in practice, and the parent info was only valid in some Names. Instead we made the following changes: * ImportAvails contains a new field imp_parent :: NameEnv AvailInfo which gives the family info for any Name in scope, and is used by the renamer when renaming export lists, amongst other things. This info is thrown away after renaming. * The mi_ver_fn field of ModIface now maps to (OccName,Version) instead of just Version, where the OccName is the parent name. This mapping is used when constructing the usage info for dependent modules. There may be entries in mi_ver_fn for things that are not in scope, whereas imp_parent only deals with in-scope things. * The md_exports field of ModDetails now contains [AvailInfo] rather than NameSet. This gives us family info for the exported names of a module. Also: - ifaceDeclSubBinders moved to IfaceSyn (seems like the right place for it). - heavily refactored renaming of import/export lists. - Unfortunately external core is now broken, as it relied on IfaceSyn. It requires some attention.
-
- 29 Sep, 2006 1 commit
-
-
simonpj@microsoft.com authored
Before the coKindFun could be applied to too many arguments; now it expects exactly the right number of arguments. That makes it easier to write the coKindFuns, and localises the work.
-