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

module HO where

import Data.IORef
import Data.Kind

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

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