aboutsummaryrefslogtreecommitdiff
path: root/hypsrc-test/src
diff options
context:
space:
mode:
authorŁukasz Hanuszczak <lukasz.hanuszczak@gmail.com>2015-06-30 20:00:32 +0200
committerŁukasz Hanuszczak <lukasz.hanuszczak@gmail.com>2015-06-30 22:37:50 +0200
commit15ac1a816a9875591febcf678bbf914a11e5068f (patch)
tree695538ac370c6e835cda1b6b17aed454eeafafe3 /hypsrc-test/src
parent3b6cbe3ac03d03ea9824770a54868e41d8cf13b6 (diff)
Add test case for operator hyperlinking.
Diffstat (limited to 'hypsrc-test/src')
-rw-r--r--hypsrc-test/src/Operators.hs18
1 files changed, 18 insertions, 0 deletions
diff --git a/hypsrc-test/src/Operators.hs b/hypsrc-test/src/Operators.hs
new file mode 100644
index 00000000..bc76c2d3
--- /dev/null
+++ b/hypsrc-test/src/Operators.hs
@@ -0,0 +1,18 @@
+module Operators where
+
+
+(+++) :: [a] -> [a] -> [a]
+a +++ b = a ++ b ++ a
+
+($$$) :: [a] -> [a] -> [a]
+a $$$ b = b +++ a
+
+(***) :: [a] -> [a] -> [a]
+(***) a [] = a
+(***) a (_:b) = a +++ (a *** b)
+
+(*/\*) :: [[a]] -> [a] -> [a]
+a */\* b = concatMap (*** b) a
+
+(**/\**) :: [[a]] -> [[a]] -> [[a]]
+a **/\** b = zipWith (*/\*) [a +++ b] (a $$$ b)