diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2022-07-19 17:06:41 +0100 |
---|---|---|
committer | Zubin Duggal <zubin.duggal@gmail.com> | 2022-07-26 16:28:48 +0530 |
commit | a989d1a2a3110eb7614828320a3877c774de2227 (patch) | |
tree | 4ff2632df7ae3931aab109e90d2a9fe2c986e3e1 | |
parent | f1b85d40a34c2bd87237f82eeba9e0125c80a3c9 (diff) | |
download | haskell-a989d1a2a3110eb7614828320a3877c774de2227.tar.gz |
Add DeepSubsumption08
(cherry picked from commit 671899858585376dcbbbdc3740dad4b8ec7b6a70)
-rw-r--r-- | testsuite/tests/typecheck/should_compile/DeepSubsumption08.hs | 16 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_compile/all.T | 1 |
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 da674e0a2c..dc120a748f 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -802,3 +802,4 @@ test('DeepSubsumption04', normal, compile, ['']) test('DeepSubsumption05', normal, compile, ['']) test('DeepSubsumption06', normal, compile, ['-XHaskell98']) test('DeepSubsumption07', normal, compile, ['-XHaskell2010']) +test('DeepSubsumption08', normal, compile, ['']) |