- pd (TyUList _ _) = ", void *parse_0(uint8_t (*)(void))"
- pd (TyUMaybe _) = ", void *parse_0(uint8_t (*)(void))"
- pd (TyObject gtd _) = concat [", void *parse_" +++ toString i +++ "(uint8_t (*)(void))"\\i<-[0..gtd.gtd_arity-1]]
- pd (TyRecord grd _) = abort "not implemented yet\n"
- pd (TyNewType _ _ _) = abort "not implemented yet\n"
- pd _ = abort "not implemented yet\n"
+ pd (TyBasic s) = ""
+ pd (TyUList _ _) = ", void *parse_0(uint8_t (*get)())"
+ pd (TyUMaybe _) = ", void *parse_0(uint8_t (*get)())"
+ pd (TyObject gtd _) = concat [", void *parse_" +++ toString i +++ "(uint8_t (*)())"\\i<-[0..gtd.gtd_arity-1]]
+ pd (TyRecord grd _) = concat [", void *parse_" +++ toString i +++ "(uint8_t (*)())"\\i<-[0..recordArity grd.grd_type-1]]
+// pd (TyNewType _ _ _) = abort "not implemented yet\n"
+ pd t = abort $ "not implemented yet: " +++ toString t +++ "\n"
+
+ recordArity :: GenType -> Int
+ recordArity (GenTypeCons _) = 0
+ recordArity (GenTypeVar _) = 0
+ recordArity (GenTypeApp _ _) = 0
+ recordArity (GenTypeArrow _ (GenTypeApp _ _)) = 0
+ recordArity (GenTypeArrow l r) = inc $ recordArity r