Skip to content

Commit c9590ea

Browse files
theTechiehemanth
authored andcommitted
#103: update Applicative Functor example (#104)
1 parent 49a856f commit c9590ea

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

readme.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -535,8 +535,8 @@ This is useful if you have two objects and you want to apply a binary function t
535535

536536
```js
537537
// Arrays that you want to combine
538-
const arg1 = [1, 2];
539-
const arg2 = [3, 4];
538+
const arg1 = [1, 3];
539+
const arg2 = [4, 5];
540540

541541
// combining function - must be curried for this to work
542542
const add = (x) => (y) => x + y;
@@ -547,7 +547,7 @@ const partiallyAppliedAdds = [add].ap(arg1); // [(y) => 1 + y, (y) => 2 + y]
547547
This gives you an array of functions that you can call `ap` on to get the result:
548548

549549
```js
550-
partiallyAppliedAdds.ap(arg2); // [3, 4, 5, 6]
550+
partiallyAppliedAdds.ap(arg2); // [5, 6, 7, 8]
551551
```
552552

553553
## Morphism

0 commit comments

Comments
 (0)