File: Foo.hs

package info (click to toggle)
haskell-doctest-parallel 0.3.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 652 kB
  • sloc: haskell: 3,241; makefile: 6; ansic: 4
file content (81 lines) | stat: -rw-r--r-- 1,444 bytes parent folder | download | duplicates (2)
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
-- |
-- Examples in various locations...
--
-- Some random text.  Some random text.  Some random text.  Some random text.
-- Some random text.  Some random text.  Some random text.  Some random text.
-- Some random text.
--
-- >>> let x = 10
--
-- Some random text.  Some random text.  Some random text.  Some random text.
-- Some random text.  Some random text.  Some random text.  Some random text.
-- Some random text.
--
--
--   >>> baz
--   "foobar"

module TestCommentLocation.Foo (
  -- | Some documentation not attached to a particular Haskell entity
  --
  -- >>> test 10
  -- *** Exception: Prelude.undefined
  -- ...
  test,

  -- |
  -- >>> fib 10
  -- 55
  fib,

  -- |
  -- >>> bar
  -- "bar"
  bar,

  foo, baz
  ) where


-- | My test
--
-- >>> test 20
-- *** Exception: Prelude.undefined
-- ...
test :: Integer -> Integer
test = undefined

-- | Note that examples for 'fib' include the two examples below
-- and the one example with ^ syntax after 'fix'
--
-- >>> foo
-- "foo"

{- |
    Example:

     >>> fib 10
     55
-}

-- | Calculate Fibonacci number of given `n`.
fib :: Integer  -- ^ given `n`
                --
                -- >>> fib 10
                -- 55

    -> Integer  -- ^ Fibonacci of given `n`
                --
                -- >>> baz
                -- "foobar"
fib 0 = 0
fib 1 = 1
fib n = fib (n - 1) + fib (n - 2)
-- ^ Example:
--
--   >>> fib 5
--   5

foo = "foo"
bar = "bar"
baz = foo ++ bar