conses :: [a] | gconses{|*|} a
generic gconses a :: Bool -> [a]
-derive gconses CONS,UNIT,PAIR,EITHER,OBJECT,FIELD,RECORD,Int,Bool,Char,Real,String,(),{},{!},[],[! ],[ !],[!!]
+derive gconses CONS,UNIT,PAIR,EITHER,OBJECT,FIELD,RECORD,Int,Bool,Char,Real,String,(),{},{!},[],[! ],[ !],[!!],(->)
consIndex{|Char|} c = toInt c
consIndex{|String|} _ = 0
-import StdMisc, StdDebug
-
conses :: [a] | gconses{|*|} a
conses = gconses{|*|} True
gconses{|{}|} _ _ = [{}]
gconses{|{!}|} _ _ = [{!}]
gconses{|()|} _ = [()]
+gconses{|(->)|} _ _ _ = [const undef]
import Data.Tuple
import StdList
from Data.Func import $
+import Data.List
from Text import class Text(join,toUpperCase), instance Text String
derive consIndex BC
Start w
# (io, w) = stdio w
# io = io <<< "#ifndef MTASK_H\n#define MTASK_H\n"
-# io = io <<< join "\n" (map (uncurry toDefine) (zip2 [1..] conses))
+# io = io <<< join "\n" $ zipWith toDefine [1..] conses
# (ok, w) = fclose (io <<< "\n#endif\n") w
| not ok = abort "Couldn't close stdio"
= w