Flatten a list: Difference between revisions

m
→‎{{header|AppleScript}}: Tidying and comments.
No edit summary
m (→‎{{header|AppleScript}}: Tidying and comments.)
Line 334:
 
 
Or, expressedto make more productive use of the language ("efficiency" is a function of the scripter's time, rather than the machine's) we can express this in terms of a generic '''concatMap''':
{{trans|JavaScript}}
<lang AppleScript>-- flatten :: Tree a -> [a]
Line 345:
end flatten
 
-- TEST -------------------------------------------- TEST ---------------------------
on run
Line 354:
 
 
-- GENERIC FUNCTIONS ------------------------------------- GENERIC FUNCTIONS ---------------------
 
-- concatMap :: (a -> [b]) -> [a] -> [b]
9,659

edits