]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.scl.runtime/src-isv/Lists.mediawiki
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.scl.runtime / src-isv / Lists.mediawiki
1 == Working with lists ==\r
2 \r
3 \r
4 \r
5 Note that some of these functions work also for other\r
6 data structures than lists. \r
7 <pre>\r
8 !\r
9 +\r
10 foldl\r
11 foldl1\r
12 map f l        = [f x | x <- l]\r
13 filter p l     = [x | x <- l, p x]\r
14 sum l          = [y | x <- l, y <- x]\r
15 join l         = sum l\r
16 concatMap f l  = [y | x <- l, y <- f x]\r
17 zip l m        = [(x,y) | x <- l | y <- m]\r
18 zipWith f l m  = [f x y | x <- l | y <- m]\r
19 </pre>