summaryrefslogtreecommitdiff
path: root/testsuite/tests/indexed-types/should_compile/HO.hs
blob: 40d597a76f178cbb85763ab7d6f93d45a80eeaf0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{-# LANGUAGE TypeFamilies, TypeOperators, RankNTypes #-}

module HO where 

import Data.IORef

type family SMRef    (m::(* -> *)) :: * -> *
type family SMMonad  (r::(* -> *)) :: * -> *

type instance SMRef   IO 	= IORef
type instance SMMonad IORef	= IO


class SMMonad (SMRef m) ~ m => SM m where
	new   :: forall a. a -> m (SMRef m a)
	read  :: forall a. (SMRef m a) -> m a
	write :: forall a. (SMRef m a) -> a -> m ()