[GHC] #11409: Cannot instantiate literals using TypeApplications

#11409: Cannot instantiate literals using TypeApplications -------------------------------------+------------------------------------- Reporter: Feuerbach | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1-rc1 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: -------------------------------------+------------------------------------- {{{ GHCi, version 8.0.1.20160110: http://www.haskell.org/ghc/ :? for help Prelude> :set -XTypeApplications -fprint-explicit-foralls Prelude> :t 42 42 :: forall {a}. Num a => a Prelude> 42 @Int <interactive>:3:1: error: • Cannot not apply expression of type ‘a0’ to a visible type argument ‘Int’ • In the expression: 42 @Int In an equation for ‘it’: it = 42 @Int }}} (Also, "cannot not" looks like a typo.) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11409 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11409: Cannot instantiate literals using TypeApplications -------------------------------------+------------------------------------- Reporter: Feuerbach | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1-rc1 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 monoidal): This is discussed in the type application paper: https://www.seas.upenn.edu/~sweirich/papers/type-app-extended.pdf, B.4. Overloaded numbers. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11409#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11409: Cannot instantiate literals using TypeApplications -------------------------------------+------------------------------------- Reporter: Feuerbach | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1-rc1 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 rwbarton): Also in ticket:5296#comment:17 and following comments. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11409#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11409: Cannot instantiate literals using TypeApplications -------------------------------------+------------------------------------- Reporter: Feuerbach | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1-rc1 Resolution: | Keywords: | TypeApplications 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 simonpj): * owner: => goldfire * keywords: => TypeApplications Comment: It'd also be possible to define {{{ integerLit :: Integer -> forall a. Num a => a integerLit n = fromInteger n }}} arrange that `3` elaborates to `integerLit 3` :: forall a. Num a => a`, and now that will work as expected. This is so simple to do that it might be worth doing, just to avoid documenting the infelicity. After all, Haskell advertises that `3 :: forall a. Num a => a`, so it's annoying if it doesn't behave like that. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11409#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11409: Cannot instantiate literals using TypeApplications -------------------------------------+------------------------------------- Reporter: Feuerbach | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1-rc1 Resolution: | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11352 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by adamgundry): * cc: adamgundry (added) * related: => #11352 Comment: See also #11352, which is about the same issue for the newfangled overloaded labels (and I guess overloaded string and rational literals should be treated similarly). I experimented with something like Simon's suggestion for overloaded labels, and found that error messages got worse, because it was no longer possible to give a `CtOrigin` that mentioned the overloaded label as the source. But perhaps there's a way round that? Alternatively, I suppose we could add a special rule for typechecking a literal applied to a type. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11409#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11409: Cannot instantiate literals using TypeApplications -------------------------------------+------------------------------------- Reporter: Feuerbach | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1-rc1 Resolution: | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11352 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): Replying to [comment:4 adamgundry]:
See also #11352, which is about the same issue for the newfangled overloaded labels (and I guess overloaded string and rational literals should be treated similarly).
I experimented with something like Simon's suggestion for overloaded labels, and found that error messages got worse, because it was no longer
OK, so that makes it more worth thinking about. possible to give a `CtOrigin` that mentioned the overloaded label as the source. I don't understand why. * We continue to have a case in the type checker for integer literals, as now. * It elaborates the literal to `integerLit 3` with type `forall a. Num a => a` When we instantiate that type (which is delayed in the new `TypeApplication` world) we need a suitable `CtOrigin`. We get that using `exprCtOrigin` (see `TcExpr.tcApp`). It can produce a suitable origin for an integer literal, string -- or field label. So it seems ok to me. Worth a try? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11409#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

An integer literal `368` means "`fromInteger (368::Integer)`", rather
#11409: Cannot instantiate literals using TypeApplications -------------------------------------+------------------------------------- Reporter: Feuerbach | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1-rc1 Resolution: | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11352 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by adamgundry): I think you're right: my problems before arose because I was replacing the overloaded label with the function application in the typechecker, rather than preserving it until the desugarer. Hence `exprCtOrigin` saw the wrong thing. On another topic, what about `RebindableSyntax`? At the moment we have (according to the manual): than "`Prelude.fromInteger (368::Integer)`". -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11409#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11409: Cannot instantiate literals using TypeApplications -------------------------------------+------------------------------------- Reporter: Feuerbach | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1-rc1 Resolution: | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11352 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by goldfire): I want to note that the Haskell Report says that `3` desugars to `fromInteger THREE`. Perhaps we can indeed hack around this by using `integerLit`. But then turning on `RebindableSyntax` would necessitate using `fromInteger`, which (due to its membership in the `Num` class), must have type `forall a. Num a => Integer -> a`, where the `forall a` just comes too early. This would mean that `3 @Int` would work with `-XNoRebindableSyntax` but then fail with `-XRebindableSyntax` (when importing `Prelude`). It would all be rather unexpected. Worse than the status quo? I don't know. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11409#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11409: Cannot instantiate literals using TypeApplications -------------------------------------+------------------------------------- Reporter: Feuerbach | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1-rc1 Resolution: | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11352 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): I don't think it'd be too bad if GHC's implementation desugared `3` to `integerLit THREE` always. For Haskell 98 or 2010, the behaviour would be indistinguishable from the report. But it'd work with `TypeApplications` too which is a real advantage. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11409#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11409: Cannot instantiate literals using TypeApplications -------------------------------------+------------------------------------- Reporter: Feuerbach | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1-rc1 Resolution: | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11352 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by goldfire): What about with `RebindableSyntax`? Changing that behavior would likely break quite a bit of code. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11409#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11409: Cannot instantiate literals using TypeApplications -------------------------------------+------------------------------------- Reporter: Feuerbach | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1-rc1 Resolution: | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11352 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): Yurgh. Maybe with `RebindableSyntax` we stick with `fromInteger`. Or maybe it's a breaking change. Maybe we should do nothing until someone really says it's important to them. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11409#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11409: Cannot instantiate literals using TypeApplications
-------------------------------------+-------------------------------------
Reporter: Feuerbach | Owner: goldfire
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.0.1-rc1
Resolution: | Keywords:
| TypeApplications
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: #11352 | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Richard Eisenberg

