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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:56:54+00:00 2026-06-01T10:56:54+00:00

Given the functions: let doTrue = fun(x) -> true let doFalse = fun(x) ->

  • 0

Given the functions:

let doTrue = fun(x) -> true
let doFalse = fun(x) -> false

I want to reuse the function signature so that i can get

let myFunDefinition = ??? // <-- this is the function signature that i am trying to reuse
let doTrue = myFunDefinition -> true // <-- now i don't have to type fun(x) any more
let doFalse = myFunDefinition -> false

Is it possible to define for reuse a function signature?

  • 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-01T10:56:55+00:00Added an answer on June 1, 2026 at 10:56 am

    Even after the edits, your question doesn’t really make sense to me. First of all, the signature of doTrue and doFalse is 'a -> bool as you have written them, but I don’t think that this is really relevant to your question because I don’t see what it would mean to “reuse” the signature. Instead, it seems like you want some form of text macro that will allow you to type myFunDefinition and have that replaced by the text fun (x). Aside from the fact that your replacement text is longer than the original text, here are a few thoughts:

    • F# doesn’t have text replacement macros, so if that’s the exact feature you want, you’re out of luck.
    • If you want to save typing, you could at least use the more concise formulation let doTrue x = ... instead of let doTrue = fun x -> ...
    • If you actually want doTrue and doFalse to be the application of some other function to true and false, then that is easy:

      let myFunDefinition b = {{some function of b}}
      let doTrue = myFunDefinition true
      let doFalse = myFunDefinition false
      

      In this case, perhaps this is what you’re looking for:

      let myFunDefinition b _ = b
      ...
      

      (?) This just ignores the second argument (which becomes the first argument of doTrue and doFalse because they partially apply myFunDefinition to the first arguments of true or false, respectively).

    • If you instead want some other sort of abstraction, then the other answers make some reasonable guesses as to what that might mean. In general, you will get more helpful answers if you spend more time articulating your question so that it clearly communicates what you are trying to do.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I want to write a function that does the following: Given a
Given a function, let's say atoi, how can I find the header file I
Let's say I define a set of get and set functions for a given
Let's say I call multiple functions on a given page. function getProfile { <mysql
Given the following: #light //any function returning bool * 'a let foo = let
Given a tuple (specifically, a functions varargs), I want to prepend a list containing
Given this function: > function Get-ArrayOfArrays() { (1,2),(3,4) | % { $_ } }
When thinking in a functional mindset, given that functions are supposed to be pure,
I want to export the first image link from given text with PHP. Let's
Given that my class looks like this: class Methods{ function a(){ return 'a'; }

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.