blob: 11413dc5e5398220bc0defa218e67b8fce9c6556 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
{-# LANGUAGE GADTs, RankNTypes #-}
module T12427b where
newtype Acquire a = Acquire {unAcquire :: (forall b. b -> b) -> IO a}
instance Functor Acquire where
fmap = undefined
instance Applicative Acquire where
pure = undefined
(<*>) = undefined
instance Monad Acquire where
Acquire f >>= g' = Acquire $ \restore -> do
x <- f restore
let Acquire g = g' x
-- let g = unAcquire (g' x)
g restore
|