-
Notifications
You must be signed in to change notification settings - Fork 16
Closed
Labels
approvedApproved by CLC voteApproved by CLC votebase-4.19Implemented in base-4.19 (GHC 9.8)Implemented in base-4.19 (GHC 9.8)
Description
MR: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/9511
-- | A total variant of the list index function @('!!')@.
--
-- >>> [2,3,4] !? 1
-- Just 3
-- >>> [2,3,4] !? (-1)
-- Nothing
-- >>> [] !? 0
-- Nothing
--
(!?) :: [a] -> Int -> Maybe a
infixl 9 !?
This operator is reimplemented multiple times on Hackage:
safe
: https://hackage.haskell.org/package/safe/docs/Safe.html#v:atMayextra
: https://hackage.haskell.org/package/extra/docs/Data-List-Extra.html#v:-33--63-relude
: https://hackage.haskell.org/package/relude/docs/Relude-List.html#v:-33--33--63-Agda
: https://hackage.haskell.org/package/Agda/docs/Agda-Utils-List.html#v:-33--33--33-- Also
xmonad-contrib
,ShellCheck
,tidal
, ... https://hoogle.haskell.org/?hoogle=%5Ba%5D+-%3E+Int+-%3E+Maybe+a&scope=set%3Astackage
ulysses4ever, matil019, fishtreesugar, heitor-lassarote, parsonsmatt and 17 moreocramz, unhammer, dnikolovv, madnight, Alex1005a and 2 more
Metadata
Metadata
Assignees
Labels
approvedApproved by CLC voteApproved by CLC votebase-4.19Implemented in base-4.19 (GHC 9.8)Implemented in base-4.19 (GHC 9.8)