[GHC] #15510: Qualified Holes

#15510: Qualified Holes -------------------------------------+------------------------------------- Reporter: andrewthad | Owner: (none) Type: feature | Status: new request | Priority: low | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 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: -------------------------------------+------------------------------------- Let us consider the following example code: {{{ import qualified Data.Map as M main :: IO () main = print (M._ (\k v acc -> k + v + acc) 0 myMap) myMap :: Map Int Int myMap = ... }}} This errors with `Not in scope: M._`. It would cool if GHC instead treated `M._` as a hole but only gave suggestions from the module `Data.Map`. So, in this case, it would suggest things like `Data.Map.foldrWithKey` and `Data.Map.foldlWithKey`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15510 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15510: Qualified Holes -------------------------------------+------------------------------------- Reporter: andrewthad | Owner: (none) Type: feature request | Status: new Priority: low | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 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 nomeata): Will it stop there, or will we want some form of text-pattern-matching? `M.fold*` to only suggest folds? But more sersiously: While this feature looks maybe a bit obscure (i.e. hard to discover and relatively specialized) it also doesn’t look harmful upon first glance. Maybe write it up as a GHC proposal and attract more discussion there? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15510#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15510: Qualified Holes -------------------------------------+------------------------------------- Reporter: andrewthad | Owner: (none) Type: feature request | Status: new Priority: low | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 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 andrewthad): Definitely no text pattern matching, since that would steal syntax. I'll probably write this up as a proposal in a few weeks. I don't think there is any downside to this, since it replaces an error message and upgrades it to a better error message. It is probably only useful in niche cases though. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15510#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15510: Qualified Holes -------------------------------------+------------------------------------- Reporter: andrewthad | Owner: (none) Type: feature request | Status: new Priority: low | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 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 nomeata): If it only changes error messages it may not need a full proposal process – it does not change what programs are accepted or how they behave. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15510#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15510: Qualified Holes -------------------------------------+------------------------------------- Reporter: andrewthad | Owner: (none) Type: feature request | Status: new Priority: low | Milestone: 8.8.1 Component: Compiler | Version: 8.4.3 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: | -------------------------------------+------------------------------------- Changes (by sgraf): * milestone: 8.6.1 => 8.8.1 Comment: I don't think this will happen in GHC 8.6. Revert if you disagree. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15510#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC