aboutsummaryrefslogtreecommitdiff
path: root/html-test/src/TypeFamilies2.hs
blob: c12113194915d948561046640023c57cc2ee3854 (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
29
30
31
32
33
34
35
36
37
38
39
40
{-# LANGUAGE Haskell2010 #-}
{-# LANGUAGE TypeFamilies #-}
-- This tests what happens if we have unexported types
-- in type instances. The expected behaviour is
-- that we get the instance, Y is not linked and
-- Haddock shows a linking warning.
--
-- The other families and instances that are not exported should not
-- show up at all
module TypeFamilies2 (W, Foo, Bar) where

-- | Exported type
data W

-- | Hidden type
data Z

-- | Exported type family
type family Foo a

-- | Should be visible, but with a hidden right hand side
type instance Foo W = Z

-- | Should be hidden
type instance Foo Z = W

-- | Exported data family
data family Bar a

-- | Shown because BarX is still exported despite Z being hidden
data instance Bar W = BarX Z

-- | Should be completely invisible, including instances
type family Invisible a
type instance Invisible W = Z
type instance Invisible Z = W

data family Invisible2 a
data instance Invisible2 W = Invis  Z
data instance Invisible2 Z = Invis' W