Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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

1 Answer 1

up vote 15 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
7  
F# too. The page on Wikipedia is en.wikipedia.org/wiki/Option_type. Seems to be a more standard name than Maybe –  KChaloux Aug 9 '13 at 14:30
1  
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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