File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -151,9 +151,7 @@ ifM :: forall a m. Bind m => m Boolean -> m a -> m a -> m a
151151ifM cond t f = cond >>= \cond' -> if cond' then t else f
152152
153153-- | Similar to `ifM` but for use in cases where one of the monadic actions may
154- -- | be expensive to compute. As PureScript is not lazy, the standard `ifM` has
155- -- | to construct both monadic actions before returning the result, whereas here
156- -- | only the corresponding monadic action is constructed.
154+ -- | be expensive to construct.
157155-- |
158156-- | ```purescript
159157-- | main :: Effect Unit
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ whenM mb m = ifM mb m $ pure unit
6565-- | Perform a monadic action lazily when a condition is true, where the conditional
6666-- | value is also in a monadic context.
6767whenM' :: forall m a . Monad m => (a -> m Boolean ) -> (a -> m Unit ) -> a -> m Unit
68- whenM' mb m = ifM' mb m $ \_ -> pure unit
68+ whenM' mb m = ifM' mb m \_ -> pure unit
6969
7070-- | Perform a monadic action unless a condition is true, where the conditional
7171-- | value is also in a monadic context.
@@ -75,7 +75,7 @@ unlessM mb = whenM $ not <$> mb
7575-- | Perform a monadic action lazily unless a condition is true, where the conditional
7676-- | value is also in a monadic context.
7777unlessM' :: forall m a . Monad m => (a -> m Boolean ) -> (a -> m Unit ) -> a -> m Unit
78- unlessM' mb = whenM' $ \x -> mb x >>= not >>> pure
78+ unlessM' mb = whenM' \x -> mb x >>= not >>> pure
7979
8080-- | `ap` provides a default implementation of `(<*>)` for any `Monad`, without
8181-- | using `(<*>)` as provided by the `Apply`-`Monad` superclass relationship.
You can’t perform that action at this time.
0 commit comments