From dec4c6e0f4b2482e9e4e35f4dc82cab29f48e3d6 Mon Sep 17 00:00:00 2001 From: FP10 Uebungsteilnehmer 0726236 Date: Tue, 16 Nov 2010 08:43:06 +0100 Subject: [PATCH] noch was... --- Aufgabe4.hs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/Aufgabe4.hs b/Aufgabe4.hs index 646739c..1ad2016 100755 --- a/Aufgabe4.hs +++ b/Aufgabe4.hs @@ -2,7 +2,7 @@ import Prelude hiding (Ord) import List --Aufg 4.1a -data Tree = Leaf Integer | Node Integer Tree Tree +data Tree = Leaf Integer | Node Integer Tree Tree deriving (Eq,Show) type Layer = [Integer] -- Ord datatype + show + compare @@ -27,7 +27,7 @@ mmerge x y = [x!!index ++ y!!index | index <- [0..(min (length x) (length y))-1] --Aufg 4.1b -data STree = Nil | SNode Integer STree STree deriving Show +data STree = Nil | SNode Integer STree STree deriving (Eq,Show) transform :: Tree -> STree transform t = toStree (sort (undup (concat (writeLayer t BottomUp)))) @@ -51,15 +51,7 @@ instance Show Graph where showsPrec p (Graph(x)) = showString "Graph(" . shows x . showChar ')' -- Aufg 4.2a -data Result = Yes | No | Invalid -instance Show Result where - showsPrec p (Yes) = showString "Yes" - showsPrec p (No) = showString "No" - showsPrec p (Invalid) = showString "Invalid" - -instance Main.Eq Result where - a == b = show a == show b - +data Result = Yes | No | Invalid deriving (Eq,Show) path :: Graph -> Vertex -> Vertex -> Cost -> Result path _ _ _ _ = Invalid -- 2.43.0