[Haskell-cafe] tuple and pattern synonym

Kazu Yamamoto (=?iso-2022-jp?B?GyRCOzNLXE9CSScbKEI=?=) kazu at iij.ad.jp
Mon May 18 06:29:34 UTC 2020


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


More information about the Haskell-Cafe mailing list