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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T15:02:14+00:00 2026-06-16T15:02:14+00:00

This question is taken from an exam. I don’t know how to do that.

  • 0

This question is taken from an exam. I don’t know how to do that. 🙁

Question: Give an example of a haskell or ml function whose type is

( a -> b ) -> ( c -> a ) -> c -> b

How to do that?

  • 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-16T15:02:15+00:00Added an answer on June 16, 2026 at 3:02 pm

    What meaningful function could have the type mystery :: ( a -> b ) -> ( c -> a ) -> c -> b?

    Let’s see, what could

    mystery f g x
    

    be?

    It has three things to work with,

    • one value x of type c,
    • one function g of type c -> a and
    • one function f of type a -> b.

    It shall produce a value of type b.

    The only argument that has anything to do with b is the function f, so the result must be f ???.

    What can be the argument of f here? It must have type a, and the only way to produce a value of that type from the given arguments (ignoring bottoms, undefined, error "foo") is applying g to something, so it must be

    mystery f g x = f (g ??)
    

    But what could g be applied to? That must be a value of type c. Apart from bottoms, the only value of type c that can be constructed from the arguments is x, so

    mystery f g x = f (g x)
    

    must be function composition (or undefined).

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

Sidebar

Related Questions

Well, this is another question taken from this practice exam that was given to
Taken from an answer to this question , as an example, this is a
I have the following piece of code that is taken from a mock exam
This is a quesiton taken from a java exam, How many objects are eligible
This snippet (taken from this question ) compiles fine with g++ (as seen), so
Snippet taken from this question from django.db.models import F ... MyModel.objects.filter(id=...).update(hit_count=F(hit_count)+1) It was suggested
Taken from this question, Question And this site, web site Why would they place
I'm writing this question because one little invisible problem has taken from me hours
This question was taken from Kathy Sierra SCJP 1.6 . How many objects are
This question title is taken from the title of item #23 in Effective C++

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.