Permutations: Difference between revisions

m
→‎AppleScript Recursive: (concatMap . delete) tidied
(→‎{{header|REXX}}: added/changed whitespace and comments, optimized the function, used templates for the output sections.)
m (→‎AppleScript Recursive: (concatMap . delete) tidied)
Line 476:
 
Recursively, in terms of concatMap and delete:
<lang AppleScript>-- PERMUTATIONS --------------------------------------- PERMUTATIONS -----------------------
 
-- permutations :: [a] -> [[a]]
Line 504:
 
 
-- TEST ------------------------------------------- TEST ---------------------------
on run
Line 512:
 
 
-- GENERIC FUNCTIONS ------------------------------------ GENERIC FUNCTIONS ---------------------
 
-- concatMap :: (a -> [b]) -> [a] -> [b]
Line 525:
return lst
end concatMap
 
 
-- delete :: a -> [a] -> [a]
Line 552 ⟶ 553:
end if
end mReturn
 
 
-- uncons :: [a] -> Maybe (a, [a])
9,659

edits