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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:43:28+00:00 2026-06-02T23:43:28+00:00

Assume there is a function called smallerc smallerc :: Integer -> (Integer->Integer) smallerc x

  • 0

Assume there is a function called “smallerc”

    smallerc :: Integer -> (Integer->Integer)
    smallerc x y = if x <=y then x else y

Why not declare the function by using:

    smallerc :: (Integer -> Integer) ->Integer

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-02T23:43:31+00:00Added an answer on June 2, 2026 at 11:43 pm

    The key to understanding currying is to understand that there is no such thing as a function with more than one argument. Every function in haskell has exactly one argument. But because of the right-associative properties of the -> operator, that’s not immediately clear.

    When you see this:

    Integer -> Integer -> Integer
    

    It is equivalent to this:

    Integer -> (Integer -> Integer)
    

    In both cases, the function takes an Integer and returns a function. (The function returned is one that takes an Integer and returns an Integer.) So this might be something like a simple mathematical operation; it takes an Integer (let’s say 5) and returns a function that takes another Integer (5 again) and adds it to the first one, and returns the result (10).

    But when you do this:

    (Integer -> Integer) -> Integer
    

    You’ve created something very different — a function that takes a function and returns an Integer. This could also be a way of implementing a mathematical function; but instead of taking an Integer as the first argument, it takes the mathematical operation itself! So for example, say you pass to this function a function that adds 5 to whatever is passed to it. This function then passes 5 to that function, and returns the result (10).

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

Sidebar

Related Questions

I assume this just returns an int. Is there anything else going on I
I have a vector represented by the slope m. Then there is rectangle (assume
Assume that i have function called PlaceOrder , which when called inserts the order
Assume there is a TFS project Project with the subfolders trunk and 1.0 .
We all know that most applications out there assume class names to follow the
Let's assume at us there is a certain page on a site and when
Assume a situation where a data will never be queried directly. AKA, there will
What have I marked as --assume-unchanged ? Is there any way to find out
Is there any way to make a function call only once? Suppose I have
Example: // assume PDO instance here: $dbh function beginTransaction() { global $dbh; $dbh->beginTransaction(); }

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.