summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/T5595.hs
blob: d9f9e137b21d92473df793f817a4ec34e8a00819 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{-# LANGUAGE UnicodeSyntax, RankNTypes, TypeFamilies #-}
module T5595 where

class MonadTransControl t where
  type St t :: * → *

  liftControl :: Monad m =>(Run t → m a) → t m a

  restore :: Monad o => St t y → t o y

type Run t = forall n b. Monad n => t n b → n (St t b)

foo :: (Monad m, MonadTransControl t) => (Run t -> m a) -> t m a
foo f = liftControl f