[Haskell-cafe] Re: Non Empty List?
tonymorris at gmail.com
Thu Jun 4 19:57:26 EDT 2009
I note that you didn't address the suggestion of a zipper.
Günther Schmidt wrote:
> 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.
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe