Sign up ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

Why is the Scala Option type not called Maybe, just as in Haskell?

Maybe makes a lot more "semantic sense" to me, but maybe Option has different behaviour I am not aware of.

Is there any particular reason why Option in Scala was not called Maybe?

share|improve this question

closed as primarily opinion-based by Robert Harvey, MichaelT, durron597, Kilian Foth, GlenH7 Sep 15 at 14:21

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.

2 Answers 2

up vote 17 down vote accepted

Scala is also inspired by Ocaml, which uses Option.

Options are an Ocaml standard type that can be either None (undefined) or Some x where x can be any value. Options are widely used in Ocaml to represent undefined values (a little like NULL in C, but in a type and memory safe way)...

I think the name chosen is a matter of taste.

share|improve this answer
F# too. The page on Wikipedia is Seems to be a more standard name than Maybe – KChaloux Aug 9 '13 at 14:30
Ocaml gets the name from SML. In a quick glance through Landin's The Next 700 Programming Languages I didn't notice an option type, so SML might be the origin of the name. – Peter Taylor Aug 26 '13 at 10:56

A better question here would be why Haskell's option type is called Maybe. ML's option type is probably the grandaddy of all option types, and it's called option.

In any case, this is a terminological question, so it's not going to have a principled answer. The people who picked the name in Haskell liked it better, that's it.

share|improve this answer
What possessed you to repeat information in a new answer that's already well-covered by the accepted answer and its underlying comments? – Robert Harvey Sep 15 at 1:03
@RobertHarvey ML having set the precedent is new information, the real problem is that the answer is conjecturing even that. – djechlin Sep 15 at 1:04
OK. Do you have a reference, or something more than just an opinion? Because opinions are better represented as comments, not answers. Especially your second paragraph. – Robert Harvey Sep 15 at 1:09
Def. Option: The act of choosing; choice. Def. Perhaps; possibly; An uncertainity; An uncertain reply. For me that is eough to say Maybe is the much better name from a purely linguistic point of view. "Option" implies that there are (multiple) choices, while the monadic name "Maybe" is much more to the point: one thing or nothing. But yes, ML (and hence, Option) came first, so that may be the reason for the bad naming habbit (And see Peter Taylor's comment to the right answer above - he does reference ML). – fnl Sep 15 at 12:25

Not the answer you're looking for? Browse other questions tagged or ask your own question.