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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:37:17+00:00 2026-06-17T20:37:17+00:00

I am attempting to call the main function of a C file in Haskell

  • 0

I am attempting to call the main function of a C file in Haskell using the foreign function interface.

The main function is declared:

int main(void);

I am unable to figure out what to tell the Haskell function to do with the void type. I am unable to modify the C source code.

Any help is appreciated.

  • 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-17T20:37:19+00:00Added an answer on June 17, 2026 at 8:37 pm

    A function that “takes” void like that in C takes no arguments (this looks like more of a C question than a Haskell question). The type to import it with would just be IO Int.

    (Note that it may not be a good idea to call an actual main function from Haskell via the FFI. But that’s up to you.)

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

Sidebar

Related Questions

I am attempting to call a function but the error I am getting is
I'm attempting to call a function in the ROOT plotting package that accepts three
I'm using ASP.NET and attempting to call a method with a signature of [WebMethod]
I'm attempting to expose a single API call using three different authentication mechanisms: django's
I'm trying to call a draw function using repaint inside a while loop. I'm
I'm attempting to call a nested recursive perl function, but I can't tack the
I'm attempting to build a tree like structure with one main json call that
I am attempting to call an external function from the press of a button
I am attempting to figure the canary value setting and checking mechanism. #include int
I'm attempting to call a stored proc on my local SQL Server (2008 R2)

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.