blob: fdd79394e250e83aad9328fdcbb2be1e2dcaf293 (
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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
{-# LANGUAGE TypeFamilies, NamedWildCards, PolyKinds #-}
-- All declarations below are accepted when the NamedWildCards extension is not
-- enabled and the identifiers starting with _ are parsed as type variables.
-- They should remain valid when the extension is on.
--
-- See #11098 and comments in #10982
module NamedWildcardsAsTyVars where
type Synonym _a = _a -> _a
data A a _b = ACon a a Int
data B _a b = BCon _a (_a, Bool)
type family C a b where
C _a _b = _a -> _a
type family D a b where
D _a b = _a -> (_a, Int)
data family E a b
data instance E a _b = ECon a (a, Int)
data family F a b
data instance F _a b = FCon _a _a Bool
class G _a where
gfoo :: _a -> _a
instance G Int where
gfoo = (*2)
type family H a b where
H _a _a = Int
H _a _b = Bool
hfoo :: H String String
hfoo = 10
hbar :: H String Int
hbar = False
type family I (_a :: k) where
I _t = Int
|