summaryrefslogtreecommitdiff
path: root/testsuite/tests/th/T8028.hs
diff options
context:
space:
mode:
authorAdam Gundry <adam@well-typed.com>2015-05-04 15:30:37 +0100
committerAdam Gundry <adam@well-typed.com>2015-05-04 15:37:56 +0100
commit4efa421327cf127ebefde59b2eece693e37dc3c6 (patch)
treead98439468450a0d9b39c80d1a8e443e34b0445e /testsuite/tests/th/T8028.hs
parent2f6a0ac7061c59ed68a6dd5a2243e3e690acbd5f (diff)
downloadhaskell-4efa421327cf127ebefde59b2eece693e37dc3c6.tar.gz
Permit empty closed type families
Fixes #9840 and #10306, and includes an alternative resolution to #8028. This permits empty closed type families, and documents them in the user guide. It updates the Haddock submodule to support the API change. Test Plan: Added `indexed-types/should_compile/T9840` and updated `indexed-types/should_fail/ClosedFam4` and `th/T8028`. Reviewers: austin, simonpj, goldfire Reviewed By: goldfire Subscribers: bgamari, jstolarek, thomie, goldfire Differential Revision: https://phabricator.haskell.org/D841 GHC Trac Issues: #9840, #10306
Diffstat (limited to 'testsuite/tests/th/T8028.hs')
-rw-r--r--testsuite/tests/th/T8028.hs14
1 files changed, 12 insertions, 2 deletions
diff --git a/testsuite/tests/th/T8028.hs b/testsuite/tests/th/T8028.hs
index fec993a596..6145428aaf 100644
--- a/testsuite/tests/th/T8028.hs
+++ b/testsuite/tests/th/T8028.hs
@@ -1,7 +1,17 @@
-{-# LANGUAGE TemplateHaskell #-}
+{-# LANGUAGE TemplateHaskell, TypeFamilies #-}
module T8028 where
import T8028a
-$(x) \ No newline at end of file
+import Language.Haskell.TH
+
+$(x)
+
+-- Check that the empty closed type family F produced by $(x) can
+-- subsequently be reified
+$(do f <- reify ''F
+ case f of
+ FamilyI (ClosedTypeFamilyD _ _ _ []) _ -> return []
+ _ -> error $ show f
+ )