There is a proposal to extend API of vector
with total counterparts for partial functions, which are well-defined only for non-empty vectors. Compare existing
head :: Vector a -> a
last :: Vector a -> a
maximumBy :: (a -> a -> Ordering) -> Vector a -> a
...
with hypothetical
head' :: Vector a -> Maybe a
last' :: Vector a -> Maybe a
maximumBy' :: (a -> a -> Ordering) -> Vector a -> Maybe a
...
The maintainers are in agreement that their preference is to use [mM]aybe
to distinguish partial functions from their total counterparts. Which naming scheme would you prefer?
-
headMaybe
,lastMaybe
,maximumByMaybe
-
maybeHead
,maybeLast
,maybeMaximumBy
0 voters
I’m consciously not linking vector
's issue tracker so that participants here are less primed before they vote.
To be clear: the poll is not officially endorsed by the maintainers, there is no offer or promise to honor vox populi. The only purpose at the moment is to satisfy my curiosity.
I would like to ask Discourse moderators to enforce a strict no offtopic policy in this thread. Please refrain from discussions which are not directly related to the poll question.