HO.hs 431 Bytes
Newer Older
1
{-# LANGUAGE TypeFamilies, TypeOperators, RankNTypes #-}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

module HO where 

import IO
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 ()