
31 May
2016
31 May
'16
4:38 a.m.
On Sun, May 29, 2016 at 6:12 PM, Ivan Lazar Miljenovic
On 30 May 2016 at 07:21, David Feuer
wrote: Data.Sequence offers
index :: Seq a -> Int -> a
which throws an error if the index is out of range. I'd like to add something like
indexMay :: Seq a -> Int -> Maybe a
+1
(I personally don't like the "May" prefix used for functions like this as I don't find it very readable, but not enough to argue over the colour of the bikeshed ;-)
I too am +1 for the total function, but -1 for the "May" naming scheme. I'd go with "lookup", since that's what (Int)Map does. I'd also be fine with Vector's (!?) if folks really want a symbolic name. (IME this function tends to work better with an alphabetic name, ymmv) -- Live well, ~wren