Opened 14 months ago

Closed 14 months ago

Last modified 14 months ago

#15456 closed feature request (invalid)

(ImplicitParams) Allow ? in binding patterns

Reported by: Welperooni Owned by:
Priority: normal Milestone: 8.6.1
Component: Compiler Version: 8.4.3
Keywords: ImplicitParams, patterns Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: #13451 Differential Rev(s):
Wiki Page:

Description

This is mostly useful when dealing with ImplicitParams. Suppose "foo" takes an implicit parameter "?msg"

-- Invalid, parse error in pattern ?msg
bar ?msg = foo
\?msg -> foo

-- With -XViewPatterns, same issue
bar ( ... -> ?msg) = foo

Instead, you are forced to create a local let binding

bar msg = let ?msg = msg in foo
\msg -> let ?msg = msg in foo

bar ( ... -> msg) = let ?msg = msg in foo

Change History (3)

comment:1 Changed 14 months ago by Welperooni

Keywords: patterns added

comment:2 Changed 14 months ago by goldfire

Resolution: invalid
Status: newclosed

This is a worthwhile idea to consider, but it should really go via the https://github.com/ghc-proposals/ghc-proposals process, as it's a user-facing language change.

I'm closing this ticket as invalid, but I really do encourage you to post a proposal. That process is working well and has incorporated quite a few changes into the language.

comment:3 Changed 14 months ago by RyanGlScott

Note: See TracTickets for help on using tickets.