Emil, Felipe,
Thanks. I don't know Type Families, but take the point that
the input can be parameterised with something something other
than a list. i.e. (8 :+: 4 :+: 2 :+: ()) presumably has the
same type as (4 :+: 2 :+: ()).
My intention was to use common list functions on the sublists,
but always then a concat for each level, to return to a flat list.
With that in mind I made the following oddity, which in any case
doesn't compile due to its use of infinite types.
app (f:fs) es = appUp (f:fs) es
where len = genericLength (f:fs)
appUp [] es = appDown es len
appUp (f:fs) es = appUp (map map fs) (f es)
appDown es len = appDown (concat es) (len - 1)
appDown es 0 = es
Henning,
I agree with you, a tree would be much better for this. Thanks.
-Paul