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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:59:56+00:00 2026-06-02T02:59:56+00:00

What it says in the title. If I write a type signature, is it

  • 0

What it says in the title. If I write a type signature, is it possible to algorithmically generate an expression which has that type signature?

It seems plausible that it might be possible to do this. We already know that if the type is a special-case of a library function’s type signature, Hoogle can find that function algorithmically. On the other hand, many simple problems relating to general expressions are actually unsolvable (e.g., it is impossible to know if two functions do the same thing), so it’s hardly implausible that this is one of them.

It’s probably bad form to ask several questions all at once, but I’d like to know:

  • Can it be done?

  • If so, how?

  • If not, are there any restricted situations where it becomes possible?

  • It’s quite possible for two distinct expressions to have the same type signature. Can you compute all of them? Or even some of them?

  • Does anybody have working code which does this stuff for real?

  • 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-02T02:59:57+00:00Added an answer on June 2, 2026 at 2:59 am

    Djinn does this for a restricted subset of Haskell types, corresponding to a first-order logic. It can’t manage recursive types or types that require recursion to implement, though; so, for instance, it can’t write a term of type (a -> a) -> a (the type of fix), which corresponds to the proposition “if a implies a, then a“, which is clearly false; you can use it to prove anything. Indeed, this is why fix gives rise to ⊥.

    If you do allow fix, then writing a program to give a term of any type is trivial; the program would simply print fix id for every type.

    Djinn is mostly a toy, but it can do some fun things, like deriving the correct Monad instances for Reader and Cont given the types of return and (>>=). You can try it out by installing the djinn package, or using lambdabot, which integrates it as the @djinn command.

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

Sidebar

Related Questions

As title says, i know that new throws an exception which can be caught,
Just as the title says. I want to write a script that behaves differently
Like the title says I need to write a function that will sort a
As the title says, I'm looking for the fastest possible way to write integer
In AutoHotKeys, how do I write an if/then statement that says: ::create:: IF(Window.Title ==
The title says it! I know that Jon Skeet was working on an implementation
Basically, what the title says. I have several properties that combine together to really
As the title says, I want to have a build tool that quite much
As the title says, I need to write a small program to read data
Like the title says, is it possible for a successful WSASend call on a

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.