diff options
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 |
commit | 15ac1a816a9875591febcf678bbf914a11e5068f (patch) | |
tree | 695538ac370c6e835cda1b6b17aed454eeafafe3 /hypsrc-test/src/Operators.hs | |
parent | 3b6cbe3ac03d03ea9824770a54868e41d8cf13b6 (diff) |
Add test case for operator hyperlinking.
Diffstat (limited to 'hypsrc-test/src/Operators.hs')
-rw-r--r-- | hypsrc-test/src/Operators.hs | 18 |
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) |