Skip to content

(ImplicitParams) Allow ? in binding patterns

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
Trac metadata
Trac field Value
Version 8.4.3
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information