blob: 561f95fd22c12ac726ebb4cc452bc19cdd5a2aa1 (
plain) (
blame)
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
|
{-# LANGUAGE TypeFamilies #-}
module TypeFamilies where
-- | Type family G
type family G a :: *
-- | A class with an associated type
class A a where
-- | An associated type
data B a :: * -> *
-- | A method
f :: B a Int
-- | Doc for family
type family F a
-- | Doc for G Int
type instance G Int = Bool
type instance G Float = Int
instance A Int where
data B Int x = Con x
f = Con 3
g = Con 5
|