aboutsummaryrefslogtreecommitdiff
path: root/hypsrc-test/src/Constructors.hs
diff options
context:
space:
mode:
authorŁukasz Hanuszczak <lukasz.hanuszczak@gmail.com>2015-07-01 18:33:44 +0200
committerŁukasz Hanuszczak <lukasz.hanuszczak@gmail.com>2015-07-01 18:33:44 +0200
commitdc2eed5daa4d01f97a4686352fd17405f4567169 (patch)
tree11ec7ebffc5fd76ae8cd21dedc6f49bc0122a28f /hypsrc-test/src/Constructors.hs
parentb91ee2f4f0869d1c1076813019ce858c53738042 (diff)
Create test case for hyperlinking @-patterns.
Diffstat (limited to 'hypsrc-test/src/Constructors.hs')
-rw-r--r--hypsrc-test/src/Constructors.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/hypsrc-test/src/Constructors.hs b/hypsrc-test/src/Constructors.hs
index c52bdc72..8cb46535 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