Power set: Difference between revisions

m (AppleScript Adjusting names etc to improve readability of relationship to JS and Haskell examples)
Line 244:
end script
end if
end mReturn</lang>
 
-- concat :: [[a]] -> [a] | [String] -> String
on concat(xs)
script append
on lambda(a, b)
a & b
end lambda
end script
if length of xs > 0 and class of (item 1 of xs) is string then
set unit to ""
else
set unit to {}
end if
foldl(append, unit, xs)
end concat</lang>
 
{{Out}}
9,659

edits