>>> ['a', 'b', 'c'] !! 0 'a' >>> ['a', 'b', 'c'] !! 2 'c' >>> ['a', 'b', 'c'] !! 3 *** Exception: Prelude.!!: index too large >>> ['a', 'b', 'c'] !! (-1) *** Exception: Prelude.!!: negative indexWARNING: This function is partial. You can use atMay instead.
>>> ['a', 'b', 'c'] !? 0 Just 'a' >>> ['a', 'b', 'c'] !? 2 Just 'c' >>> ['a', 'b', 'c'] !? 3 Nothing >>> ['a', 'b', 'c'] !? (-1) NothingThis is the total variant of the partial !! operator. WARNING: This function takes linear time in the index.