aboutsummaryrefslogtreecommitdiff
path: root/hypsrc-test/src/Operators.hs
blob: bc76c2d39451aebfea0be82cff2f44f8483e1970 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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)