[commit: haddock] master: Add test case for constructor hyperlinking. (95dfb7a)

git at git.haskell.org git at git.haskell.org
Wed Jul 8 08:41:37 UTC 2015


Repository : ssh://git@git.haskell.org/haddock

On branch  : master
Link       : http://git.haskell.org/haddock.git/commitdiff/95dfb7ab280d69d2bc2eb7f9ab0c4c3deae53cc2

>---------------------------------------------------------------

commit 95dfb7ab280d69d2bc2eb7f9ab0c4c3deae53cc2
Author: Łukasz Hanuszczak <lukasz.hanuszczak at gmail.com>
Date:   Tue Jun 30 20:10:08 2015 +0200

    Add test case for constructor hyperlinking.


>---------------------------------------------------------------

95dfb7ab280d69d2bc2eb7f9ab0c4c3deae53cc2
 hypsrc-test/src/Constructors.hs | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/hypsrc-test/src/Constructors.hs b/hypsrc-test/src/Constructors.hs
new file mode 100644
index 0000000..c52bdc7
--- /dev/null
+++ b/hypsrc-test/src/Constructors.hs
@@ -0,0 +1,27 @@
+module Constructors where
+
+
+data Foo
+    = Bar
+    | Baz
+    | Quux Foo Int
+
+newtype Norf = Norf (Foo, [Foo], Foo)
+
+
+bar, baz, quux :: Foo
+bar = Bar
+baz = Baz
+quux = Quux quux 0
+
+
+unfoo :: Foo -> Int
+unfoo Bar = 0
+unfoo Baz = 0
+unfoo (Quux foo n) = 42 * n + unfoo foo
+
+
+unnorf :: Norf -> [Foo]
+unnorf (Norf (Bar, xs, Bar)) = xs
+unnorf (Norf (Baz, xs, Baz)) = reverse xs
+unnorf _ = undefined



More information about the ghc-commits mailing list