--- /dev/null
+module skeleton1\r
+\r
+/*\r
+ Course I00032 Advanced Programming 2014\r
+ Skeleton for assignment 1\r
+ Pieter Koopman\r
+*/\r
+\r
+import StdEnv\r
+\r
+/**************** Prelude: *******************************/\r
+// Example types\r
+:: Color = Red | Yellow | Blue\r
+:: Tree a = Tip | Bin a (Tree a) (Tree a) \r
+:: Rose a = Rose a [Rose a]\r
+\r
+// Binary sums and products (in generic prelude)\r
+:: UNIT = UNIT\r
+:: PAIR a b = PAIR a b\r
+:: EITHER a b = LEFT a | RIGHT b\r
+\r
+// Generic type representations\r
+:: RoseG a :== PAIR a [Rose a]\r
+\r
+// Conversions\r
+fromRose :: (Rose a) -> RoseG a\r
+fromRose (Rose a l) = PAIR a l\r
+\r
+// Oerdering\r
+\r
+:: Ordering = Smaller | Equal | Bigger\r
+\r
+class (><) infix 4 a :: !a !a -> Ordering\r
+\r
+instance >< Int where // Standard ordering for Int\r
+ (><) x y\r
+ | x < y = Smaller\r
+ | x > y = Bigger\r
+ | otherwise = Equal\r
+\r
+instance >< Char where // Standard ordering for Char\r
+ (><) x y\r
+ | x < y = Smaller\r
+ | x > y = Bigger\r
+ | otherwise = Equal\r
+\r
+instance >< String where // Standard lexicographical ordering\r
+ (><) x y\r
+ | x < y = Smaller\r
+ | x > y = Bigger\r
+ | otherwise = Equal\r
+\r
+instance >< Bool where // False is smaller than True\r
+ (><) False True = Smaller\r
+ (><) True False = Bigger\r
+ (><) _ _ = Equal\r
+\r
+/**************** End Prelude *************************/\r