Permalink
Browse files

Rename perform to unsafePerform

  • Loading branch information...
1 parent 90139e6 commit 5577348b2520aca1c0f44bb30fbe74fd20a671db @snoyberg committed Jan 16, 2014
Showing with 7 additions and 7 deletions.
  1. +7 −7 conduit/Data/Conduit/Util.hs
View
14 conduit/Data/Conduit/Util.hs
@@ -119,8 +119,8 @@ conduitSwapBase =
where
go (Done r) = Done r
go (Leftover p i) = Leftover (go p) i
- go (HaveOutput p f o) = HaveOutput (go p) (perform f) o
- go (PipeM mp) = PipeM $ liftM go $ perform mp
+ go (HaveOutput p f o) = HaveOutput (go p) (unsafePerform f) o
+ go (PipeM mp) = PipeM $ liftM go $ unsafePerform mp
go (NeedInput p c) = NeedInput (go . p) (go . c)
-- | A class for all monads which allow their actions to be performed in a
@@ -136,17 +136,17 @@ conduitSwapBase =
--
-- Since 1.0.11
class (Monad orig, Monad final) => Performable orig final | orig -> final where
- perform :: orig a -> final a
+ unsafePerform :: orig a -> final a
instance Monad m => Performable (ST s) m where
- perform = return . unsafePerformIO . unsafeSTToIO
+ unsafePerform = return . unsafePerformIO . unsafeSTToIO
instance Monad m => Performable Identity m where
- perform = return . runIdentity
+ unsafePerform = return . runIdentity
instance MonadIO m => Performable IO m where
- perform = liftIO
+ unsafePerform = liftIO
instance (MonadTransControl t, Performable orig final, Monad (t final), Monad (t orig))
=> Performable (t orig) (t final) where
- perform orig = liftWith (\run -> perform $ run orig) >>= restoreT . return
+ unsafePerform orig = liftWith (\run -> unsafePerform $ run orig) >>= restoreT . return

0 comments on commit 5577348

Please sign in to comment.