/**
* Return the kind of the type
*/
-:: Kind = KStar | KArrow Kind Kind
-genTypeKind :: Type -> Kind
+:: Kind = KStar | (KArrow) infixr 1 Kind Kind
+genTypeKind :: GenType -> Kind
/**
* Predicate whether the outer type is a builtin type
genTypeKind :: GenType -> Kind
genTypeKind (GenTypeCons _) = KStar
genTypeKind (GenTypeVar _) = KStar
-genTypeKind (GenTypeArrow l r) = undef
-genTypeKind (GenTypeApp l r) = undef
+genTypeKind (GenTypeArrow l r) = genTypeKind l KArrow genTypeKind r
+genTypeKind (GenTypeApp l r) = genTypeKind l KArrow genTypeKind r
instance isBuiltin String
where
parsedefs = foldr (\t c->parsedef t [";\n":c]) [] o flatten
parsedef :: Type [String] -> [String]
- parsedef t c = ctypename t [" *", parsefun t, "(uint8_t (*get)()",pd t, ")":c]
+ parsedef t c
+ # (pt, _) = trace_stdout (parsefun t, map genTypeKind $ typeGenType t)
+ = ctypename t [" *", /*parsefun */pt, "(uint8_t (*get)()",pd t, ")":c]
where
pd (TyBasic s) = ""
pd (TyUList _ _) = ", void *parse_0(uint8_t (*get)())"