Injective type families

Represent injectivity conditions as names, not TyVars
Remove 'result' from the parser
Fix comment wibbles
Minor refactoring

Implement rwbarton's syntax proposal

Represent type family kind signature using new datatype
Attempt to bring return tyfam variable into scope
Differential Revision: https://phabricator.haskell.org/D202
Fix "Not in scope" bug

Add injectivity information to SynTyCon constructor

Implement checking of injectivity condition written by the user
Remove unused parameter from doTopReactFunEq
Allow injectivity in some arguments (renamer)
Improve error handling when renaming injectivity conditions
Revert "Add injectivity information to FamInst and interface files"

Supply injectivity info when looking for open type family conflicts

Working prototype for open type families
Add some tests

Validate that all injective LHS vars appear in RHS

Richard's comments
Use hsep and <+> to format error messages
Comments only
Renamer tests and bugfixes
Remove unnecessary info from injectivity declaration in typechecker

WIP on injectivity checks for open type families

Fix error handling in the renamer

Improving error messages and testing

WIP on injectivity checks for open type families

Fix error handling in the renamer
Improving error messages and testing
Formatting fixes
Change definition of askNoErrs following Simon's suggestions
Testsuite wibbles
Add Simon's proposed checkNoErrs (commented out)
Improve FamilyResultSig comment per Simon's suggestion
Introduce LInjectivityInfo per RAE's suggestion
InjectivityInfo -> InjectivityDecl. Comments
fdKindSig -> fdResultSig

existsSignature -> hasReturnKindSignature. Haddock

extractInjectivityInformation -> getInjectivityInformation

Clean up rn_injectivity

Clean up FamInst and FamInstEnv

KindedTyVarSig -> TyVarSig

KindOnlySig -> KindSig

Add filterByList. Some comments

More tests

Comments only
Fix build errors after rebase
Refactoring + testsuite wibbles

unsafeSynTyConInjectivityInfo -> synTyConInjectivityInfo

Name refactoring + comments

Check for result shadowing with type classes

More tests
Fis usage of is/are in error message
Comments only

Display injectivity info with --show-iface

Conflicts:
	compiler/iface/BuildTyCl.lhs
	compiler/iface/IfaceSyn.lhs
	compiler/iface/MkIface.lhs
	compiler/iface/TcIface.lhs
	compiler/prelude/TysPrim.lhs
	compiler/typecheck/TcTyClsDecls.lhs
	compiler/typecheck/TcTypeNats.hs
	compiler/types/TyCon.lhs
	compiler/vectorise/Vectorise/Type/Env.hs

Represent injectivity info in SynTyCon as a Maybe

This is important for type synonyms because we don't track injectivity information for them

Conflicts:
	compiler/iface/BuildTyCl.lhs
	compiler/iface/IfaceSyn.lhs
	compiler/iface/MkIface.lhs
	compiler/prelude/TysPrim.lhs
	compiler/typecheck/TcTyClsDecls.lhs
	compiler/types/TyCon.lhs
	compiler/vectorise/Vectorise/Type/Env.hs

Comments + tests

Include kindvars in injectivity list. Fix #73

Fix compilation failures after rebase

Fix resVar reconstruction from interface file

Allow polymorphic result variables. Fixes #71

Fix default initial kind for type families

Fixes #82

Remove extra parameter to bindHsTyVars

Fixes #79

Comment typo

Comment typo

Attempt to fix parser compilation errors after rebase

Fix compilation errors in parser

Make fdResultSig located as per alanz's suggestion

Fix injectivity check for open type families

Previously I used some ad-hoc hack, now I have an algorithm that
seems to be correct. I also added some stub comments. Need to add
more later

Add GHCi tests for injectivity

Comments only

Comments only

Check injectivity in .hs-boot files

Remove references to SynTyCon from comments

And do a minor name refactoring in the vectorizer

Document injective type families in the source code

Minor comment tweaks

Fix bug in optimizing injectivity check. Fixes #90

See Note [Skipping injectivity check for empty environments]

Introduce FamInstCheckType instead of Bool

Fixes #86

Clean up Notes

- convert to block comments
- move Note [Injectivity check ...] from FamInst to FamInstEnv

Revert "Clean up Notes"

This reverts commit eb937f47705b85579f76b8b05342af1541b384db.

Move Note [Injectivity ...] from FamInst to FamInstEnv

Clean up rnFamDecl according to RAE's suggestions

Clean up pretty printing

Clean up getFamDeclInitialKind

Clean up injectiveBranches

Create a separate function for finding injectivity conflicts

Refactor common logic to checkForInjectivityConflicts

Shorten error message

injectivity declaration -> injectivity annotation

Fixes #92

Remove injectivity environment

Code cleanup according to Richard's suggestions

Comment only

Use promoted types to labex axiom branchness

Fixes #89

Injectivity check for closed type families

 * reject equations with unused tyvars in the RHS
 * reject equations that use type families
 * erro fix for open type families

Provisional injectivity check for closed type families

Port open type family tests to closed type families

These tests are not yet exhaustive - they don't test propertied
typical to closed type families (like overlapp)

HAck injectivity check with overlap

Tests for closed type families

Comments only

Add injectivity support in Template Haskell

Injectivity in Template Haskell - work in progress

Update haddock submodule

Fix panic with data families

Fix TH pprinting error

Remove TcCanonical.lhs (added accidentally during merge)

Reorder fields of FamilyDecl

Names refactoring