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
151
151
ifM cond t f = cond >>= \cond' -> if cond' then t else f
152
152
153
153
-- | 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.
157
155
-- |
158
156
-- | ```purescript
159
157
-- | 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
65
65
-- | Perform a monadic action lazily when a condition is true, where the conditional
66
66
-- | value is also in a monadic context.
67
67
whenM' :: 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
69
69
70
70
-- | Perform a monadic action unless a condition is true, where the conditional
71
71
-- | value is also in a monadic context.
@@ -75,7 +75,7 @@ unlessM mb = whenM $ not <$> mb
75
75
-- | Perform a monadic action lazily unless a condition is true, where the conditional
76
76
-- | value is also in a monadic context.
77
77
unlessM' :: 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
79
79
80
80
-- | `ap` provides a default implementation of `(<*>)` for any `Monad`, without
81
81
-- | using `(<*>)` as provided by the `Apply`-`Monad` superclass relationship.
You can’t perform that action at this time.
0 commit comments