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

  • SEARCH
  • Home
  • 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 9269579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:09:32+00:00 2026-06-18T15:09:32+00:00

Consider the two examples below: let myList = [0..10] List.map (fun x -> x

  • 0

Consider the two examples below:

let myList = [0..10]
List.map (fun x -> x + 5)
    (List.filter (fun x -> x % 3 = 0) myList)

and

let myList = [0..10]
List.map (fun x -> x + 5) (List.filter (fun x -> x % 3 = 0) myList)

Both examples produce the same result:

val myList : int list = [0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10]
val it : int list = [5; 8; 11; 14]

F# being a white-space sensitive language, is there technically a difference between these two examples?

  • 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-18T15:09:34+00:00Added an answer on June 18, 2026 at 3:09 pm

    I think F# Code Formatting Guidelines is very helpful for you, especially the first section about General rules for indentation.

    Here is a relevant excerpt from the page:

    When you break long lines, the continuation of the line must be indented farther than the enclosing construct. For example, function arguments must be indented farther than the first character of the function name, as shown in the following code.

    let someFunction param1 param2 =
        let result = myFunction1 param1
                         param2
        result * 100
    

    So indentation in the first example helps F# compiler parse your example correctly.

    F# being a white-space sensitive language, is there technically a difference between these two examples?

    No. Two code fragments have the same meaning here; the only difference is readability. I prefer the first one since my eyes don’t have to go to far right to read the whole function.

    Sometimes when a line is too long, you could reorder arguments using pipes and break that line to multiple ones:

    myList
    |> List.filter (fun x -> x % 3 = 0)
    |> List.map (fun x -> x + 5)
    

    UPDATE:

    I took some time to aggregate information from different sources and wrote up a comprehensive guide to F# Formatting Conventions; you might want to look into it.

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

Sidebar

Related Questions

let's consider two views that use the same layout composed of: A left column
consider the two template functions below: template <typename T, typename A> T* create(A i)
Consider these two classes mapped to the same table. One is readonly via mutable=false.
How does EmailProperty differ from StringProperty ? Consider these two examples: # example 1:
Consider the following two code examples: Example 1. public void setValue(int value) { mValue
Consider these two df examples df1=data.frame(names=c('a','b','c'),value=1:3) df2=data.frame(names=c('c','a','b'),value=1:3) so that > df1 names value 1
Searching turns up a simple definition: data hiding. But, consider the following two examples:
Consider following two examples: Example 1: <xs:import namespace=http://example.com/ns schemaLocation=test.xsd/> Example2: <sample:Data Test=true xsi:schemaLocation=http://example.com/test.xsd> How
What is the difference between X[Any] and X[_] ? Let's consider, for example, two
This question has been bothering me for a while now. Let's consider the two

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.