@@ -34,7 +34,7 @@ module Asyncly.AsyncT
37−import Control.Applicative (Alternative (..))
37+import Control.Applicative (Alternative (..), liftA2)
38import Control.Concurrent (ThreadId, forkIO, killThread,
38import Control.Concurrent (ThreadId, forkIO, killThread,
39 myThreadId, threadDelay)
39 myThreadId, threadDelay)
40import Control.Concurrent.STM (TBQueue, atomically, newTBQueue,
40import Control.Concurrent.STM (TBQueue, atomically, newTBQueue,
@@ -457,12 +457,15 @@ instance MonadAsync m => MonadPlus (AsyncT m) where
457------------------------------------------------------------------------------
457------------------------------------------------------------------------------
459instance (Num a, Monad (AsyncT m)) => Num (AsyncT m a) where
459instance (Num a, Monad (AsyncT m)) => Num (AsyncT m a) where
460− fromInteger = return . fromInteger
460+ fromInteger n = pure (fromInteger n)
461− mf + mg = (+) <$> mf <*> mg
461+
462− mf * mg = (*) <$> mf <*> mg
462+ negate = fmap negate
463− negate f = f >>= return . negate
463+ abs = fmap abs
464− abs f = f >>= return . abs
464+ signum = fmap signum
465− signum f = f >>= return . signum
465+
467-------------------------------------------------------------------------------
470-------------------------------------------------------------------------------
468-- AsyncT transformer
471-- AsyncT transformer