Skip to content

Have map/bind be inlined by default on Option/Result etc #6424

@NinoFloris

Description

@NinoFloris

We were having "one of those chats" in FSSF slack about map and bind — and possibly others after consideration — not being inlined on Option/ValueOption/Result etc.

We came to the preliminary conclusion that there seem to be no strong reasons to have these not be marked inline.

AFAIK pros for inlining:

  • They aren't expected to change ever.
  • Helps Release stack traces be more focussed.
  • Helps code to be faster and lower GC pressure.
  • Reduce code bloat (inlining a match vs adding an FSharpFunc type for the binder/mapping etc).

For debug builds the experience may be confusing when you miss those calls in traces and debugging. Having non essential inlining, anything but SRTP, be a compiler switch (maybe already exists?) that's turned off during debug builds could be a decent solution.

Thoughts?

/cc: @dsyme

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions