Commit 78a4c729 authored by Ben Gamari's avatar Ben Gamari 🐢
Browse files

Rename InjectiveTypeFamilies to TypeFamilyDependencies

parent b0641ad9
......@@ -3208,7 +3208,7 @@ xFlags = [
flagSpec "ImpredicativeTypes" LangExt.ImpredicativeTypes,
flagSpec' "IncoherentInstances" LangExt.IncoherentInstances
setIncoherentInsts,
flagSpec "InjectiveTypeFamilies" LangExt.InjectiveTypeFamilies,
flagSpec "TypeFamilyDependencies" LangExt.TypeFamilyDependencies,
flagSpec "InstanceSigs" LangExt.InstanceSigs,
flagSpec "ApplicativeDo" LangExt.ApplicativeDo,
flagSpec "InterruptibleFFI" LangExt.InterruptibleFFI,
......@@ -3348,7 +3348,7 @@ impliedXFlags
, (LangExt.FlexibleInstances, turnOn, LangExt.TypeSynonymInstances)
, (LangExt.FunctionalDependencies, turnOn, LangExt.MultiParamTypeClasses)
, (LangExt.MultiParamTypeClasses, turnOn, LangExt.ConstrainedClassMethods) -- c.f. Trac #7854
, (LangExt.InjectiveTypeFamilies, turnOn, LangExt.TypeFamilies)
, (LangExt.TypeFamilyDependencies, turnOn, LangExt.TypeFamilies)
, (LangExt.RebindableSyntax, turnOff, LangExt.ImplicitPrelude) -- NB: turn off!
......
......@@ -832,9 +832,9 @@ tcInjectivity _ Nothing
tcInjectivity tvs (Just (L loc (InjectivityAnn _ lInjNames)))
= setSrcSpan loc $
do { dflags <- getDynFlags
; checkTc (xopt LangExt.InjectiveTypeFamilies dflags)
; checkTc (xopt LangExt.TypeFamilyDependencies dflags)
(text "Illegal injectivity annotation" $$
text "Use InjectiveTypeFamilies to allow this")
text "Use TypeFamilyDependencies to allow this")
; inj_tvs <- mapM (tcLookupTyVar . unLoc) lInjNames
; let inj_ktvs = filterVarSet isTyVar $ -- no injective coercion vars
closeOverKinds (mkVarSet inj_tvs)
......
......@@ -6741,9 +6741,10 @@ which implicitly defines an instance of the form ::
Injective type families
-----------------------
.. ghc-flag:: -XInjectiveTypeFamilies
.. ghc-flag:: -XTypeFamilyDependencies
Allow injectivity annotations on type families.
Allow functional dependency annotations on type families. This allows one to
define injective type families.
Starting with GHC 8.0 type families can be annotated with injectivity
information. This information is then used by GHC during type checking
......@@ -6764,7 +6765,7 @@ will be possible to infer ``t`` at call sites from the type of the argument: ::
type family Id a = r | r -> a
Injective type families are enabled with ``-XInjectiveTypeFamilies`` language
Injective type families are enabled with ``-XTypeFamilyDependencies`` language
extension. This extension implies ``-XTypeFamilies``.
For full details on injective type families refer to Haskell Symposium
......
......@@ -45,7 +45,7 @@ data Extension
| UnboxedTuples
| BangPatterns
| TypeFamilies
| InjectiveTypeFamilies
| TypeFamilyDependencies
| TypeInType
| OverloadedStrings
| OverloadedLists
......
......@@ -2,7 +2,7 @@
module T11381 where
-- ensure that this code does not compile without InjectiveTypeFamilies and that
-- ensure that this code does not compile without TypeFamilyDependencies and that
-- injectivity error is not reported.
type family F a = r | r -> a
type instance F Int = Bool
......
T11381.hs:7:23:
Illegal injectivity annotation
Use InjectiveTypeFamilies to allow this
Use TypeFamilyDependencies to allow this
In the type family declaration for ‘F’
......@@ -39,7 +39,7 @@ expectedGhcOnlyExtensions :: [String]
expectedGhcOnlyExtensions = ["RelaxedLayout",
"AlternativeLayoutRule",
"AlternativeLayoutRuleTransitional",
"InjectiveTypeFamilies"]
"TypeFamilyDependencies"]
expectedCabalOnlyExtensions :: [String]
expectedCabalOnlyExtensions = ["Generics",
......
:set -XInjectiveTypeFamilies
:set -XTypeFamilyDependencies
:set -XDataKinds
:set -XUndecidableInstances
:set -XPolyKinds
......
:set -XInjectiveTypeFamilies
:set -XTypeFamilyDependencies
:set -XDataKinds
:set -XUndecidableInstances
:set -XPolyKinds
......
:set -XInjectiveTypeFamilies
:set -XTypeFamilyDependencies
:set -XDataKinds
:set -XUndecidableInstances
:set -XPolyKinds
......
{-# LANGUAGE InjectiveTypeFamilies, DataKinds, UndecidableInstances,
{-# LANGUAGE TypeFamilyDependencies, DataKinds, UndecidableInstances,
PolyKinds #-}
module T6018th where
......
{-# LANGUAGE TemplateHaskell, InjectiveTypeFamilies, PolyKinds #-}
{-# LANGUAGE TemplateHaskell, TypeFamilyDependencies, PolyKinds #-}
module T8884 where
......
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE InjectiveTypeFamilies #-}
{-# LANGUAGE TypeFamilyDependencies #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
......
{-# LANGUAGE InjectiveTypeFamilies, PolyKinds #-}
{-# LANGUAGE TypeFamilyDependencies, PolyKinds #-}
module T6018 where
......
{-# LANGUAGE InjectiveTypeFamilies #-}
{-# LANGUAGE TypeFamilyDependencies #-}
module T6018a where
......
{-# LANGUAGE InjectiveTypeFamilies #-}
{-# LANGUAGE TypeFamilyDependencies #-}
module T10836 where
type family Foo a = r | r -> a where
......
{-# LANGUAGE InjectiveTypeFamilies #-}
{-# LANGUAGE TypeFamilyDependencies #-}
module T6018Afail where
......
{-# LANGUAGE InjectiveTypeFamilies #-}
{-# LANGUAGE TypeFamilyDependencies #-}
module T6018Bfail where
......
{-# LANGUAGE InjectiveTypeFamilies, DataKinds, UndecidableInstances, PolyKinds,
{-# LANGUAGE TypeFamilyDependencies, DataKinds, UndecidableInstances, PolyKinds,
MultiParamTypeClasses, FlexibleInstances #-}
module T6018fail where
......
{-# LANGUAGE InjectiveTypeFamilies, DataKinds, PolyKinds,
{-# LANGUAGE TypeFamilyDependencies, DataKinds, PolyKinds,
UndecidableInstances #-}
module T6018failclosed where
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment