Quantcast
Channel: Naming scheme for total counterparts of head, tail, etc
Browsing latest articles
Browse All 13 View Live

Naming scheme for total counterparts of head, tail, etc

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...

View Article



Naming scheme for total counterparts of head, tail, etc

One thing I asked myself was: how are existing corresponding and established [a] -> Maybe a functions named. Read full topic

View Article

Naming scheme for total counterparts of head, tail, etc

I think it’s standard for unsafe to be a prefix rather than a suffix. It would be kinda weird than to make safe/maybe a suffix. headMaybe also looks as if it was head for Maybe. On the other hand...

View Article

Naming scheme for total counterparts of head, tail, etc

For me I think of readMaybe and readEither as counterparts, and it’s an adjustment to head/last, so having a suffix feels more apt in my head. Read full topic

View Article

Image may be NSFW.
Clik here to view.

Naming scheme for total counterparts of head, tail, etc

effectfully: I think it’s standard for unsafe to be a prefix rather than a suffix. True, but there’s also a third kind of function: lookup with a default, which is both safe and allows the user to...

View Article


Naming scheme for total counterparts of head, tail, etc

Also I have a similar complaint about laziness annotations, though it does not apply much to array libraries: splitting APIs for spine-strict data structures into a .Lazy module where functions do not...

View Article

Naming scheme for total counterparts of head, tail, etc

headMay, lastMay, maximumByMay is the pattern with the most preexisting uses. That isn’t an option in the poll, so I suppose I would go with headMaybe etc. if forced to choose, but consistency with...

View Article

Image may be NSFW.
Clik here to view.

Naming scheme for total counterparts of head, tail, etc

To be honest, I never liked the “May” suffix. “be” is only 2 extra characters and is just as good and more explicit. Why abbreviate half of a word? And if the meaning is from the verb, i.e. “it may...

View Article


Naming scheme for total counterparts of head, tail, etc

To augment the list of precedents, there is the module from the rio package: RIO.List. Their own choices were influenced by base's readMaybe :: String -> Maybe a and bitSizeMaybe :: a -> Maybe...

View Article


Naming scheme for total counterparts of head, tail, etc

The headMay pattern is also used in safe, which I long considered the “standard” library comprehensively attempting to provide such functions: safe: Library of safe (exception free) functions Read...

View Article

Image may be NSFW.
Clik here to view.

Naming scheme for total counterparts of head, tail, etc

Vlix: To be honest, I never liked the “May” suffix. It’s not perfect, but using *Maybe as a suffix collides with names like mapMaybe which aren’t in the same family. *May has the advantage of being...

View Article

Image may be NSFW.
Clik here to view.

Naming scheme for total counterparts of head, tail, etc

rhendric: headMay, lastMay, maximumByMay is the pattern with the most preexisting uses. That isn’t an option in the poll, so I suppose I would go with headMaybe etc. if forced to choose, but...

View Article

Naming scheme for total counterparts of head, tail, etc

A quantitative analysis using data from hackage-search.serokell.io, and then I’ll stop flogging this horse: head last maximumBy *May raw 618 uses in 190 packages 236 uses in 79 packages 30 uses in 11...

View Article

Browsing latest articles
Browse All 13 View Live




Latest Images