My favorites | Sign in
Project Logo
                
Search
for
Updated Apr 03, 2007 by cdiggins
Labels: Library, CodeExample, Lists
flatten  
Explains the flatten standard library function.

The flatten Library Function

The flatten function converts a list of lists to a list that is the concatenation of all internal lists. If the input list contains any items that are not a list, flatten will fail.

Implementation

define flatten : (list -> list)
{ nil [cat] foldl }

Usage

>> ((1, 2), (3, 4)) flatten
stack: (1, 2, 3, 4)

See Also


Sign in to add a comment
Hosted by Google Code