#11409: Cannot instantiate literals using TypeApplications -------------------------------------+------------------------------------- Reporter: Feuerbach | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1-rc1 Resolution: | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11352 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by goldfire): Do please merge the typo fix above. Thanks! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11409#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11409: Cannot instantiate literals using TypeApplications -------------------------------------+------------------------------------- Reporter: Feuerbach | Owner: goldfire Type: bug | Status: closed Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 8.0.1-rc1 Resolution: fixed | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11352 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => closed * resolution: => fixed * milestone: => 8.0.1 Comment: Cherry-picked to `ghc-8.0` as b7af30f79f7e3be105cdd17ee3369a5e483f7f3f. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11409#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11409: Cannot instantiate literals using TypeApplications -------------------------------------+------------------------------------- Reporter: Feuerbach | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 8.0.1-rc1 Resolution: | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11352 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by goldfire): * status: closed => new * owner: goldfire => * resolution: fixed => Comment: Thanks for merging the typo fix. But that's nowhere near the nub of this ticket. We might well decide to do nothing, but I'm not convinced we've converged on that solution yet. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11409#comment:14 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11409: Cannot instantiate literals using TypeApplications -------------------------------------+------------------------------------- Reporter: Feuerbach | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1-rc1 Resolution: | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11352 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by thoughtpolice): * milestone: 8.0.1 => 8.2.1 Comment: Replying to [comment:14 goldfire]:
Thanks for merging the typo fix. But that's nowhere near the nub of this ticket. We might well decide to do nothing, but I'm not convinced we've converged on that solution yet.
Agreed - in the mean time, let's put this to 8.2.1 since we're probably not going to introduce any large changes for 8.x. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11409#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11409: Cannot instantiate literals using TypeApplications -------------------------------------+------------------------------------- Reporter: Feuerbach | Owner: Type: feature request | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1-rc1 Resolution: | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11352 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by rwbarton): * type: bug => feature request -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11409#comment:16 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11409: Cannot instantiate literals using TypeApplications -------------------------------------+------------------------------------- Reporter: Feuerbach | Owner: Type: feature request | Status: new Priority: normal | Milestone: 8.4.1 Component: Compiler | Version: 8.0.1-rc1 Resolution: | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11352 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * milestone: 8.2.1 => 8.4.1 Comment: This won't be happening for 8.2. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11409#comment:17 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11409: Cannot instantiate literals using TypeApplications -------------------------------------+------------------------------------- Reporter: Feuerbach | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 8.4.1 Component: Compiler | Version: 8.0.1-rc1 Resolution: | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11352 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by Iceland_jack: Old description:
{{{ GHCi, version 8.0.1.20160110: http://www.haskell.org/ghc/ :? for help Prelude> :set -XTypeApplications -fprint-explicit-foralls Prelude> :t 42 42 :: forall {a}. Num a => a Prelude> 42 @Int
<interactive>:3:1: error: • Cannot not apply expression of type ‘a0’ to a visible type argument ‘Int’ • In the expression: 42 @Int In an equation for ‘it’: it = 42 @Int }}}
(Also, "cannot not" looks like a typo.)
New description: Relevant [https://www.reddit.com/r/haskell/comments/60seia/type_application_on_literal... reddit post]. ---- {{{ GHCi, version 8.0.1.20160110: http://www.haskell.org/ghc/ :? for help Prelude> :set -XTypeApplications -fprint-explicit-foralls Prelude> :t 42 42 :: forall {a}. Num a => a Prelude> 42 @Int <interactive>:3:1: error: • Cannot not apply expression of type ‘a0’ to a visible type argument ‘Int’ • In the expression: 42 @Int In an equation for ‘it’: it = 42 @Int }}} (Also, "cannot not" looks like a typo.) -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11409#comment:18 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11409: Cannot instantiate literals using TypeApplications -------------------------------------+------------------------------------- Reporter: Feuerbach | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 8.4.1 Component: Compiler | Version: 8.0.1-rc1 Resolution: | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11352 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by int-index): I think the correct way forward here is changing how `-XTypeApplications` works with partially applied functions. If I can write `fromInteger @t n`, shouldn't `fromInteger n @t` behave the same? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11409#comment:19 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11409: Cannot instantiate literals using TypeApplications -------------------------------------+------------------------------------- Reporter: Feuerbach | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 8.4.1 Component: Compiler | Version: 8.0.1-rc1 Resolution: | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11352 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by int-index): * cc: int-index (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11409#comment:20 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11409: Cannot instantiate literals using TypeApplications -------------------------------------+------------------------------------- Reporter: Feuerbach | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 8.4.1 Component: Compiler | Version: 8.0.1-rc1 Resolution: | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11352 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by dfeuer): * cc: dfeuer (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11409#comment:21 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11409: Cannot instantiate literals using TypeApplications -------------------------------------+------------------------------------- Reporter: Feuerbach | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 8.4.1 Component: Compiler | Version: 8.0.1-rc1 Resolution: | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11352 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by rwbarton): `f n @t` can already be valid and different from `f @t n` though. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11409#comment:22 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11409: Cannot instantiate literals using TypeApplications -------------------------------------+------------------------------------- Reporter: Feuerbach | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 8.4.1 Component: Compiler | Version: 8.0.1-rc1 Resolution: | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11352 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by goldfire): The question always is: what type variable is being instantiated? Perhaps `f` has the type `forall a. a -> forall b. b -> (a, b)`. Then `f @t n` will be different from `f t @n`. And, as Stephanie and I describe in [http://cs.brynmawr.edu/~rae/papers/2016/type-app/visible-type-app.pdf our paper], there doesn't seem to be a way to add in extra flexibility. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11409#comment:23 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11409: Cannot instantiate literals using TypeApplications -------------------------------------+------------------------------------- Reporter: Feuerbach | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 8.4.1 Component: Compiler | Version: 8.0.1-rc1 Resolution: | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11352 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Iceland_jack): Mentioned in [https://www.reddit.com/r/haskell/comments/6k86je/constraint_unions_bringing_or_to_the_language_of/djkmdbi/?utm_content=permalink&utm_medium=front&utm_source=reddit&utm_name=haskell reddit comment]
I keep being surprised/disappointed that I can't do `5 @Int` and have to do `(5 :: Int)` instead.
-- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11409#comment:24 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11409: Cannot instantiate literals using TypeApplications -------------------------------------+------------------------------------- Reporter: Feuerbach | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 8.4.1 Component: Compiler | Version: 8.0.1-rc1 Resolution: | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11352 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by adamgundry): Rather than defining `integerLit`, perhaps we should just treat a type application to an overloaded literal specially, and say that `5 @Int` desugars to `fromInteger @Int 5`? This would work with `RebindableSyntax` just fine. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11409#comment:25 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11409: Cannot instantiate literals using TypeApplications -------------------------------------+------------------------------------- Reporter: Feuerbach | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 8.4.1 Component: Compiler | Version: 8.0.1-rc1 Resolution: | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11352 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Iceland_jack): That sounds good Adam -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11409#comment:26 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11409: Cannot instantiate literals using TypeApplications -------------------------------------+------------------------------------- Reporter: Feuerbach | Owner: (none) Type: feature request | Status: patch Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.0.1-rc1 Resolution: | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11352 | Differential Rev(s): Phab:D4626 Wiki Page: | -------------------------------------+------------------------------------- Changes (by isovector): * status: new => patch * differential: => Phab:D4626 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11409#comment:28 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11409: Cannot instantiate literals using TypeApplications -------------------------------------+------------------------------------- Reporter: Feuerbach | Owner: (none) Type: feature request | Status: patch Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.0.1-rc1 Resolution: | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11352 | Differential Rev(s): Phab:D4626 Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): Sandy Maguire (isovector) has authored * [A GHC proposal] describing the proposed change * [Phab:D4626] as a draft implementation patch Next steps: community feedback on the above proposal -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11409#comment:29 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

Sandy Maguire (isovector) has authored
* [https://github.com/ghc-proposals/ghc-proposals/pull/129 A GHC
#11409: Cannot instantiate literals using TypeApplications -------------------------------------+------------------------------------- Reporter: Feuerbach | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.0.1-rc1 Resolution: | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11352 | Differential Rev(s): Phab:D4626 Wiki Page: | -------------------------------------+------------------------------------- Changes (by alpmestan): * status: patch => new Comment: Replying to [comment:29 simonpj]: proposal] describing the proposed change
* [Phab:D4626] as a draft implementation patch
Next steps: community feedback on the above proposal
Quoting dfeuer's message from D4626:
The proposal was rejected by the committee, so this will not be merged.
I'm therefore removing the resolution for now. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11409#comment:31 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC