packages feed

mvc-updates 1.1.0 → 1.1.1

raw patch · 2 files changed

+14/−4 lines, 2 files

Files

mvc-updates.cabal view
@@ -1,5 +1,5 @@ Name: mvc-updates-Version: 1.1.0+Version: 1.1.1 Cabal-Version: >=1.8.0.2 Build-Type: Simple License: BSD3
src/MVC/Updates.hs view
@@ -181,9 +181,19 @@ > listen (f <> g) = listen g . listen f -} listen :: (a -> IO ()) -> Updatable a -> Updatable a-listen f = transform (\a -> do-    f a-    return a )+listen handler (On (FoldM step begin done) mController) =+    On (FoldM step' begin' done) mController+  where+    begin' = do+        x <- begin+        b <- done x+        handler b+        return x+    step' x a = do+        x' <- step x a+        b  <- done x'+        handler b+        return x' {-# INLINABLE listen #-}  {-| Transform an `Updatable` value using an impure function