diff options
author | Gert-Jan Bottu <gertjan.bottu@kuleuven.be> | 2020-03-23 09:36:28 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-05-21 12:11:31 -0400 |
commit | a9311cd53d33439e8fe79967ba5fb85bcd114fec (patch) | |
tree | 2254ef735a24f9de8d192203a3c6f4871a8b6ae9 /testsuite/tests/th/T6018th.hs | |
parent | 55f0e783d234af103cf4e1d51cd31c99961c5abe (diff) | |
download | haskell-a9311cd53d33439e8fe79967ba5fb85bcd114fec.tar.gz |
Explicit Specificity
Implementation for Ticket #16393.
Explicit specificity allows users to manually create inferred type variables,
by marking them with braces.
This way, the user determines which variables can be instantiated through
visible type application.
The additional syntax is included in the parser, allowing users to write
braces in type variable binders (type signatures, data constructors etc).
This information is passed along through the renamer and verified in the
type checker.
The AST for type variable binders, data constructors, pattern synonyms,
partial signatures and Template Haskell has been updated to include the
specificity of type variables.
Minor notes:
- Bumps haddock submodule
- Disables pattern match checking in GHC.Iface.Type with GHC 8.8
Diffstat (limited to 'testsuite/tests/th/T6018th.hs')
-rw-r--r-- | testsuite/tests/th/T6018th.hs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/testsuite/tests/th/T6018th.hs b/testsuite/tests/th/T6018th.hs index d0f448b80a..41e0b5e607 100644 --- a/testsuite/tests/th/T6018th.hs +++ b/testsuite/tests/th/T6018th.hs @@ -14,8 +14,8 @@ import Language.Haskell.TH $( return [ OpenTypeFamilyD (TypeFamilyHead (mkName "F") - [ PlainTV (mkName "a"), PlainTV (mkName "b"), PlainTV (mkName "c") ] - (TyVarSig (KindedTV (mkName "result") (VarT (mkName "k")))) + [ PlainTV (mkName "a") (), PlainTV (mkName "b") (), PlainTV (mkName "c") () ] + (TyVarSig (KindedTV (mkName "result") () (VarT (mkName "k")))) (Just $ InjectivityAnn (mkName "result") [(mkName "a"), (mkName "b"), (mkName "c") ])) , TySynInstD @@ -41,8 +41,8 @@ $( return $( return [ OpenTypeFamilyD (TypeFamilyHead (mkName "J") - [ PlainTV (mkName "a"), KindedTV (mkName "b") (VarT (mkName "k")) ] - (TyVarSig (PlainTV (mkName "r"))) + [ PlainTV (mkName "a") (), KindedTV (mkName "b") () (VarT (mkName "k")) ] + (TyVarSig (PlainTV (mkName "r") ())) (Just $ InjectivityAnn (mkName "r") [mkName "a"])) , TySynInstD (TySynEqn Nothing (AppT (AppT (ConT (mkName "J")) (ConT (mkName "Int"))) @@ -60,9 +60,9 @@ $( return $( return [ ClosedTypeFamilyD (TypeFamilyHead (mkName "I") - [ KindedTV (mkName "a") StarT, KindedTV (mkName "b") StarT - , KindedTV (mkName "c") StarT ] - (TyVarSig (PlainTV (mkName "r"))) + [ KindedTV (mkName "a") () StarT, KindedTV (mkName "b") () StarT + , KindedTV (mkName "c") () StarT ] + (TyVarSig (PlainTV (mkName "r") ())) (Just $ InjectivityAnn (mkName "r") [(mkName "a"), (mkName "b")])) [ TySynEqn Nothing (AppT (AppT (AppT (ConT (mkName "I")) (ConT (mkName "Int"))) @@ -98,8 +98,8 @@ $( do { decl@([ClosedTypeFamilyD (TypeFamilyHead _ _ _ (Just inj)) _]) <- $( return [ OpenTypeFamilyD (TypeFamilyHead (mkName "H") - [ PlainTV (mkName "a"), PlainTV (mkName "b"), PlainTV (mkName "c") ] - (TyVarSig (PlainTV (mkName "r"))) + [ PlainTV (mkName "a") (), PlainTV (mkName "b") (), PlainTV (mkName "c") () ] + (TyVarSig (PlainTV (mkName "r") ())) (Just $ InjectivityAnn (mkName "r") [(mkName "a"), (mkName "b") ])) |