When I return something of type Option, it seems useful to explain in the name of the function name that it is an option, not the thing itself. For example, seqs have reduceOption. Is there a standard naming convention? Things I have seen:
maybeFunctionName
functionNameOption
– neither seems to be all that great.
reduceOptionand friends (headOption, etc.) are only named that way to distinguish them from their unsafe alternatives (which arguably shouldn’t exist in the first place—i.e, there should just be aheadthat returns anOption[A]).whateverOptionisn’t the usual practice in the standard library (or most other Scala libraries that I’m aware of), and in general you shouldn’t need or want to use this kind of Hungarian notation in Scala.