Embrace -XTypeInType, add -XStarIsType
[ghc.git] / testsuite / tests / indexed-types / should_compile / HO.hs
1 {-# LANGUAGE TypeFamilies, TypeOperators, RankNTypes #-}
2
3 module HO where
4
5 import Data.IORef
6 import Data.Kind
7
8 type family SMRef (m::(Type -> Type)) :: Type -> Type
9 type family SMMonad (r::(Type -> Type)) :: Type -> Type
10
11 type instance SMRef IO = IORef
12 type instance SMMonad IORef = IO
13
14
15 class SMMonad (SMRef m) ~ m => SM m where
16 new :: forall a. a -> m (SMRef m a)
17 read :: forall a. (SMRef m a) -> m a
18 write :: forall a. (SMRef m a) -> a -> m ()
19