Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8351849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T08:46:23+00:00 2026-06-09T08:46:23+00:00

When I return something of type Option , it seems useful to explain in

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T08:46:25+00:00Added an answer on June 9, 2026 at 8:46 am

    reduceOption and 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 a head that returns an Option[A]).

    whateverOption isn’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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have such code: function allValid() { $('input').each(function(index) { if(something) { return false; }
In python I have the following function: def is_a_nice_element(element, parameter): #do something return True
I have a function: char *make_text(void) { char txt[MAXLEN]; //make something return txt; }
Can PHP call a function and don't wait for it to return? So something
My form.html <form id=search-form method=post action=. name=f> <p><label for=id_customer_type>Customer type</label> <select name=customer_type id=id_customer_type> <option
I need to specify, that my member property will return something like dynamic? in
I would like to return a noncopyable object of type Foo from a function.
This sentence b.followees_by_type(biscuit) return something like: => [#<Biscuit _id: 4fdf5aa11d41c829ea000020, _type: Biscuit, created_at: 2012-06-18
I need to make something like: Type CustomType = Type.GetType(instanceName); It always returns null.
I have a PHP file which will return something like <div id=title>Add Us On

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.