diff options
author | Carter Tazio Schonwald <carter.schonwald@gmail.com> | 2020-01-03 16:44:08 -0500 |
---|---|---|
committer | Carter Tazio Schonwald <carter.schonwald@gmail.com> | 2020-01-04 14:55:50 -0500 |
commit | 2ad1a00f467f037cad6896fde25cf23db88ad828 (patch) | |
tree | 46d1f35506b78bf99ce52aba2ef1507357c33416 /libraries/base/GHC/List.hs | |
parent | 5a52899dbc6a6eed6f7c128462488cb0989ebe49 (diff) | |
download | haskell-2ad1a00f467f037cad6896fde25cf23db88ad828.tar.gz |
nuclear debugging
Diffstat (limited to 'libraries/base/GHC/List.hs')
-rw-r--r-- | libraries/base/GHC/List.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libraries/base/GHC/List.hs b/libraries/base/GHC/List.hs index 65fa4f54a5..b7fe05da8b 100644 --- a/libraries/base/GHC/List.hs +++ b/libraries/base/GHC/List.hs @@ -917,10 +917,10 @@ concat = foldr (++) [] -- | List index (subscript) operator, starting from 0. -- It is an instance of the more general 'Data.List.genericIndex', -- which takes an index of any integral type. -(!!) :: [a] -> Int -> a +(!!) :: HasCallStack => [a] -> Int -> a #if defined(USE_REPORT_PRELUDE) -xs !! n | n < 0 = errorWithoutStackTrace "Prelude.!!: negative index" -[] !! _ = errorWithoutStackTrace "Prelude.!!: index too large" +xs !! n | n < 0 = error "Prelude.!!: negative index" +[] !! _ = error "Prelude.!!: index too large" (x:_) !! 0 = x (_:xs) !! n = xs !! (n-1) #else |