[Haskell-cafe] lists of arbitrary depth
johan.tibell at gmail.com
Tue Jul 13 05:06:59 EDT 2010
On Tue, Jul 13, 2010 at 10:58 AM, vadali <shlomivaknin at gmail.com> wrote:
> iam really new to haskell,
> i want to define a function which takes as a parameter a list which can
> contain other lists, eg. [1,[2,3],[4,[5,6]]]
> how would i define a function that can iterate through the items so (in
> iter1 = 1
> iter2 = [2,3]
> iter3 = [4,[5,6]]
> ( can i do that without using the Tree data type?
No, a list contains a homogeneous sequence of values (i.e. a sequence of
values of the same type). If you explain what you're trying to achieve we
might be able to offer you better help.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe