
4 Jun
2009
4 Jun
'09
7:54 p.m.
Dan Weston schrieb:
Unless I'm missing something in your description, why not
data Container a = Single a | Many a a [a]
Hi Dan, the above solution would still allow to construct, for instance, Many 5 42 [] :: Container Int The reason why I'm trying to find the design for a data structure in which this would not even be possible is to be able to avoid writing additional "bookkeeping" code into the functions that operate on the structure, ie. the lookups, inserts, delete etc. Günther