[commit: haddock] master: Create test case for hyperlinking @-patterns. (dc2eed5)
git at git.haskell.org
git at git.haskell.org
Wed Jul 8 08:42:10 UTC 2015
Repository : ssh://git@git.haskell.org/haddock
On branch : master
Link : http://git.haskell.org/haddock.git/commitdiff/dc2eed5daa4d01f97a4686352fd17405f4567169
>---------------------------------------------------------------
commit dc2eed5daa4d01f97a4686352fd17405f4567169
Author: Łukasz Hanuszczak <lukasz.hanuszczak at gmail.com>
Date: Wed Jul 1 18:33:44 2015 +0200
Create test case for hyperlinking @-patterns.
>---------------------------------------------------------------
dc2eed5daa4d01f97a4686352fd17405f4567169
hypsrc-test/ref/src/Constructors.html | 298 ++++++++++++++++++++++++++++++++++
hypsrc-test/src/Constructors.hs | 8 +
2 files changed, 306 insertions(+)
diff --git a/hypsrc-test/ref/src/Constructors.html b/hypsrc-test/ref/src/Constructors.html
index 6d6c7c0..96be362 100644
--- a/hypsrc-test/ref/src/Constructors.html
+++ b/hypsrc-test/ref/src/Constructors.html
@@ -529,6 +529,304 @@
>undefined</span
><span class=""
>
+
+
+</span
+ ><span class="hs-identifier"
+ >unnorf'</span
+ ><span class=""
+ > </span
+ ><span class="hs-glyph"
+ >::</span
+ ><span class=""
+ > </span
+ ><a href="Constructors.html#Norf"
+ ><span class="hs-identifier hs-type"
+ >Norf</span
+ ></a
+ ><span class=""
+ > </span
+ ><span class="hs-glyph"
+ >-></span
+ ><span class=""
+ > </span
+ ><span class="hs-identifier hs-type"
+ >Int</span
+ ><span class=""
+ >
+</span
+ ><a name="unnorf%27"
+ ><a href="Constructors.html#unnorf%27"
+ ><span class="hs-identifier"
+ >unnorf'</span
+ ></a
+ ></a
+ ><span class=""
+ > </span
+ ><a name="local-0"
+ ><a href="#local-0"
+ ><span class="hs-identifier"
+ >x</span
+ ></a
+ ></a
+ ><span class="hs-glyph"
+ >@</span
+ ><span class="hs-special"
+ >(</span
+ ><a href="Constructors.html#Norf"
+ ><span class="hs-identifier hs-var"
+ >Norf</span
+ ></a
+ ><span class=""
+ > </span
+ ><span class="hs-special"
+ >(</span
+ ><a name="local-0"
+ ><a href="#local-0"
+ ><span class="hs-identifier"
+ >f1</span
+ ></a
+ ></a
+ ><span class="hs-glyph"
+ >@</span
+ ><span class="hs-special"
+ >(</span
+ ><a href="Constructors.html#Quux"
+ ><span class="hs-identifier hs-var"
+ >Quux</span
+ ></a
+ ><span class=""
+ > </span
+ ><span class="hs-identifier"
+ >_</span
+ ><span class=""
+ > </span
+ ><a name="local-0"
+ ><a href="#local-0"
+ ><span class="hs-identifier"
+ >n</span
+ ></a
+ ></a
+ ><span class="hs-special"
+ >)</span
+ ><span class="hs-special"
+ >,</span
+ ><span class=""
+ > </span
+ ><span class="hs-identifier"
+ >_</span
+ ><span class="hs-special"
+ >,</span
+ ><span class=""
+ > </span
+ ><a name="local-0"
+ ><a href="#local-0"
+ ><span class="hs-identifier"
+ >f2</span
+ ></a
+ ></a
+ ><span class="hs-glyph"
+ >@</span
+ ><span class="hs-special"
+ >(</span
+ ><a href="Constructors.html#Quux"
+ ><span class="hs-identifier hs-var"
+ >Quux</span
+ ></a
+ ><span class=""
+ > </span
+ ><a name="local-0"
+ ><a href="#local-0"
+ ><span class="hs-identifier"
+ >f3</span
+ ></a
+ ></a
+ ><span class=""
+ > </span
+ ><span class="hs-identifier"
+ >_</span
+ ><span class="hs-special"
+ >)</span
+ ><span class="hs-special"
+ >)</span
+ ><span class="hs-special"
+ >)</span
+ ><span class=""
+ > </span
+ ><span class="hs-glyph"
+ >=</span
+ ><span class=""
+ >
+ </span
+ ><a href="#local-0"
+ ><span class="hs-identifier hs-var"
+ >x'</span
+ ></a
+ ><span class=""
+ > </span
+ ><span class="hs-operator hs-var"
+ >+</span
+ ><span class=""
+ > </span
+ ><a href="#local-0"
+ ><span class="hs-identifier hs-var"
+ >n</span
+ ></a
+ ><span class=""
+ > </span
+ ><span class="hs-operator hs-var"
+ >*</span
+ ><span class=""
+ > </span
+ ><a href="Constructors.html#unfoo"
+ ><span class="hs-identifier hs-var"
+ >unfoo</span
+ ></a
+ ><span class=""
+ > </span
+ ><a href="#local-0"
+ ><span class="hs-identifier hs-var"
+ >f1</span
+ ></a
+ ><span class=""
+ > </span
+ ><span class="hs-operator hs-var"
+ >+</span
+ ><span class=""
+ > </span
+ ><a href="#local-0"
+ ><span class="hs-identifier hs-var"
+ >aux</span
+ ></a
+ ><span class=""
+ > </span
+ ><a href="#local-0"
+ ><span class="hs-identifier hs-var"
+ >f3</span
+ ></a
+ ><span class=""
+ >
+ </span
+ ><span class="hs-keyword"
+ >where</span
+ ><span class=""
+ >
+ </span
+ ><a name="local-0"
+ ><a href="#local-0"
+ ><span class="hs-identifier"
+ >aux</span
+ ></a
+ ></a
+ ><span class=""
+ > </span
+ ><a name="local-0"
+ ><a href="#local-0"
+ ><span class="hs-identifier"
+ >fx</span
+ ></a
+ ></a
+ ><span class=""
+ > </span
+ ><span class="hs-glyph"
+ >=</span
+ ><span class=""
+ > </span
+ ><a href="Constructors.html#unfoo"
+ ><span class="hs-identifier hs-var"
+ >unfoo</span
+ ></a
+ ><span class=""
+ > </span
+ ><a href="#local-0"
+ ><span class="hs-identifier hs-var"
+ >f2</span
+ ></a
+ ><span class=""
+ > </span
+ ><span class="hs-operator hs-var"
+ >*</span
+ ><span class=""
+ > </span
+ ><a href="Constructors.html#unfoo"
+ ><span class="hs-identifier hs-var"
+ >unfoo</span
+ ></a
+ ><span class=""
+ > </span
+ ><a href="#local-0"
+ ><span class="hs-identifier hs-var"
+ >fx</span
+ ></a
+ ><span class=""
+ > </span
+ ><span class="hs-operator hs-var"
+ >*</span
+ ><span class=""
+ > </span
+ ><a href="Constructors.html#unfoo"
+ ><span class="hs-identifier hs-var"
+ >unfoo</span
+ ></a
+ ><span class=""
+ > </span
+ ><a href="#local-0"
+ ><span class="hs-identifier hs-var"
+ >f3</span
+ ></a
+ ><span class=""
+ >
+ </span
+ ><a name="local-0"
+ ><a href="#local-0"
+ ><span class="hs-identifier"
+ >x'</span
+ ></a
+ ></a
+ ><span class=""
+ > </span
+ ><span class="hs-glyph"
+ >=</span
+ ><span class=""
+ > </span
+ ><span class="hs-identifier hs-var"
+ >sum</span
+ ><span class=""
+ > </span
+ ><span class="hs-operator hs-var"
+ >.</span
+ ><span class=""
+ > </span
+ ><span class="hs-identifier hs-var"
+ >map</span
+ ><span class=""
+ > </span
+ ><a href="Constructors.html#unfoo"
+ ><span class="hs-identifier hs-var"
+ >unfoo</span
+ ></a
+ ><span class=""
+ > </span
+ ><span class="hs-operator hs-var"
+ >.</span
+ ><span class=""
+ > </span
+ ><a href="Constructors.html#unnorf"
+ ><span class="hs-identifier hs-var"
+ >unnorf</span
+ ></a
+ ><span class=""
+ > </span
+ ><span class="hs-operator hs-var"
+ >$</span
+ ><span class=""
+ > </span
+ ><a href="#local-0"
+ ><span class="hs-identifier hs-var"
+ >x</span
+ ></a
+ ><span class=""
+ >
</span
></pre
></body
diff --git a/hypsrc-test/src/Constructors.hs b/hypsrc-test/src/Constructors.hs
index c52bdc7..8cb4653 100644
--- a/hypsrc-test/src/Constructors.hs
+++ b/hypsrc-test/src/Constructors.hs
@@ -25,3 +25,11 @@ unnorf :: Norf -> [Foo]
unnorf (Norf (Bar, xs, Bar)) = xs
unnorf (Norf (Baz, xs, Baz)) = reverse xs
unnorf _ = undefined
+
+
+unnorf' :: Norf -> Int
+unnorf' x@(Norf (f1@(Quux _ n), _, f2@(Quux f3 _))) =
+ x' + n * unfoo f1 + aux f3
+ where
+ aux fx = unfoo f2 * unfoo fx * unfoo f3
+ x' = sum . map unfoo . unnorf $ x
More information about the ghc-commits
mailing list