-module test2
+module test
-Start = 42
+import Data.Func
+import StdEnv, StdGeneric
+
+:: IsR a = IsR Bool | IsROnzin a
+unIsR (IsR b) = b
+generic gIsRecursive a :: [String] -> IsR a
+gIsRecursive{|Int|} _ = IsR False
+gIsRecursive{|UNIT|} _ = IsR False
+gIsRecursive{|EITHER|} l r m = IsR $ unIsR (l m) || unIsR (r m)
+gIsRecursive{|PAIR|} l r m = IsR $ unIsR (l m) || unIsR (r m)
+gIsRecursive{|CONS|} x m = IsR $ unIsR (x m)
+gIsRecursive{|OBJECT of gtd|} x m
+ | isMember gtd.gtd_name m = IsR True
+ = IsR $ unIsR (x m)
+
+derive gIsRecursive []
+
+Start :: IsR [Int]
+Start = gIsRecursive{|*|} []