Opened 7 days ago

Closed 6 days ago

#14463 closed feature request (invalid)

Pattern synonym for appliation

Reported by: Iceland_jack Owned by:
Priority: normal Milestone:
Component: Compiler Version: 8.2.1
Keywords: PatternSynonyms Cc: mpickering
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

Does this make sense

pattern f :$ x = f x

where Just :$ False is the same as the pattern Just False.

Change History (2)

comment:1 Changed 7 days ago by RyanGlScott

Does this make sense

It certainly doesn't in my mind. You'd have to allow this sort of pattern:

foo (f x) = ...

To which I can't ascribe any sort of meaningful semantics at the value level.

comment:2 Changed 6 days ago by Iceland_jack

Resolution: invalid
Status: newclosed

Why like this of course

destruct :: Either a a -> (String, a)
destruct (Left  a) = ("Left",  a)
destruct (Right a) = ("Right", a)

pattern (:$) :: String -> a -> Either a a
pattern f :$ x <- (destruct -> (f, x))

;) I agree that the idea is not meaningful, closing

Note: See TracTickets for help on using tickets.