d349f1be45693d7908244081781c3408839b5df1
[clean-tests.git] / test2.icl
1 module test
2
3 import Data.Func
4 import StdEnv, StdGeneric
5
6 :: IsR a = IsR Bool | IsROnzin a
7 unIsR (IsR b) = b
8 generic gIsRecursive a :: [String] -> IsR a
9 gIsRecursive{|Int|} _ = IsR False
10 gIsRecursive{|UNIT|} _ = IsR False
11 gIsRecursive{|EITHER|} l r m = IsR $ unIsR (l m) || unIsR (r m)
12 gIsRecursive{|PAIR|} l r m = IsR $ unIsR (l m) || unIsR (r m)
13 gIsRecursive{|CONS|} x m = IsR $ unIsR (x m)
14 gIsRecursive{|OBJECT of gtd|} x m
15 | isMember gtd.gtd_name m = IsR True
16 = IsR $ unIsR (x m)
17
18 derive gIsRecursive []
19
20 Start :: IsR [Int]
21 Start = gIsRecursive{|*|} []