Skip to content
Snippets Groups Projects
Commit 679bbc97 authored by Vladislav Zavialov's avatar Vladislav Zavialov Committed by Marge Bot
Browse files

testsuite: Do not require CUSKs

Numerous tests make use of CUSKs (complete user-supplied kinds),
a legacy feature scheduled for deprecation. In order to proceed
with the said deprecation, the tests have been updated to use SAKS
instead (standalone kind signatures).

This also allows us to remove the Haskell2010 language pragmas that
were added in 115cd3c8 to work around the lack of CUSKs in GHC2021.
parent 59c5fe1d
No related branches found
No related tags found
No related merge requests found
Showing
with 76 additions and 65 deletions
{-# LANGUAGE Haskell2010 #-}
{-# LANGUAGE PolyKinds, GADTs #-} {-# LANGUAGE PolyKinds, GADTs #-}
module Dep2 where module Dep2 where
data G (a :: k) where import Data.Kind (Type)
type G :: k -> Type
data G a where
G1 :: G Int G1 :: G Int
G2 :: G Maybe G2 :: G Maybe
{-# LANGUAGE Haskell2010 #-}
{-# LANGUAGE TypeFamilies, DataKinds, PolyKinds #-} {-# LANGUAGE TypeFamilies, DataKinds, PolyKinds #-}
module DkNameRes where module DkNameRes where
...@@ -6,5 +5,6 @@ module DkNameRes where ...@@ -6,5 +5,6 @@ module DkNameRes where
import Data.Proxy import Data.Proxy
import Data.Kind import Data.Kind
type family IfK (e :: Proxy (j :: Bool)) :: Type where type IfK :: Proxy (j :: Bool) -> Type
type family IfK e where
IfK (_ :: Proxy True) = () IfK (_ :: Proxy True) = ()
{-# LANGUAGE Haskell2010 #-}
{-# LANGUAGE DataKinds, GADTs, PolyKinds, TypeFamilies, ExplicitForAll, {-# LANGUAGE DataKinds, GADTs, PolyKinds, TypeFamilies, ExplicitForAll,
TemplateHaskell, UndecidableInstances, ScopedTypeVariables #-} TemplateHaskell, UndecidableInstances, ScopedTypeVariables #-}
...@@ -16,7 +15,8 @@ data Ty :: Kind -> Type where ...@@ -16,7 +15,8 @@ data Ty :: Kind -> Type where
TApp :: Ty (Arr k1 k2) -> Ty k1 -> Ty k2 TApp :: Ty (Arr k1 k2) -> Ty k1 -> Ty k2
data TyRep (k :: Kind) (t :: Ty k) where type TyRep :: forall (k :: Kind) -> Ty k -> Type
data TyRep k t where
TyInt :: TyRep Star TInt TyInt :: TyRep Star TInt
TyBool :: TyRep Star TBool TyBool :: TyRep Star TBool
TyMaybe :: TyRep (Arr Star Star) TMaybe TyMaybe :: TyRep (Arr Star Star) TMaybe
......
{-# LANGUAGE Haskell2010 #-}
{-# LANGUAGE DataKinds, PolyKinds, GADTs, TypeOperators, TypeFamilies #-} {-# LANGUAGE DataKinds, PolyKinds, GADTs, TypeOperators, TypeFamilies #-}
{-# OPTIONS_GHC -fwarn-unticked-promoted-constructors #-} {-# OPTIONS_GHC -fwarn-unticked-promoted-constructors #-}
...@@ -23,7 +22,8 @@ data E :: D c -> Type ...@@ -23,7 +22,8 @@ data E :: D c -> Type
-- note that E :: forall (a :: A) (b :: B a) (c :: C b). D c -> Type -- note that E :: forall (a :: A) (b :: B a) (c :: C b). D c -> Type
-- a kind-indexed GADT -- a kind-indexed GADT
data TypeRep (a :: k) where type TypeRep :: k -> Type
data TypeRep a where
TInt :: TypeRep Int TInt :: TypeRep Int
TMaybe :: TypeRep Maybe TMaybe :: TypeRep Maybe
TApp :: TypeRep a -> TypeRep b -> TypeRep (a b) TApp :: TypeRep a -> TypeRep b -> TypeRep (a b)
...@@ -37,13 +37,15 @@ type family a + b where ...@@ -37,13 +37,15 @@ type family a + b where
'Zero + b = b 'Zero + b = b
('Succ a) + b = 'Succ (a + b) ('Succ a) + b = 'Succ (a + b)
data Vec :: Type -> Nat -> Type where type Vec :: Type -> Nat -> Type
data Vec a n where
Nil :: Vec a 'Zero Nil :: Vec a 'Zero
(:>) :: a -> Vec a n -> Vec a ('Succ n) (:>) :: a -> Vec a n -> Vec a ('Succ n)
infixr 5 :> infixr 5 :>
-- promoted GADT, and using + as a "kind family": -- promoted GADT, and using + as a "kind family":
type family (x :: Vec a n) ++ (y :: Vec a m) :: Vec a (n + m) where type (++) :: Vec a n -> Vec a m -> Vec a (n + m)
type family x ++ y where
'Nil ++ y = y 'Nil ++ y = y
(h ':> t) ++ y = h ':> (t ++ y) (h ':> t) ++ y = h ':> (t ++ y)
......
{-# LANGUAGE Haskell2010 #-}
{- Copyright (c) 2016 Richard Eisenberg {- Copyright (c) 2016 Richard Eisenberg
-} -}
...@@ -27,7 +26,8 @@ import qualified GHC.Exts as Exts ...@@ -27,7 +26,8 @@ import qualified GHC.Exts as Exts
-- Utilities -- Utilities
-- Heterogeneous propositional equality -- Heterogeneous propositional equality
data (a :: k1) :~~: (b :: k2) where type (:~~:) :: k1 -> k2 -> Type
data a :~~: b where
HRefl :: a :~~: a HRefl :: a :~~: a
-- Type-level inequality -- Type-level inequality
...@@ -76,7 +76,8 @@ Nil %:++ x = x ...@@ -76,7 +76,8 @@ Nil %:++ x = x
-- Type-indexed type representations -- Type-indexed type representations
-- Based on "A reflection on types" -- Based on "A reflection on types"
data TyCon (a :: k) where type TyCon :: k -> Type
data TyCon a where
Int :: TyCon Int Int :: TyCon Int
Bool :: TyCon Bool Bool :: TyCon Bool
Char :: TyCon Char Char :: TyCon Char
...@@ -110,7 +111,8 @@ type family Primitive (a :: k) :: Constraint where ...@@ -110,7 +111,8 @@ type family Primitive (a :: k) :: Constraint where
Primitive (_ _) = ('False ~ 'True) Primitive (_ _) = ('False ~ 'True)
Primitive _ = (() :: Constraint) Primitive _ = (() :: Constraint)
data TypeRep (a :: k) where type TypeRep :: k -> Type
data TypeRep a where
TyCon :: forall k (a :: k). (Primitive a, Typeable k) => TyCon a -> TypeRep a TyCon :: forall k (a :: k). (Primitive a, Typeable k) => TyCon a -> TypeRep a
TyApp :: TypeRep a -> TypeRep b -> TypeRep (a b) TyApp :: TypeRep a -> TypeRep b -> TypeRep (a b)
......
{-# LANGUAGE Haskell2010 #-}
{-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE GADTs #-} {-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-} {-# LANGUAGE RankNTypes #-}
...@@ -11,19 +10,22 @@ ...@@ -11,19 +10,22 @@
module T11711 where module T11711 where
import Data.Kind (Type) import Data.Kind (Type, Constraint)
data (:~~:) (a :: k1) (b :: k2) where type (:~~:) :: k1 -> k2 -> Type
data (:~~:) a b where
HRefl :: a :~~: a HRefl :: a :~~: a
data TypeRep (a :: k) where type TypeRep :: k -> Type
data TypeRep a where
TrTyCon :: String -> TypeRep k -> TypeRep (a :: k) TrTyCon :: String -> TypeRep k -> TypeRep (a :: k)
TrApp :: forall k1 k2 (a :: k1 -> k2) (b :: k1). TrApp :: forall k1 k2 (a :: k1 -> k2) (b :: k1).
TypeRep (a :: k1 -> k2) TypeRep (a :: k1 -> k2)
-> TypeRep (b :: k1) -> TypeRep (b :: k1)
-> TypeRep (a b) -> TypeRep (a b)
class Typeable (a :: k) where type Typeable :: k -> Constraint
class Typeable a where
typeRep :: TypeRep a typeRep :: TypeRep a
data SomeTypeRep where data SomeTypeRep where
......
{-# LANGUAGE Haskell2010 #-}
-- Based on https://github.com/idris-lang/Idris-dev/blob/v0.9.10/libs/effects/Effects.idr -- Based on https://github.com/idris-lang/Idris-dev/blob/v0.9.10/libs/effects/Effects.idr
{-# LANGUAGE DataKinds, PolyKinds, ScopedTypeVariables, TypeOperators, {-# LANGUAGE DataKinds, PolyKinds, ScopedTypeVariables, TypeOperators,
...@@ -34,9 +33,9 @@ data EffElem :: (Type ~> Type ~> Type ~> Type) -> Type -> [EFFECT] -> Type where ...@@ -34,9 +33,9 @@ data EffElem :: (Type ~> Type ~> Type ~> Type) -> Type -> [EFFECT] -> Type where
data instance Sing (elem :: EffElem x a xs) where data instance Sing (elem :: EffElem x a xs) where
SHere :: Sing Here SHere :: Sing Here
type family UpdateResTy (b :: Type) (t :: Type) type UpdateResTy :: forall e a. forall b t xs ->
(xs :: [EFFECT]) (elem :: EffElem e a xs) EffElem e a xs -> e @@ a @@ b @@ t -> [EFFECT]
(thing :: e @@ a @@ b @@ t) :: [EFFECT] where type family UpdateResTy b t xs elem thing where
UpdateResTy b _ (MkEff a e ': xs) Here n = MkEff b e ': xs UpdateResTy b _ (MkEff a e ': xs) Here n = MkEff b e ': xs
data EffM :: (Type ~> Type) -> [EFFECT] -> [EFFECT] -> Type -> Type data EffM :: (Type ~> Type) -> [EFFECT] -> [EFFECT] -> Type -> Type
......
{-# LANGUAGE Haskell2010 #-}
{-# LANGUAGE TypeFamilies, DataKinds, PolyKinds, ExplicitForAll, GADTs, {-# LANGUAGE TypeFamilies, DataKinds, PolyKinds, ExplicitForAll, GADTs,
UndecidableInstances, RankNTypes, ScopedTypeVariables #-} UndecidableInstances, RankNTypes, ScopedTypeVariables #-}
...@@ -32,7 +31,8 @@ type family G x a where ...@@ -32,7 +31,8 @@ type family G x a where
-- this last example just checks that GADT pattern-matching on kinds still works. -- this last example just checks that GADT pattern-matching on kinds still works.
-- nothing new here. -- nothing new here.
data T (a :: k) where type T :: k -> Type
data T a where
MkT :: T (a :: Type -> Type) MkT :: T (a :: Type -> Type)
data S (a :: Type -> Type) where data S (a :: Type -> Type) where
...@@ -54,9 +54,12 @@ type P k a = Proxy (a :: k) ...@@ -54,9 +54,12 @@ type P k a = Proxy (a :: k)
-- Naively, we don't know about c's kind early enough. -- Naively, we don't know about c's kind early enough.
data SameKind :: forall k. k -> k -> Type data SameKind :: forall k. k -> k -> Type
type family IfK (e :: Proxy (j :: Bool)) (f :: m) (g :: n) :: If j m n where
type IfK :: Proxy (j :: Bool) -> m -> n -> If j m n
type family IfK e f g where
IfK (_ :: Proxy True) f _ = f IfK (_ :: Proxy True) f _ = f
IfK (_ :: Proxy False) _ g = g IfK (_ :: Proxy False) _ g = g
x :: forall c. (forall a b (d :: a). SameKind (IfK c b d) d) -> (Proxy (c :: Proxy True)) x :: forall c. (forall a b (d :: a). SameKind (IfK c b d) d) -> (Proxy (c :: Proxy True))
x _ = Proxy x _ = Proxy
......
T14066a.hs:14:3: warning: [GHC-28129] [-Winaccessible-code (in -Wdefault)] T14066a.hs:13:3: warning: [GHC-28129] [-Winaccessible-code (in -Wdefault)]
Type family instance equation is overlapped: Type family instance equation is overlapped:
forall {c} {x :: c} {d} {y :: d}. forall {c} {x :: c} {d} {y :: d}.
Bar x y = Bool -- Defined at T14066a.hs:14:3 Bar x y = Bool -- Defined at T14066a.hs:13:3
{-# LANGUAGE Haskell2010 #-}
{-# Language UndecidableInstances, DataKinds, TypeOperators, PolyKinds, {-# Language UndecidableInstances, DataKinds, TypeOperators, PolyKinds,
TypeFamilies, GADTs, LambdaCase, ScopedTypeVariables #-} TypeFamilies, GADTs, LambdaCase, ScopedTypeVariables #-}
...@@ -10,8 +9,8 @@ import Data.Proxy ...@@ -10,8 +9,8 @@ import Data.Proxy
data Fn a b where data Fn a b where
IdSym :: Fn Type Type IdSym :: Fn Type Type
type family type (@@) :: Fn k k' -> k -> k'
(@@) (f::Fn k k') (a::k)::k' where type family f @@ a where
IdSym @@ a = a IdSym @@ a = a
data KIND = X | FNARR KIND KIND data KIND = X | FNARR KIND KIND
...@@ -20,19 +19,20 @@ data TY :: KIND -> Type where ...@@ -20,19 +19,20 @@ data TY :: KIND -> Type where
ID :: TY (FNARR X X) ID :: TY (FNARR X X)
FNAPP :: TY (FNARR k k') -> TY k -> TY k' FNAPP :: TY (FNARR k k') -> TY k -> TY k'
data TyRep (kind::KIND) :: TY kind -> Type where type TyRep :: forall (kind::KIND) -> TY kind -> Type
data TyRep k t where
TID :: TyRep (FNARR X X) ID TID :: TyRep (FNARR X X) ID
TFnApp :: TyRep (FNARR k k') f TFnApp :: TyRep (FNARR k k') f
-> TyRep k a -> TyRep k a
-> TyRep k' (FNAPP f a) -> TyRep k' (FNAPP f a)
type family type IK :: KIND -> Type
IK (kind::KIND) :: Type where type family IK k where
IK X = Type IK X = Type
IK (FNARR k k') = Fn (IK k) (IK k') IK (FNARR k k') = Fn (IK k) (IK k')
type family type IT :: TY kind -> IK kind
IT (ty::TY kind) :: IK kind where type family IT t where
IT ID = IdSym IT ID = IdSym
IT (FNAPP f x) = IT f @@ IT x IT (FNAPP f x) = IT f @@ IT x
......
{-# LANGUAGE Haskell2010 #-}
{-# LANGUAGE GADTs, TypeOperators, DataKinds, TypeFamilies, PolyKinds, TypeFamilyDependencies #-} {-# LANGUAGE GADTs, TypeOperators, DataKinds, TypeFamilies, PolyKinds, TypeFamilyDependencies #-}
module T14749 where module T14749 where
...@@ -15,11 +14,13 @@ type family IK (k :: KIND) = (res :: Type) where ...@@ -15,11 +14,13 @@ type family IK (k :: KIND) = (res :: Type) where
IK STAR = Type IK STAR = Type
IK (a:>b) = IK a -> IK b IK (a:>b) = IK a -> IK b
type family I (t :: Ty k) = (res :: IK k) where type I :: Ty k -> IK k
type family I t = res where
I TMaybe = Maybe I TMaybe = Maybe
I (TApp f a) = (I f) (I a) I (TApp f a) = (I f) (I a)
data TyRep (k :: KIND) (t :: Ty k) where type TyRep :: forall (k :: KIND) -> Ty k -> Type
data TyRep k t where
TyMaybe :: TyRep (STAR:>STAR) TMaybe TyMaybe :: TyRep (STAR:>STAR) TMaybe
TyApp :: TyRep (a:>b) f -> TyRep a x -> TyRep b (TApp f x) TyApp :: TyRep (a:>b) f -> TyRep a x -> TyRep b (TApp f x)
......
{-# LANGUAGE Haskell2010 #-}
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-} {-# LANGUAGE GADTs #-}
{-# LANGUAGE PolyKinds #-} {-# LANGUAGE PolyKinds #-}
...@@ -21,14 +20,9 @@ type DComp a ...@@ -21,14 +20,9 @@ type DComp a
(x :: a) = (x :: a) =
f (g x) f (g x)
-- Ensure that ElimList has a CUSK, beuas it is type ElimList :: forall (a :: Type) (p :: [a] -> Type) (s :: [a]) ->
-- is used polymorphically its RHS (c.f. #16344) p '[] -> (forall (x :: a) (xs :: [a]) -> p xs -> p (x:xs)) -> p s
type family ElimList (a :: Type) type family ElimList a p s pNil pCons where
(p :: [a] -> Type)
(s :: [a])
(pNil :: p '[])
(pCons :: forall (x :: a) (xs :: [a]) -> p xs -> p (x:xs))
:: p s where
forall a p pNil (pCons :: forall (x :: a) (xs :: [a]) -> p xs -> p (x:xs)). forall a p pNil (pCons :: forall (x :: a) (xs :: [a]) -> p xs -> p (x:xs)).
ElimList a p '[] pNil pCons = ElimList a p '[] pNil pCons =
pNil pNil
......
{-# LANGUAGE Haskell2010 #-}
{-# LANGUAGE DataKinds, PolyKinds, UnicodeSyntax, GADTs, NoImplicitPrelude, {-# LANGUAGE DataKinds, PolyKinds, UnicodeSyntax, GADTs, NoImplicitPrelude,
TypeOperators, TypeFamilies #-} TypeOperators, TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unticked-promoted-constructors #-} {-# OPTIONS_GHC -fno-warn-unticked-promoted-constructors #-}
...@@ -21,7 +20,8 @@ data Vec ∷ ℕ → Type → Type where ...@@ -21,7 +20,8 @@ data Vec ∷ ℕ → Type → Type where
(:>) a Vec n a Vec (S n) a (:>) a Vec n a Vec (S n) a
infixr 8 :> infixr 8 :>
type family (x Vec n a) ++ (y Vec m a) Vec (n + m) a where type (++) Vec n a Vec m a Vec (n + m) a
type family x ++ y where
Nil ++ y = y Nil ++ y = y
(x :> xs) ++ y = x :> (xs ++ y) (x :> xs) ++ y = x :> (xs ++ y)
infixl 5 ++ infixl 5 ++
{-# LANGUAGE Haskell2010 #-}
{- This is the code extracted from "A reflection on types", by Simon PJ, {- This is the code extracted from "A reflection on types", by Simon PJ,
Stephanie Weirich, Richard Eisenberg, and Dimitrios Vytiniotis, 2016. -} Stephanie Weirich, Richard Eisenberg, and Dimitrios Vytiniotis, 2016. -}
...@@ -186,7 +185,8 @@ dynFst (Dyn (rpab :: TypeRep pab) (x :: pab)) ...@@ -186,7 +185,8 @@ dynFst (Dyn (rpab :: TypeRep pab) (x :: pab))
eqT :: forall k1 k2 (a :: k1) (b :: k2). eqT :: forall k1 k2 (a :: k1) (b :: k2).
TypeRep a -> TypeRep b -> Maybe (a :~: b) TypeRep a -> TypeRep b -> Maybe (a :~: b)
data (a :: k1) :~: (b :: k2) where type (:~:) :: k1 -> k2 -> Type
data a :~: b where
Refl :: forall k (a :: k). a :~: a Refl :: forall k (a :: k). a :~: a
castDance :: (Typeable a, Typeable b) => a -> Maybe b castDance :: (Typeable a, Typeable b) => a -> Maybe b
...@@ -236,7 +236,8 @@ data OrderingT a b where ...@@ -236,7 +236,8 @@ data OrderingT a b where
EQT :: OrderingT t t EQT :: OrderingT t t
GTT :: OrderingT a b GTT :: OrderingT a b
data TypeRep (a :: k) where type TypeRep :: k -> Type
data TypeRep a where
TrApp :: TypeRep a -> TypeRep b -> TypeRep (a b) TrApp :: TypeRep a -> TypeRep b -> TypeRep (a b)
TrTyCon :: TyCon -> TypeRep k -> TypeRep (a :: k) TrTyCon :: TyCon -> TypeRep k -> TypeRep (a :: k)
......
{-# LANGUAGE Haskell2010 #-}
{-# LANGUAGE GADTs, PolyKinds, RankNTypes #-} {-# LANGUAGE GADTs, PolyKinds, RankNTypes #-}
module GADTVars where module GADTVars where
...@@ -6,5 +5,6 @@ module GADTVars where ...@@ -6,5 +5,6 @@ module GADTVars where
import Data.Kind import Data.Kind
import Data.Proxy import Data.Proxy
data T (k1 :: Type) (k2 :: Type) (a :: k2) (b :: k2) where type T :: Type -> forall (k2 :: Type) -> k2 -> k2 -> Type
data T k1 k2 a b where
MkT :: T x1 Type (Proxy (y :: x1), z) z MkT :: T x1 Type (Proxy (y :: x1), z) z
{-# LANGUAGE Haskell2010 #-}
{-# LANGUAGE TypeFamilies, DataKinds, PolyKinds #-} {-# LANGUAGE TypeFamilies, DataKinds, PolyKinds #-}
import GHC.Exts import GHC.Exts
...@@ -16,25 +15,32 @@ type family ...@@ -16,25 +15,32 @@ type family
-- Rep PtrRepUnlifted = IntRep -- Rep PtrRepUnlifted = IntRep
-- Rep PtrRepLifted = PtrRepLifted -- Rep PtrRepLifted = PtrRepLifted
type Eq :: TYPE rep -> Constraint
class Boolean (Logic a) => Eq (a :: TYPE rep) where class Boolean (Logic a) => Eq (a :: TYPE rep) where
type Logic (a :: TYPE rep) :: TYPE (Rep rep) type Logic (a :: TYPE rep) :: TYPE (Rep rep)
(==) :: a -> a -> Logic a (==) :: a -> a -> Logic a
type POrd :: TYPE rep -> Constraint
class Eq a => POrd (a :: TYPE rep) where class Eq a => POrd (a :: TYPE rep) where
inf :: a -> a -> a inf :: a -> a -> a
type MinBound :: TYPE rep -> Constraint
class POrd a => MinBound (a :: TYPE rep) where class POrd a => MinBound (a :: TYPE rep) where
minBound :: () -> a minBound :: () -> a
type Lattice :: TYPE rep -> Constraint
class POrd a => Lattice (a :: TYPE rep) where class POrd a => Lattice (a :: TYPE rep) where
sup :: a -> a -> a sup :: a -> a -> a
type Bounded :: TYPE rep -> Constraint
class (Lattice a, MinBound a) => Bounded (a :: TYPE rep) where class (Lattice a, MinBound a) => Bounded (a :: TYPE rep) where
maxBound :: () -> a maxBound :: () -> a
type Complemented :: TYPE rep -> Constraint
class Bounded a => Complemented (a :: TYPE rep) where class Bounded a => Complemented (a :: TYPE rep) where
not :: a -> a not :: a -> a
type Heyting :: TYPE rep -> Constraint
class Bounded a => Heyting (a :: TYPE rep) where class Bounded a => Heyting (a :: TYPE rep) where
infixr 3 ==> infixr 3 ==>
(==>) :: a -> a -> a (==>) :: a -> a -> a
......
{-# LANGUAGE Haskell2010 #-}
{-# LANGUAGE GADTs #-} {-# LANGUAGE GADTs #-}
{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE DataKinds, PolyKinds #-} {-# LANGUAGE DataKinds, PolyKinds #-}
...@@ -7,7 +6,7 @@ module T13780c where ...@@ -7,7 +6,7 @@ module T13780c where
import Data.Kind import Data.Kind
import T13780b import T13780b
type family ElimBool (p :: Bool -> Type) (b :: Bool) (s :: Sing b) type ElimBool :: (Bool -> Type) -> forall (b :: Bool) -> Sing b -> p False -> p True -> p b
(pFalse :: p False) (pTrue :: p True) :: p b where type family ElimBool p b s pFalse pTrue where
ElimBool _ _ SFalse pFalse _ = pFalse ElimBool _ _ SFalse pFalse _ = pFalse
ElimBool _ _ STrue _ pTrue = pTrue ElimBool _ _ STrue _ pTrue = pTrue
[1 of 2] Compiling T13780b ( T13780b.hs, T13780b.o ) [1 of 2] Compiling T13780b ( T13780b.hs, T13780b.o )
[2 of 2] Compiling T13780c ( T13780c.hs, T13780c.o ) [2 of 2] Compiling T13780c ( T13780c.hs, T13780c.o )
T13780c.hs:12:16: error: [GHC-64578] T13780c.hs:11:16: error: [GHC-64578]
• Data constructor ‘SFalse’ cannot be used here • Data constructor ‘SFalse’ cannot be used here
(it comes from a data family instance) (it comes from a data family instance)
• In the third argument of ‘ElimBool’, namely ‘SFalse’ • In the third argument of ‘ElimBool’, namely ‘SFalse’
In the type family declaration for ‘ElimBool’ In the type family declaration for ‘ElimBool’
T13780c.hs:13:16: error: [GHC-64578] T13780c.hs:12:16: error: [GHC-64578]
• Data constructor ‘STrue’ cannot be used here • Data constructor ‘STrue’ cannot be used here
(it comes from a data family instance) (it comes from a data family instance)
• In the third argument of ‘ElimBool’, namely ‘STrue’ • In the third argument of ‘ElimBool’, namely ‘STrue’
......
{-# LANGUAGE Haskell2010 #-}
{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE PolyKinds #-} {-# LANGUAGE PolyKinds #-}
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DataKinds #-}
...@@ -14,7 +13,8 @@ class Generic a where ...@@ -14,7 +13,8 @@ class Generic a where
class PGeneric a where class PGeneric a where
type To a (x :: Rep a) :: a type To a (x :: Rep a) :: a
type family MDefault (x :: a) :: a where type MDefault :: a -> a
type family MDefault x where
MDefault x = To (M x) MDefault x = To (M x)
class C a where class C a where
......
{-# LANGUAGE Haskell2010 #-}
{-# LANGUAGE TypeFamilies, PolyKinds, DataKinds, TypeOperators #-} {-# LANGUAGE TypeFamilies, PolyKinds, DataKinds, TypeOperators #-}
module T7939 where module T7939 where
import Data.Kind (Type) import Data.Kind (Type)
...@@ -23,6 +22,7 @@ type family K a where ...@@ -23,6 +22,7 @@ type family K a where
K '[] = Nothing K '[] = Nothing
K (h ': t) = Just h K (h ': t) = Just h
type family L (a :: k) (b :: Type) :: k where type L :: k -> Type -> k
type family L a b where
L Int Int = Bool L Int Int = Bool
L Maybe Bool = IO L Maybe Bool = IO
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment