netwire 1.2.0 → 1.2.1
raw patch · 2 files changed
+9/−11 lines, 2 files
Files
- FRP/NetWire/IO.hs +8/−10
- netwire.cabal +1/−1
FRP/NetWire/IO.hs view
@@ -9,14 +9,15 @@ module FRP.NetWire.IO ( -- * IO Actions execute,- executeOnce++ -- * Generic actions+ liftWire ) where import Control.Exception.Control import Control.Monad import Control.Monad.IO.Control-import FRP.NetWire.Tools import FRP.NetWire.Wire @@ -31,13 +32,10 @@ execute = mkGen $ \_ c -> liftM (, execute) (try c) --- | Executes the IO action in the input signal and inhibits, until it--- succeeds without an exception. Keeps the result forever.+-- | Lift the given monadic computation to a wire. The action is run at+-- every instant. ----- Inhibits until the first result value. No feedback.+-- Never inhibits. Same feedback behaviour as the given computation. -executeOnce :: MonadControlIO m => Wire m (m a) a-executeOnce =- mkGen $ \_ c -> do- mx <- try c- return (mx, either (const executeOnce) constant mx)+liftWire :: Monad m => Wire m (m a) a+liftWire = mkGen $ \_ c -> liftM ((, liftWire) . Right) c
netwire.cabal view
@@ -1,5 +1,5 @@ Name: netwire-Version: 1.2.0+Version: 1.2.1 Category: FRP, Network Synopsis: Arrowized FRP implementation Maintainer: Ertugrul Söylemez <es@ertes.de>