summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-07-19 17:06:41 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-07-25 09:42:01 -0400
commit671899858585376dcbbbdc3740dad4b8ec7b6a70 (patch)
tree3f963ced252f0f1c304635c4e6cf9595e87d9dc8
parente31ead39331f1bb6d3976ae7573be8fe2b364172 (diff)
downloadhaskell-671899858585376dcbbbdc3740dad4b8ec7b6a70.tar.gz
Add DeepSubsumption08
-rw-r--r--testsuite/tests/typecheck/should_compile/DeepSubsumption08.hs16
-rw-r--r--testsuite/tests/typecheck/should_compile/all.T1
2 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/DeepSubsumption08.hs b/testsuite/tests/typecheck/should_compile/DeepSubsumption08.hs
new file mode 100644
index 0000000000..d4019df3d8
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/DeepSubsumption08.hs
@@ -0,0 +1,16 @@
+{-# LANGUAGE RankNTypes #-}
+{-# LANGUAGE Haskell2010 #-}
+module DeepSubsumption08 where
+
+class (Traversable f, Applicative f) => Identical f where
+ extract :: f a -> a
+
+type LensLike f s t a b = (a -> f b) -> (s -> f t)
+type Setter s t a b = forall f. Identical f => LensLike f s t a b
+
+(.~) :: Setter s t a b -> b -> s -> t
+(.~) a = undefined
+
+-- | Sets the provided lens in @a@ to @Nothing@.
+clear :: Setter a a' b (Maybe b') -> a -> a'
+clear = (.~ Nothing)
diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T
index 3071562989..2d919a9c14 100644
--- a/testsuite/tests/typecheck/should_compile/all.T
+++ b/testsuite/tests/typecheck/should_compile/all.T
@@ -851,3 +851,4 @@ test('DeepSubsumption04', normal, compile, [''])
test('DeepSubsumption05', normal, compile, [''])
test('DeepSubsumption06', normal, compile, ['-XHaskell98'])
test('DeepSubsumption07', normal, compile, ['-XHaskell2010'])
+test('DeepSubsumption08', normal, compile, [''])