[GHC] #13833: Instances with GHC.TypeLits.Nat/Symbol should be possible without FlexibleInstances.

#13833: Instances with GHC.TypeLits.Nat/Symbol should be possible without FlexibleInstances. -------------------------------------+------------------------------------- Reporter: Hjulle | Owner: (none) Type: bug | Status: new Priority: low | Milestone: Component: Compiler | Version: 8.0.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: -------------------------------------+------------------------------------- Yes I know, `0` and `"B"` are not technically type constructors, but it's as close as you can get for the kinds Nat and Symbol. Test cases: {{{#!hs {-# LANGUAGE DataKinds, KindSignatures #-} import GHC.TypeLits (Nat, Symbol) class A (n::Nat) instance A 0 class B (s::Symbol) instance B "B" }}} Result: {{{ A.hs:6:10: error: • Illegal instance declaration for ‘A 0’ (All instance types must be of the form (T a1 ... an) where a1 ... an are *distinct type variables*, and each type variable appears at most once in the instance head. Use FlexibleInstances if you want to disable this.) • In the instance declaration for ‘A 0’ A.hs:9:10: error: • Illegal instance declaration for ‘B "B"’ (All instance types must be of the form (T a1 ... an) where a1 ... an are *distinct type variables*, and each type variable appears at most once in the instance head. Use FlexibleInstances if you want to disable this.) • In the instance declaration for ‘B "B"’ }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13833 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13833: Instances with GHC.TypeLits.Nat/Symbol should be possible without FlexibleInstances. -------------------------------------+------------------------------------- Reporter: Hjulle | Owner: (none) Type: bug | Status: new Priority: low | Milestone: Component: Compiler | Version: 8.0.2 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * keywords: => newcomer Comment: This should be straightforward to fix: it would just require some tweaking of the [http://git.haskell.org/ghc.git/blob/6a9b9b431dcc94849d14c13639eb2f713e5aa1f4... tcInstHeadTyAppAllTyVars] function to allow something headed by a `LitTy`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13833#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13833: Instances with GHC.TypeLits.Nat/Symbol should be possible without FlexibleInstances. -------------------------------------+------------------------------------- Reporter: Hjulle | Owner: (none) Type: bug | Status: new Priority: low | Milestone: Component: Compiler | Version: 8.0.2 Resolution: | Keywords: newcomer 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): Um, is there anybody using fancy type stuff like `TypeLits`, but not needing `FlexibleInstances`? I know [https://downloads.haskell.org/~ghc/8.4.2/docs/html/users_guide/glasgow_exts.... `-fglasgow-exts`] is deprecated these days, but I always switch on those extensions anyway. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13833#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13833: Instances with GHC.TypeLits.Nat/Symbol should be possible without FlexibleInstances. -------------------------------------+------------------------------------- Reporter: Hjulle | Owner: (none) Type: bug | Status: new Priority: low | Milestone: Component: Compiler | Version: 8.0.2 Resolution: | Keywords: newcomer 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 qrilka): I'd like to try solving this one -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13833#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13833: Instances with GHC.TypeLits.Nat/Symbol should be possible without FlexibleInstances. -------------------------------------+------------------------------------- Reporter: Hjulle | Owner: (none) Type: bug | Status: new Priority: low | Milestone: Component: Compiler | Version: 8.0.2 Resolution: | Keywords: newcomer 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 bgamari): Do let us know if you get stuck, qrilka. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13833#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13833: Instances with GHC.TypeLits.Nat/Symbol should be possible without FlexibleInstances. -------------------------------------+------------------------------------- Reporter: Hjulle | Owner: (none) Type: bug | Status: patch Priority: low | Milestone: Component: Compiler | Version: 8.0.2 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4823 Wiki Page: | -------------------------------------+------------------------------------- Changes (by qrilka): * status: new => patch * cc: qrilka@… (added) * differential: => Phab:D4823 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13833#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13833: Instances with GHC.TypeLits.Nat/Symbol should be possible without FlexibleInstances. -------------------------------------+------------------------------------- Reporter: Hjulle | Owner: (none) Type: bug | Status: patch Priority: low | Milestone: Component: Compiler | Version: 8.0.2 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4823 Wiki Page: | -------------------------------------+------------------------------------- Comment (by qrilka): bgamari, should I do something else about my patch? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13833#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13833: Instances with GHC.TypeLits.Nat/Symbol should be possible without
FlexibleInstances.
-------------------------------------+-------------------------------------
Reporter: Hjulle | Owner: (none)
Type: bug | Status: patch
Priority: low | Milestone:
Component: Compiler | Version: 8.0.2
Resolution: | Keywords: newcomer
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D4823
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#13833: Instances with GHC.TypeLits.Nat/Symbol should be possible without FlexibleInstances. -------------------------------------+------------------------------------- Reporter: Hjulle | Owner: (none) Type: bug | Status: closed Priority: low | Milestone: 8.6.1 Component: Compiler | Version: 8.0.2 Resolution: fixed | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4823 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed * milestone: => 8.6.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13833#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC