
6 Feb
2008
6 Feb
'08
9 a.m.
On Wed, 6 Feb 2008, Matthew Pocock wrote:
Hi,
I've been working a lot with maps, sets and lists. While the process of getting things out of them is abstracted by foldable, traversable and friends, the process of building one up is not. Would it be possible to have something like:
class Buildable b where empty :: b a --makes an empty b with elements of type a insert :: a -> b a -> b a --inserts the new element into the buildable
How can this interface be used both for lists and maps? I'm afraid it is difficult to find an interface that fits the needs of many different data structures. Maybe at least a generalized 'unfoldr' is possible.