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

I'm not particularly wedded to the names. It's just that it would be very 
convenient sometimes to collect data items into e.g. a list or a set, without 
pushing in some klunky foralled insert function.

I see that this is realted to MonadPlus, but the space of possible container 
classes is wider than that of monads e.g. set.

Matthew
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to