You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The generalized type signature for genTwo/link that you came up with in challenge #12 is one of the ones we want to put into our type class, and if you used the type variable ‘m’, you should be able to drop it in. All we need is a name. Let’s use the name bind.
Now that we have part of our type class your task is to create a single unified implementation for generalB2/yLink. Most of it should be the same, but you’ll find that there is one part that is different for the two. Make that part into the second function of the type class. Call this function return. Figure out what the type signature should be. We’ve seen this pattern before in Set 1 and Set 3.
I read that as saying that some function should be written which is a generalized version of generalB2/yLink. That seems to require a generalization of link/genTwo, which would be bind on two different monad instances. But writing those instances is a problem in a later challenge.
If we're not supposed to write those instances here, can the language be more specific about what it is we are supposed to do?
The text was updated successfully, but these errors were encountered:
It's been awhile since I wrote it, but I think that the redundancy was intentional. Part of the premise is that these patterns don't sink in from doing them once. You need to do the same thing several times in different contexts before the pattern becomes clear.
This is the exercise in 4.3:
I read that as saying that some function should be written which is a generalized version of generalB2/yLink. That seems to require a generalization of link/genTwo, which would be
bind
on two different monad instances. But writing those instances is a problem in a later challenge.If we're not supposed to write those instances here, can the language be more specific about what it is we are supposed to do?
The text was updated successfully, but these errors were encountered: