hadrian: Add support for bindist compressors other than Xz
[ghc.git] / testsuite / tests / typecheck / should_compile / T7196.hs
1 {-# OPTIONS_GHC -fno-warn-redundant-constraints #-}
2 {-# LANGUAGE ImpredicativeTypes #-}
3 {-# LANGUAGE FlexibleContexts #-}
4 {-# LANGUAGE ScopedTypeVariables #-}
5 {-# LANGUAGE KindSignatures #-}
6 {-# LANGUAGE TypeFamilies #-}
7
8 module Patch (qc_prim) where
9
10 import Data.Kind (Type)
11
12 class PrimPatch (prim :: Type -> Type -> Type)
13
14 class PrimPatch (PrimOf p) => PrimPatchBase p where
15 type PrimOf (p :: Type -> Type -> Type) :: Type -> Type -> Type
16
17 type TestGenerator thing gen = (forall t ctx . (forall xx yy . thing xx yy -> t) -> (gen ctx -> t))
18
19 type family ModelOf (patch :: Type -> Type -> Type) :: Type -> Type
20
21 data WithState s p x y = WithState {
22 _wsStartState :: s x
23 , _wsPatch :: p x y
24 , _wsEndState :: s y
25 }
26
27 arbitraryThing :: x -> TestGenerator thing (thing x)
28 arbitraryThing _ f p = f p
29
30 qc_prim :: forall prim x y .
31 (PrimPatch prim
32 , PrimOf prim ~ prim
33 ) => prim x y -> [()]
34 qc_prim _ =
35 concat
36 [
37 patch_repo_properties (undefined :: prim x a) "arbitrary" arbitraryThing'
38 ]
39 where arbitraryThing' = arbitraryThing (undefined :: a)
40
41 patch_repo_properties :: p x y -> String -> TestGenerator (WithState (ModelOf (PrimOf p)) p) gen -> [()]
42 patch_repo_properties _ _genname _gen = undefined
43