Difference between revisions of "Talk:How to work on lists"

From HaskellWiki
Jump to navigation Jump to search
m
(No difference)

Revision as of 23:44, 21 January 2007

on the topic of slower operations: it should be noted that filter, map, zip, etc. are only O(n) if the whole list is evaluated. since these are lazy functions any of these will be O(1):

head $ map (+1) [0..]
(filter even [0..])!!5
take 5 $ zip [0..] [5..]

--Johannes Ahlmann 23:44, 21 January 2007 (UTC)