Bulk List Operations
Haskell list operations take entire lists as arguments, and return entire lists as results.
Define xs = [1, 2, 3]
Concatenation: xs++xs [1, 2, 3, 1, 2, 3]
Reversal: reverse xs [3, 2, 1]
Result is a new list; xs
is unaffected (no side effects!)
Storage is allocated
and freed automatically.
Föregående bild
Nästa bild
Tillbaka till första bilden
Visa grafisk version