From ed6c2afda2f21282994bd2f0c798e2dd596367c4 Mon Sep 17 00:00:00 2001 From: Evan Hock Date: Sun, 8 Dec 2024 23:08:49 -0800 Subject: [PATCH] Removed mentions of arrays to reduce confusion between arrays and lists --- haskell.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/haskell.md b/haskell.md index 1e1eb65a..696a82fb 100644 --- a/haskell.md +++ b/haskell.md @@ -66,6 +66,7 @@ True || False -- True ['H', 'e', 'l', 'l', 'o'] -- "Hello" -- Lists can be indexed with the `!!` operator followed by an index +-- Be aware that since lists are linked lists, this is an O(n) operation "This is a string" !! 0 -- 'T' @@ -273,7 +274,7 @@ case args of map (*2) [1..5] -- [2, 4, 6, 8, 10] -- you can make a for function using map -for array func = map func array +for list func = map func list -- and then use it for [0..5] $ \i -> show i