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 8549051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:38:13+00:00 2026-06-11T13:38:13+00:00

For example if I defined F x y as a currying function and in

  • 0

For example if I defined F x y as a currying function and in an environment the partial function (F x) is used a lot, should i always let binding it to a named function in terms of performance? (say, compared to cached a property of an object, as it is often unnecessary to cache the property such as Array.Length)

 let Gofrom (board: int[][]) (color: int) (reelID, reelPosition) (direction: Direction) =
    let rec walkfrom x =
        match direction.Target x with
        | (a, _ | _, a) when a = -1 || a = board.Length -> x
        | a, b when board.[a].[b]= color -> walkfrom (a, b)
        | _ -> x
    walkfrom (reelID, reelPosition)

v.s.

 let rec Gofrom (board: int[][]) (color: int) (reelID, reelPosition) (direction: Direction) =
        match direction.Target (reelID, reelPosition) with
        | (a, _ | _, a) when a = -1 || a = board.Length -> (reelID, reelPosition)
        | a, b when board.[a].[b]= color -> Gofrom board color (a, b) direction
        | _ -> (reelID, reelPosition)
  • 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-11T13:38:14+00:00Added an answer on June 11, 2026 at 1:38 pm

    There should be no difference in performance, but I would definitely use the first form since it makes clear which args do not change between invocations.

    Incidentally, this isn’t really about currying as you’re refactoring code into a separate function (closure) to avoid passing args around.

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

Sidebar

Related Questions

I have a complexType defined in targetNameSpace as say http://xyz.example.com and used in many
I have defined a default binding in my style. For example I have configured
Let there be class Example defined as: class Example def initialize(test='hey') self.class.send(:define_method, :say_hello, lambda
for example this function f defined like this : int f(int x){return x;} as
For example ObReferenceObjectByName is defined in c , so in c++ should use extern
I have well defined Excel range, let's say A5:I9 for example. I would like
I have a model defined as below: class Example(models.Model): user = models.ForeignKey(User, null=True) other
Passing User defined argument to RPM is possible while installing?. for example: ~>rpm -i
I have defined a global object in a .js file. For example file1.js contains
I wanted to check whether the variable is defined or not. For example, the

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.