Commit accd944a authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Test Trac #6015 and #6068

parent d93dc415
{-# LANGUAGE PolyKinds, KindSignatures, FunctionalDependencies, FlexibleInstances,
UndecidableInstances, TypeOperators, DataKinds, FlexibleContexts #-}
module T6015a where
import Prelude hiding ((++))
data T a = T
class ((a :: [k]) ++ (b :: [k])) (c :: [k]) | a b -> c
instance ('[] ++ b) b
instance (a ++ b) c => ((x ': a) ++ b) (x ': c)
test = T :: ('[True] ++ '[]) l => T l
{-# LANGUAGE PolyKinds, DataKinds, TypeFamilies, GADTs, MultiParamTypeClasses,
FunctionalDependencies, FlexibleInstances, UndecidableInstances, ExistentialQuantification #-}
module T6068 where
import Prelude hiding (Maybe, Nothing)
data Maybe :: * -> * where
Nothing :: Maybe a
data family Sing (a :: k)
data instance Sing (a :: Maybe k) where
SNothing :: Sing Nothing
data KProxy (a :: *) = KProxy
data Existential (p :: KProxy k) =
forall (a :: k). Exists (Sing a)
class HasSingleton a (kp :: KProxy k) | a -> kp where
exists :: a -> Existential kp
instance forall a (mp :: KProxy (Maybe ak)). HasSingleton (Maybe a) mp where
exists Nothing = Exists SNothing
-- instance forall (a ::*) (mp :: KProxy (Maybe ak)). HasSingleton (Maybe ak) (Maybe a) mp where
-- exists Nothing = Exists SNothing
exists Nothing :: Existential (Maybe *) kp
......@@ -46,3 +46,5 @@ test('T6044', normal, compile, [''])
test('T6054', normal, run_command, ['$MAKE -s --no-print-directory T6054'])
test('T6081', normal, compile, [''])
test('T6015', normal, compile, [''])
test('T6015a', normal, compile, [''])
test('T6068', normal, ghci_script, ['T6068.script'])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment