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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:07:21+00:00 2026-05-11T19:07:21+00:00

I ran into an error similar to this forum post on hubfs, which solved

  • 0

I ran into an error similar to this forum post on hubfs, which solved my problem but spawned off some questions about the code in that thread.

let test x = printfn "n"
let finall x = x : 'a -> unit
let i x = finall test x

Can someone explain to me what line 2 is accomplishing?
I see that the type of finall is

finall: ('a -> unit) -> ('a -> unit)

So its just a function that takes in a function and returns that function.
What would be the reason to do lines 2 and 3?
Can you later define a function body to finall?
it appears that you don’t have to parenthesize the call on the third line, is that a result of line 2?

  • 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-05-11T19:07:21+00:00Added an answer on May 11, 2026 at 7:07 pm

    Yeah, the code on that thread does not make much sense. ‘finall’ is basically the identity function (let id x = x) except that it constrains its argument to be a function-returning-unit rather than some arbitrary value. Basically it doesn’t do anything useful, you could just as easily write

    let test x = printfn "n"
    let i x = test x
    

    I expect that this snippet maybe came from someone who started with an error message they didn’t understand, and tried to strip it down to a tiny sample repro.

    (Regarding function calls, you never need parens to call a let-bound function in F#:

    f x
    

    is a call, and function application works in the normal way to support currying, which means

    f x y
    

    means

    (f x) y
    

    which is what is happening on the ‘finall test x’ line.)

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

Sidebar

Related Questions

Similar to my last question, but I ran into problem lets say I have
I am working on some jquery stuff and ran into this error and I
I'm trying to use WCF Data Service with Subsonic, but ran into this error
I ran into this error when building my code with CLANG: In file included
Recently I ran into this error in my web application: java.lang.OutOfMemoryError: PermGen space It's
I ran into unbound method error in python with this code: import random class
trying to integrate hibernate and spring ,I ran into this error SEVERE: Context initialization
I did rake db:create and then rake db:migrate and ran into this error. rake
Hey guys, just learning about composition of classes and ran into this error. Gradebook.h
I ran into this error and couldn't figure what's missing: {Could not load file

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.