summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghci/scripts/ghci065.hs
blob: eb3a4a98290027de9a4cbdfec1f9ea304dfeed14 (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
--
-- This is a minimal test for :doc command.
--
-- To avoid depending haddock's pretty-printing,
-- this test is constructed with simple text (without markup) only.
--

{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE TypeFamilies #-}
module Test where

-- | This is the haddock comment of a data declaration for Data1.
data Data1 = Val1a | Val1b

data Data2 = Val2a  -- ^ This is the haddock comment of a data value for Val2a
           | Val2b  -- ^ This is the haddock comment of a data value for Val2b

-- | This is the haddock comment of a data declaration for Data3.
newtype Data3 =
  Data3 { getData3 :: Int }

newtype Data4 =
  -- | This is the haddock comment of a data constructor for Data4.
  Data4 { getData4 :: Int }

data DupeFields1 =
  DF1 { dupeField :: Int -- ^ This is the first haddock comment of a duplicate record field.
      }

data DupeFields2 =
  DF2 { dupeField :: Int -- ^ This is the second haddock comment of a duplicate record field.
      }

data DupeFields3 =
  DF3 { dupeField :: Int -- No haddock
      }

-- | This is the haddock comment of a function declaration for func1.
func1 :: Int -> Int -> Int
func1 x y = x + y

-- This is NOT a haddock comment.
func2 :: Int -> Int -> Int
func2 x y = x + y

-- | This is the haddock comment of a function declaration for func3.
-- Here's multiple line comment for func3.
func3 :: Int -> Int -> Int
func3 x y = x + y

-- | This is the haddock comment of a pattern synonym
pattern PatSyn :: Int
pattern PatSyn = 1

-- | This is the haddock comment of a type class
class TyCl a where

-- | This is the haddock comment of a type family
type family TyFam a where
  TyFam Int = Bool