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

  • Home
  • SEARCH
  • 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 8750071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:48:07+00:00 2026-06-13T12:48:07+00:00

While I know that there is a TypeSynonymInstances extension in GHC, I have no

  • 0

While I know that there is a TypeSynonymInstances extension in GHC, I have no idea how “dangerous” it is and I wonder if this restriction is arbitrary, kind of like the Monomorphism Restriction, or if there are deeper reasons for it.

  • 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-13T12:48:08+00:00Added an answer on June 13, 2026 at 12:48 pm

    TypeSynonymInstances is perfectly safe. Since anything potentially fancy like partially applied type synonyms is disallowed, it has exactly the same effect as typing out the the right hand side of the type synonym in the instance head, i.e.

    type Foo a = ([a], [a])
    instance Bar (Foo a)
    

    is the same as

    instance Bar ([a], [a])
    

    However, note that both instances require FlexibleInstances since they contain nested type constructors as well as repeated type variables. In general, this will often be the case after expanding type synonyms.

    I think may be the reason why they’re disallowed by default.

    However, FlexibleInstances is also a perfectly safe extension. The worst it can do is cause a compile-time error if you try to define overlapping instances such as

    instance Xyzzy String
    instance Xyzzy [a]
    

    As for why FlexibleInstances is not available by default, I can only guess that it’s to simplify the language. The standard rules for instance heads ensures that the only way instance definitions can overlap is if the type constructors in the instance heads are identical, while with FlexibleInstances checking for overlaps is slightly more difficult.

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

Sidebar

Related Questions

I have this Javascript below, and I know that there is probably a better
I have played around with Scala for a while now, and I know that
While I know that there is the possibility: >>> a = abc >>> result
I have a UI design for an application. As we know that there are
I know that there's another post about this but, I've a different error than
I know that there is the restriction to call only __device__ functions in the
I have been researching this problem and while there's lots of posts on various
If you have worked with gui toolkits, you know that there is a event-loop/main-loop
I know that there's a very similar topic for this question, however I'm trying
I know that there are a lot of questions somewhat related to this one,

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.