Skip to content

Commit bcd5752

Browse files
authored
added suggested exercise (#85)
1 parent 6d5fb94 commit bcd5752

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/Tutorial/Functions2.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,15 @@ traverseEither : Semigroup e
711711
-> Either e (List b)
712712
```
713713

714+
As an optional exercise, you may wish to attempt this yourself first.
715+
You've seen everything you need. Consider:
716+
717+
* semigroups have an append operation `<+> : e -> e -> e` that combines two values into one
718+
* the empty list will succeed vacuously
719+
* if any of the function applications fail, you'll return a consolidation of all of the errors `e`
720+
* if all of the function applications succeed, you'll return a list with all of the results `b`
721+
* if you get it to compile, there are some test functions and variables at the bottom of this section for you to confirm that it's working as intended
722+
714723
Now, in order to follow along, you might want to start your own
715724
Idris source file, load it into a REPL session and adjust the
716725
code as described here. The first thing we'll do, is write a

0 commit comments

Comments
 (0)