[GHC] #14609: Per-instance UndecidableInstances

#14609: Per-instance UndecidableInstances -------------------------------------+------------------------------------- Reporter: ryanreich | Owner: (none) Type: feature | Status: new request | Priority: low | Milestone: Component: Compiler | Version: 8.2.2 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- The LANGUAGE pragma OverlappingInstances is now a per-instance modifier specifying the manner of overlap. Can (or why can't) this also be done for UndecidableInstances? It gives me an icky feeling to put it at the top of a source file when I just want to allow one specific instance to be undecidable. My apologies if this request already exists. It is very difficult to find bugs about UndecidableInstances in particular as opposed merely to those containing code with this pragma, which appear to be numerous. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14609 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14609: Per-instance UndecidableInstances -------------------------------------+------------------------------------- Reporter: ryanreich | Owner: (none) Type: feature request | Status: new Priority: low | Milestone: Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by AntC): Replying to [ticket:14609 ryanreich]:
Can (or why can't) this also be done for UndecidableInstances?
It can and should; and there's almost certainly a proposal somewhere; or a comment on a ticket on (say) overlaps or FunDeps. See also this [https://people.cs.kuleuven.be/~tom.schrijvers/portfolio/haskell2017a.html recent paper] It's a symptom of Functional Dependencies not getting much love recently/perhaps getting phased out in favour of Type Families. And a great deal of nervousness that GHC's implementation of UndecidableInstances is [https://ghc.haskell.org/trac/ghc/ticket/10675#comment:15 bogus] -- which to me argues we should encourage a per-instance pragma, to limit the bogusness. Perhaps we should try to root out the bogusness: [https://github.com/ghc- proposals/ghc-proposals/pull/56 properly] -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14609#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14609: Per-instance UndecidableInstances -------------------------------------+------------------------------------- Reporter: ryanreich | Owner: (none) Type: feature request | Status: new Priority: low | Milestone: Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): I'm all for a per-instance flag, if someone would like to do the leg-work. Not hard, I think. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14609#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14609: Per-instance UndecidableInstances -------------------------------------+------------------------------------- Reporter: ryanreich | Owner: (none) Type: feature request | Status: new Priority: low | Milestone: Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by AntC): Ooh-er. I've just seen that Type Families also use the `UndecidableInstances` flag. https://downloads.haskell.org/~ghc/8.2.2/docs/html/users_guide/glasgow_exts.... #type-family-decidability The whole idea of making the flag per-instance is that we avoid putting a blanket flag on a whole module. So implementing this ticket needs a per- type-family-instance pragma as well as a per-class-instance(?). Then for Closed Type Families: is that a pragma for the whole family decl, or per- equation? yeuch. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14609#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14609: Per-instance UndecidableInstances -------------------------------------+------------------------------------- Reporter: ryanreich | Owner: (none) Type: feature request | Status: new Priority: low | Milestone: Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): Per family decl, I think -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14609#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14609: Per-instance UndecidableInstances -------------------------------------+------------------------------------- Reporter: ryanreich | Owner: (none) Type: feature request | Status: new Priority: low | Milestone: Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by AntC): Replying to [comment:1 AntC]:
Replying to [ticket:14609 ryanreich]:
Can (or why can't) this also be done for UndecidableInstances?
It can and should; and there's almost certainly a proposal somewhere; or a comment on a ticket on (say) overlaps or FunDeps.
Aha! ticket:10675#comment:17 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14609#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC