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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:33:17+00:00 2026-05-29T22:33:17+00:00

Yes, I know that UndecidableInstances can be bad. I really tried hard to design

  • 0

Yes, I know that UndecidableInstances can be bad. I really tried hard to design my module so that it doesn’t need it however I have something like this:

instance Foo x (C x y) => Bar (C x y) where

    ...

and changing it would make the API substantially uglier. I never derive Foo out of Bar so there is no way to make a loop.

On the other hand enabling UndecidableInstances makes silly mistakes easy to overlook. For example I could write by mistake something like:

instance Foo x (C x z) => Bar (C x y) where

    ...

where z never appears on the right side.

Question: Is it possible to use UndecidableInstances locally in a module, i.e. explicitly mark places where the usual termination rules are lifted?

Of course it won’t help with termination, but it will make the decision to use this extension more informed.

Question 2: Is there something weaker than UndecidableInstances that still wouldn’t guarantee termination, but would forbid some more border-line cases like the second code snippet?

  • 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-29T22:33:17+00:00Added an answer on May 29, 2026 at 10:33 pm

    So far, language pragmas are per-module, so the answer to the first question is no. As for the second question, I’m not quite sure, but I know of no other extension than UndecidableInstances that would allow the instance.

    However, UndecidableInstances isn’t that bad, it just allows the type checker to attempt to resolve instances where it can’t prove termination. The context-stack prevents it from actually looping forever, though.

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

Sidebar

Related Questions

Yes, I know that the FAQ pretends to answer this, but it doesn't really.
Yes, I know that downcast using dynamic_cast can't compile if the Base is not
(Yes I know I can call Java code from Scala; but that is pointless;
Yes, I know that general forms of this question have been asked time and
I know that I can return YES to support Landscape mode in shouldAutorotateToInterfaceOrientation. But
Yes, I know that in ASP.NET MVC you have to use ViewModels. But I'm
I have a program (an AWT Frame, yes I know that Swing is better
Yes I know that it shouldn't be abused and that C# is primariy used
Is it possible to know that a HTTP request is from Ajax?If yes, how?
Yes, I know, the archive bit is evil. That being said, is there support

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.