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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:40:01+00:00 2026-06-07T05:40:01+00:00

Why is the type of a plus ( + ) considered to be int

  • 0

Why is the type of a plus ( + ) considered to be int -> int -> int as opposed to (int * int) -> int? To me, the second makes sense because it “accepts” a 2-tuple (the addends) and returns a single int (their sum).

Thank you!

  • 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-07T05:40:02+00:00Added an answer on June 7, 2026 at 5:40 am

    You can make a language where (+) has the type (int * int) -> int. In fact, SML works exactly this way. It just affects the meaning of infix operators. However OCaml conventions strongly favor the use of curried functions (of the type a -> b -> c) rather than uncurried ones. One nice result is that you can partially apply them. For example ((+) 7) is a meaningful expression of type int -> int. I find this notation useful quite often.

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

Sidebar

Related Questions

type(3,) returns the int type, while t = 3, type(t) returns the tuple type.
Parser.h enum { PLUS, MINUS, DIVIDE, MULTIPLY, NUMBER, END } type; int token; /*
In my web-application, i want to create a some-type of calendar plus reminder. For
When we type 'a d' (a space d) the .val returns a+d using a
lookup([(X,A)|_],X,A). lookup([_|L],X,A) :- lookup(L,X,A). hi(_,t,bool). hi(_,f,bool). hi(g,var(X),Y) :- lookup(g,X,Y). hi(_,in(X),int). hi(_,fl(X),real_exp). hi(g,plus(A,B),int) :- hi(g,A,int),hi(g,B,int),!.
This code suffers from overflow because the type of intermediate results does not depend
Are object and array really the only types allowed for type hinting? Plus, they
When I describe an Oracle TYPE in SQL*Plus, what does SQL*Plus do under the
What does this mean @[+][package:]type:name or this @+id/my_id ? What plus does? No detailed
TYPE *a = calloc(nelem, sizeof(TYPE)); It says unable to resolve identifier TYPE. What does

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.