himura / twitter-types

This library treats the Twitter JSON API in the Haskell way.
24 stars 28 forks source link

Users can have a "status" field #20

Open glasserc opened 9 years ago

glasserc commented 9 years ago

Certain Twitter APIs, for example https://dev.twitter.com/rest/reference/get/users/lookup, come with the user's "last status", if you have permission to read it. It would be nice if this "status" were available.

It might make sense to separate the types of User so that /users/lookup returns a UserWithStatus, since some APIs will never have this field available. I can try to implement this if you like.

glasserc commented 9 years ago

In trying to implement this, I discovered that the kind of status that comes with the user is different from a regular kind of status because it doesn't have a "user" field. So there's two kinds of statuses -- those that have a user field, and those that don't (presumably because they're already inside a user).

How can this be implemented, then? I had three ideas:

Are there other, more elegant ways to have this kind of convoluted semi-recursive dependency?