summaryrefslogtreecommitdiff
path: root/testsuite/tests/patsyn/should_compile/T14394.script
blob: 208df0ca3606ab6d6ef00076d6d1f7dd10481b21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
:set -XPatternSynonyms -XGADTs -XViewPatterns -XScopedTypeVariables

import Data.Type.Equality

pattern Foo = HRefl

:info Foo

:set -XPolyKinds

pattern Bar = HRefl
-- Expecting no provided (* ~ *) constraint

:info Bar

-- This one generates two Ord a dictionaries
-- but we only need one

data S a where { MkS :: Ord a => a -> S a }

pattern Bam x y <- (MkS (x::a), MkS (y::a))

:info Bam
-- Expecting only one provided Ord constraint