
22 Jul
2015
22 Jul
'15
11:26 p.m.
Dear Imants,
Thanks. Unfortunately, I am not sure I get it. It seems to me that it
generates a homogeneous list of either nodes with single leaver or
just leaves. Or how would the
['a', ['b', 'c', []], 'd']
input look like, when using your proposed approach?
Ali
On Thu, Jul 23, 2015 at 1:10 AM, Imants Cekusins
how about this:
data Tree a = L a | N [Tree a] deriving Show
l::a -> Tree a l = L
n::a -> Tree a n x = N [L x]
m::(a->Tree a) ->[a]-> Tree a m f list = N $ f <$> list
run it like this: m l [2,3] m n [2,3]
any good? _______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners