[Haskell/en] Explain the !! operator

This commit is contained in:
Spencer Burris 2020-10-15 12:29:37 -07:00
parent 33cd1f57ef
commit aa8d8e408a

View File

@ -61,6 +61,8 @@ not False -- True
-- A string is a list of characters -- A string is a list of characters
['H', 'e', 'l', 'l', 'o'] -- "Hello" ['H', 'e', 'l', 'l', 'o'] -- "Hello"
-- Lists can be indexed with the `!!` operator followed by an index
"This is a string" !! 0 -- 'T' "This is a string" !! 0 -- 'T'