consName{|Bool|} b = toString b
consName{|Char|} c = toString c
consName{|String|} s = s
+consName{|[]|} _ _ = "[]"
consName{|(->)|} f g x = g (x undef)
generic consIndex a :: a -> Int
consIndex{|Bool|} b = if b 1 0
consIndex{|Char|} c = toInt c
consIndex{|String|} _ = 0
-
-import StdMisc, StdDebug
+consIndex{|[]|} _ _ = 0
generic conses a :: [a]
-conses{|CONS|} f = map CONS f
+conses{|CONS|} f = [CONS (hd f)]
conses{|UNIT|} = [UNIT]
conses{|PAIR|} f g = []
conses{|EITHER|} f g = map LEFT f ++ map RIGHT g
conses{|{}|} _ = [{}]
conses{|{!}|} _ = [{!}]
conses{|()|} = [()]
+conses{|(->)|} _ _ = [const undef]