
18 May
2020
18 May
'20
6:29 a.m.
Hi David,
You need to use a view pattern with an explicitly bidirectional pattern synonym:
pattern P :: (Int,Int) -> Foo pattern P xy <- ((\(Foo x y) -> (x, y)) -> xy) where P (x, y) = Foo x y
Great! To maintain backward compatibility of the "network" library, I have created a PR: https://github.com/haskell/network/pull/455 Thank you for your suggestion! --Kazu