Skip to content

Commit

Permalink
Added a working link for Wadler’s How to replace failure by a list of…
Browse files Browse the repository at this point in the history
… successes
  • Loading branch information
ehamberg committed Jan 8, 2022
1 parent 9c7e6a2 commit 4fc2367
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion typeclassopedia.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ Most of the standard types which are instances of `Functor` are also instances o

`Maybe` can easily be made an instance of `Applicative`; writing such an instance is left as an exercise for the reader.

The list type constructor `[]` can actually be made an instance of `Applicative` in two ways; essentially, it comes down to whether we want to think of lists as ordered collections of elements, or as contexts representing multiple results of a nondeterministic computation (see Wadler’s [How to replace failure by a list of successes](http://www.springerlink.com/content/y7450255v2670167/)).
The list type constructor `[]` can actually be made an instance of `Applicative` in two ways; essentially, it comes down to whether we want to think of lists as ordered collections of elements, or as contexts representing multiple results of a nondeterministic computation (see Wadler’s [How to replace failure by a list of successes](https://rkrishnan.org/files/wadler-1985.pdf)).

Let’s first consider the collection point of view. Since there can only be one instance of a given type class for any particular type, one or both of the list instances of `Applicative` need to be defined for a `newtype` wrapper; as it happens, the nondeterministic computation instance is the default, and the collection instance is defined in terms of a `newtype` called `ZipList`. This instance is:

Expand Down

0 comments on commit 4fc2367

Please sign in to comment.