Coder Social home page Coder Social logo

ghc-proposals's People

Contributors

adamgundry avatar bgamari avatar cblp avatar nomeata avatar treeowl avatar

ghc-proposals's Issues

More thoughts on #15632: towards a theory of overlaps+FunDeps

I withdrew the 'Instance Apartness Guards' proposal, because it was getting no traction.

But the difficulties it was trying to address haven't gone away. Trac #15632, particularly this proposed rule is highlighting the nastiest of those difficulties.

@spj I have no idea what to do about (overlap + FDs).

The first thing to do is stop thinking about these as two extensions, somewhat orthogonal; instead see that FunDeps rely on overlaps. Because by all the theory these two instance are supposed to be equivalent, and they overlap

class C a b  | a -> b

instance C Int Bool
instance (b ~ Bool) => C Int b

But GHC exhibits different behaviour for them, as Trac #15632 is demonstrating: the direct C Int Bool can be 'fooled'/overridden into delivering C Int Char, if that second instance is

instance (b ~ Char) => C Int b

Then my suggested rules are trying to catch/prevent that: for those two instances, although the head C Int Bool is strictly more specific, the argument positions C Int ... are not more specific (they're the same), so those instances fail on rule B) iii).

This github Issue is for more ruminations.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.