[GHC] #12649: Allow TypeApplications syntax to be used to instantiate type variables in SPECIALISE pragmas

#12649: Allow TypeApplications syntax to be used to instantiate type variables in SPECIALISE pragmas -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: feature | Status: new request | Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 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: -------------------------------------+------------------------------------- Currently the `SPECIALISE` pragma requires that the user repeat the entire type of a binding to instantiate its types. This is often needlessly verbose and quite tiresome. Instead, why not allow the user to write the desired type as an application with `TypeApplications`? For instance, currently we might write, {{{#!hs foldWithOptionsAndParser :: forall m params. ( MonadIO m, MonadMask m, ToRow params ) => FoldOptions -> RowParser row -> Connection -> Query -> params -> a -> (a -> row -> m a) -> m a foldWithOptionsAndParser opts parser conn template qs a f = ... {-# SPECIALISE foldWithOptionsAndParser :: FoldOptions -> RowParser row -> Connection -> Query -> params -> a -> (a -> row -> IO a) -> IO a #-} }}} Instead we might want to write, {{{#!hs {-# SPECIALISE foldWithOptionsAndParser @IO #-} }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12649 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12649: Allow TypeApplications syntax to be used to instantiate type variables in SPECIALISE pragmas -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 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 goldfire): Ooh. :) +1 But shouldn't this go through ghc-proposals? It's a user-facing feature. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12649#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12649: Allow TypeApplications syntax to be used to instantiate type variables in SPECIALISE pragmas -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 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 bgamari):
But shouldn't this go through ghc-proposals? It's a user-facing feature. Of course, but I just needed someplace to jot down the idea.
-- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12649#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12649: Allow TypeApplications syntax to be used to instantiate type variables in SPECIALISE pragmas -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 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 bgamari): See proposal [https://github.com/ghc-proposals/ghc-proposals/pull/15|PR #15]. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12649#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12649: Allow TypeApplications syntax to be used to instantiate type variables in SPECIALISE pragmas -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 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 Iceland_jack): Replying to [comment:3 bgamari]:
See proposal [https://github.com/ghc-proposals/ghc-proposals/pull/15|PR #15].
Fixed link: [https://github.com/ghc-proposals/ghc-proposals/pull/15 #15]. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12649#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC