Skip to content

Commit 96e0140

Browse files
authored
Merge pull request #75 from garyb/remove-monadcont
Remove MonadCont instance
2 parents 2bd34cd + 4207be3 commit 96e0140

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

src/Control/Monad/Aff.purs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import Prelude
2525
import Control.Alt (class Alt)
2626
import Control.Alternative (class Alternative)
2727
import Control.Monad.Aff.Internal (AVBox, AVar, _killVar, _putVar, _takeVar, _makeVar)
28-
import Control.Monad.Cont.Class (class MonadCont)
2928
import Control.Monad.Eff (Eff)
3029
import Control.Monad.Eff.Class (class MonadEff)
3130
import Control.Monad.Eff.Exception (Error, EXCEPTION, throwException, error)
@@ -208,9 +207,6 @@ instance monadRecAff :: MonadRec (Aff e) where
208207
isLoop (Loop _) = true
209208
isLoop _ = false
210209

211-
instance monadContAff :: MonadCont (Aff e) where
212-
callCC f = makeAff (\eb cb -> void $ runAff eb cb (f \a -> makeAff (\_ _ -> cb a)))
213-
214210
instance semigroupCanceler :: Semigroup (Canceler e) where
215211
append (Canceler f1) (Canceler f2) = Canceler (\e -> (||) <$> f1 e <*> f2 e)
216212

test/Test/Main.purs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import Control.Alt ((<|>))
66
import Control.Monad.Aff (Aff, runAff, makeAff, launchAff, later, later', forkAff, forkAll, Canceler(..), cancel, attempt, finally, apathize)
77
import Control.Monad.Aff.AVar (AVAR, makeVar, makeVar', putVar, modifyVar, takeVar, peekVar, killVar)
88
import Control.Monad.Aff.Console (CONSOLE, log)
9-
import Control.Monad.Cont.Class (callCC)
109
import Control.Monad.Eff (Eff)
1110
import Control.Monad.Eff.Console (log) as Eff
1211
import Control.Monad.Eff.Exception (EXCEPTION, throwException, error, message, try)
@@ -211,8 +210,7 @@ cancelAll n = do
211210
log ("Cancelled all: " <> show canceled)
212211

213212
delay :: forall eff. Int -> Aff eff Unit
214-
delay n = callCC \cont ->
215-
later' n (cont unit)
213+
delay n = later' n (pure unit)
216214

217215
main :: Eff (console :: CONSOLE, avar :: AVAR, err :: EXCEPTION) Unit
218216
main = do

0 commit comments

Comments
 (0)