--- /dev/null
+># StdEnv.wdef\r
+ #\r
+ # builtin operator definitions\r
+ #<\r
+\r
+prototype op prefix ~ a b : a -> b\r
+overload op prefix ~ N Z\r
+overload op prefix ~ Z Z\r
+overload op prefix ~ R R\r
+\r
+prototype op prefix ! a : a -> B\r
+\r
+prototype op infix AND a : a a -> a\r
+overload op infix AND N\r
+overload op infix AND Z\r
+\r
+prototype op infix OR a : a a -> a\r
+overload op infix OR N\r
+overload op infix OR Z\r
+\r
+prototype op infix XOR a : a a -> a\r
+overload op infix XOR N\r
+overload op infix XOR Z\r
+\r
+prototype op infix + a : a a -> a\r
+overload op infix + N\r
+overload op infix + Z\r
+overload op infix + R\r
+\r
+prototype op infix - a : a a -> a\r
+overload op infix - N\r
+overload op infix - Z\r
+overload op infix - R\r
+\r
+prototype op infix * a : a a -> a\r
+overload op infix * N\r
+overload op infix * Z\r
+overload op infix * R\r
+\r
+prototype op infix / a : a a -> a\r
+overload op infix / N\r
+overload op infix / Z\r
+overload op infix / R\r
+\r
+prototype op infix % a : a a -> a\r
+overload op infix % N\r
+overload op infix % Z\r
+\r
+prototype op infix > a : a a -> B\r
+overload op infix > N\r
+overload op infix > Z\r
+overload op infix > R\r
+\r
+prototype op infix < a : a a -> B\r
+overload op infix < N\r
+overload op infix < Z\r
+overload op infix < R\r
+\r
+prototype op infix == a : a a -> B\r
+overload op infix == B\r
+overload op infix == N\r
+overload op infix == Z\r
+overload op infix == R\r
+overload op infix == Char\r
+overload op infix == String\r
+\r
+prototype op infix != a : a a -> B\r
+overload op infix != B\r
+overload op infix != N\r
+overload op infix != Z\r
+overload op infix != R\r
+overload op infix != Char\r
+overload op infix != String\r
+\r
+op infix && : B B -> B\r
+op infix || : B B -> B\r
--- /dev/null
+># 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
+