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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:09:12+00:00 2026-05-26T22:09:12+00:00

This is probably something simple, but I have a .fs file with a simple

  • 0

This is probably something simple, but I have a .fs file with a simple sample function.

let printHello = printfn "%A" "Hello"

I have set the search path to the .fs file using

>#I "PathToMyFSFile"

I have loaded my file using

>#load "Test.fs"

Which worked fine. Now I want to call the function which actually prints the hello to screen, but thats turning out to be too difficult

> Test.printHello;;
val it : unit = ()

Tried Test.printHello();; as well but doesn’t work. How do I actually make it print “Hello” to screen?

  • 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-26T22:09:12+00:00Added an answer on May 26, 2026 at 10:09 pm

    your current printHello isn’t actually a function. To make it a function you need to do

    let printHello() = printfn "%A" "Hello"
    

    noice the (). Then everything should work.

    EDIT:

    When the compiler sees your definition

    let printHello = printfn "%A" "Hello"
    

    it passes it as a simple data term. For example, consider this program:

    let printHello = printfn "%A" "Hello"
    printfn "World"
    printHello
    

    This will print "Hello" then "World". printHello just has unit type, so does nothing. Compare it to

    let printHello() = printfn "%A" "Hello"
    printfn "World"
    printHello()
    

    Here printHello is a function. In this case, the function is only executed when it is explicitly called, so this prints "World" then "Hello".

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

Sidebar

Related Questions

This is probably something really simple but I cant see what! Any images I
Okay, I'm probably missing something really simple here, but I've been at this for
This is probably a simple question, but it's driving me crazy! I have a
This is probably something extremely simple but I can't get my head around it
I think this is probably something simple, but after an hour of searching, I've
This is probably something really simple that I am blind to see, but the
This is probably something really simple, however I am quite new to PHP, and
This is probably something silly I'm missing but I'm definitely lost. I'm using .NET
I get the feeling this is probably something I should know but I can't
I'm probably doing something realy stupid but I cant get this to work: var

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.