Ticket #3342: ViewPatterns.hs

File ViewPatterns.hs, 240 bytes (added by guest, 5 years ago)
Line 
1{-# OPTIONS_GHC -XViewPatterns #-}
2
3module Bug where
4
5data F = FT String [F]
6data G = GX F F | GY
7
8spec :: F -> G
9spec (FT "X"  [t1, t2]) = GX t1 t2
10spec _                  = GY
11
12walk (spec -> GX _ t2) = walk t2
13walk t@(FT _ _)        = t
14