summaryrefslogtreecommitdiff
path: root/testsuite/tests/linear/should_fail/LinearPatSyn.hs
blob: a874d320d0c5bfdd2f695cb67af9f01694376b49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
{-# LANGUAGE LinearTypes #-}
{-# LANGUAGE PatternSynonyms #-}

module LinearPatSyn where

-- Linearity and pattern synonyms should eventually play well together, but it
-- seems to require changes to the desugarer. So currently pattern synonyms are
-- disallowed in linear patterns.

pattern P y x = (x, y)

s :: (a, b) %1 -> (b, a)
s (P y x) = (y, x)