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