From: Mart Lubbers Date: Sat, 12 Sep 2015 12:13:26 +0000 (+0200) Subject: no spam in the repo X-Git-Tag: assignment2~1 X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=91862a194e0d360ffae7d0564b69fc10bc5f6b9a;p=ap2015.git no spam in the repo --- diff --git a/W/examples/StdEnv.wdef b/W/examples/StdEnv.wdef deleted file mode 100755 index 8e1070d..0000000 --- a/W/examples/StdEnv.wdef +++ /dev/null @@ -1,76 +0,0 @@ -># StdEnv.wdef - # - # builtin operator definitions - #< - -prototype op prefix ~ a b : a -> b -overload op prefix ~ N Z -overload op prefix ~ Z Z -overload op prefix ~ R R - -prototype op prefix ! a : a -> B - -prototype op infix AND a : a a -> a -overload op infix AND N -overload op infix AND Z - -prototype op infix OR a : a a -> a -overload op infix OR N -overload op infix OR Z - -prototype op infix XOR a : a a -> a -overload op infix XOR N -overload op infix XOR Z - -prototype op infix + a : a a -> a -overload op infix + N -overload op infix + Z -overload op infix + R - -prototype op infix - a : a a -> a -overload op infix - N -overload op infix - Z -overload op infix - R - -prototype op infix * a : a a -> a -overload op infix * N -overload op infix * Z -overload op infix * R - -prototype op infix / a : a a -> a -overload op infix / N -overload op infix / Z -overload op infix / R - -prototype op infix % a : a a -> a -overload op infix % N -overload op infix % Z - -prototype op infix > a : a a -> B -overload op infix > N -overload op infix > Z -overload op infix > R - -prototype op infix < a : a a -> B -overload op infix < N -overload op infix < Z -overload op infix < R - -prototype op infix == a : a a -> B -overload op infix == B -overload op infix == N -overload op infix == Z -overload op infix == R -overload op infix == Char -overload op infix == String - -prototype op infix != a : a a -> B -overload op infix != B -overload op infix != N -overload op infix != Z -overload op infix != R -overload op infix != Char -overload op infix != String - -op infix && : B B -> B -op infix || : B B -> B diff --git a/W/examples/sample.w b/W/examples/sample.w deleted file mode 100755 index 3e24184..0000000 --- a/W/examples/sample.w +++ /dev/null @@ -1,36 +0,0 @@ -># sample.w - # - # sneek preview for the world! - #< - -import StdEnv - -typedef Tree a := Tip | Bin a (Tree a) (Tree a) - -# functions are invoked as 'insert(x, y)' -func insert : a (Tree a) -> (Tree a) -insert(x, Tip) = Bin x Tip Tip -insert(x, Bin y l r) | x < y = Bin y insert(x, l) r - | otherwise = Bin y l insert(x, r) - -# prefix operators work like normal functional functions -op prefix contains : a (Tree a) -> B -contains x Tip = False -contains x (Bin y l r) | x == y = True - | x < y = contains x l - | otherwise = contains x r - -op prefix len : [a] -> N -len [] = 0 -len [_:xs] = 1 + (len xs) - -# currently no way to specify binding strenght -op infix -- : N N -> B --- x y | x < y = True - | otherwise = False - -func max : N N -> N -max(x, y) | x -- y = y - | y -- x = x - | otherwise = y # equals -