# HG changeset patch # User haftmann # Date 1260782644 -3600 # Node ID 420234017d39640da983f0e66055373b1ebd48db # Parent 05cb31ca48ae7aaa8d931582661175eaa217c77b improved crude deriving_show inference diff -r 05cb31ca48ae -r 420234017d39 src/Tools/Code/code_haskell.ML --- a/src/Tools/Code/code_haskell.ML Mon Dec 14 10:23:25 2009 +0100 +++ b/src/Tools/Code/code_haskell.ML Mon Dec 14 10:24:04 2009 +0100 @@ -330,11 +330,12 @@ fun deriving_show tyco = let fun deriv _ "fun" = false - | deriv tycos tyco = member (op =) tycos tyco orelse - case try (Graph.get_node program) tyco + | deriv tycos tyco = not (tyco = Code_Thingol.fun_tyco) + andalso (member (op =) tycos tyco + orelse case try (Graph.get_node program) tyco of SOME (Code_Thingol.Datatype (_, (_, cs))) => forall (deriv' (tyco :: tycos)) (maps snd cs) - | NONE => true + | NONE => true) and deriv' tycos (tyco `%% tys) = deriv tycos tyco andalso forall (deriv' tycos) tys | deriv' _ (ITyVar _) = true