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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:46:08+00:00 2026-05-23T12:46:08+00:00

For [1] : # let make pair int (x:int) (y:int) = x,y ;; val

  • 0

For [1]:

# let make pair int (x:int) (y:int) = x,y ;;
val make_pair_int : int -> int -> int * int = <fun>

How do you read the typing information output? In other languages, I find being able to construct a cogent, English sentence out of the syntax or the printouts to be critical in understanding what’s going on. What’s the sentence for the above OCaml statement?

Could someone diagram out the printout so as to correlate the typing information back into English? Like:

val make_pair_int : int -> int -> int * int = <fun>
      |              |   |  |   |  \_____/  \__/
      |              |   |  |   |     |       ` is a function
      |              |   |  |   |     ` a tuple of integers
      |              |   |  |   `
      |              |   |  `
      |              |   `
      |              `
      ` symbol make_pair_int is bound to
  • 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-23T12:46:09+00:00Added an answer on May 23, 2026 at 12:46 pm

    This is just the curried version of your function. The reading of such a function depends on how comfortable you are with curried notation for functions.

    The gist is to consider that taking two arguments is a completely different notion from taking a pair of arguments in the sense that the pair makes a reference to a specific type constructor (what is hidden under the * and , symbols in your ocaml snippet).

    What do you do if you do not want to make a reference to a pairing (or tupling, if you want an arbitrary array of arguments) construct ? The curried answer to that question is the one that makes use of higher-order functions:

    val make_pair_int : int -> int -> int * int = <fun>
          |              |   |  |   |  \_____/  \__/
          |              |   |  |   |     |       ` and all that is a higher-order function
          |              |   |  |   |     ` a pair of integers
          |              |   |  |   `and returns
          |              |   |  `a function that takes an integer as an argument
          |              |   `and returns
          |              ` something that takes an integer as an argument 
          ` symbol make_pair_int is bound to
    

    With the implicit convention that this curried interpretation (and the notation that comes with it) is the admitted way of thinking of a function taking several arguments, you can just count the number of arrows in the type, and consider those before the last one as “the arguments” of your function.

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

Sidebar

Related Questions

Let's make this very easy. What I want: @array = qw/one two one/; my
One of Googles Let's make the internet faster talks included something about using echo
Is it safe to let users make their own Django templates with a set
In my project I need to write small WYSIWYG editor (just let users make
I see qCopy , and qCopybackward but neither seems to let me make a
If we want in our WPF application to let a user make a SQL
Let's say I want make some of my sources publicly available via my blog
Let's say I wanted to make a python script interface with a site like
Let's imagine I want to make a templated function that returns the first element
Let's say I want to make a little wrapper along the lines of: def

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.