Skip to content

Commit 105a53e

Browse files
Explain concept precisely and then use nested for loop intuition
1 parent a608415 commit 105a53e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Control/Bind.purs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,12 @@ infixr 1 bindFlipped as =<<
6363
instance bindFn :: Bind ((->) r) where
6464
bind m f x = f (m x) x
6565

66-
-- | The `Array` monad works like a nested for loop. Each
67-
-- | `bind`/`>>=` adds another level of nesting in the loop:
66+
-- | The `bind`/`>>=` function for `Array` works by applying a function to
67+
-- | each element in the array, and flattening the results into a single,
68+
-- | new array.
69+
-- |
70+
-- | Array's `bind`/`>>=` works like a nested for loop. Each `bind` adds
71+
-- | another level of nesting in the loop. For example:
6872
-- | ```
6973
-- | foo :: Array Int
7074
-- | foo =

0 commit comments

Comments
 (0)