addTypes :: Map T.NominalId (Pure # N.NominalDecl T.Type) -> Pure # T.Type -> Val () -> Val (Pure # T.Type)
addTypes nomsMap typ (Ann (Const ()) b) =
    case b of
    RRecExtend recExtend -> r (addTypesRecExtend recExtend)
    RInject inject -> r (addTypesInject inject)
    RArray items -> r (addTypesArray items)
    RFunc x -> RFunc x
    RRecEmpty -> RRecEmpty
    RPrimVal l -> RPrimVal l
    RError e -> RError e
    & Ann (Const typ)
    where
        r f = f (addTypes nomsMap) (unwrapTInsts nomsMap typ)
addTypes :: Map T.NominalId (Pure # N.NominalDecl T.Type) -> Pure # T.Type -> Val () -> Val (Pure # T.Type)
addTypes nomsMap typ (Ann (Const ()) b) =
    case b of
    RRecExtend recExtend -> r (addTypesRecExtend recExtend)
    RInject inject -> r (addTypesInject inject)
    RArray items -> r (addTypesArray items)
    RFunc x -> RFunc x
    RRecEmpty -> RRecEmpty
    RPrimVal l -> RPrimVal l
    RError e -> RError e
    & Ann (Const typ)
    where
        r f = f (addTypes nomsMap) (unwrapTInsts nomsMap typ)
addTypes nomsMap typ (Ann (Const ()) b) =
    case b of
    RRecExtend recExtend -> r (addTypesRecExtend recExtend)
    RInject inject -> r (addTypesInject inject)
    RArray items -> r (addTypesArray items)
    RFunc x -> RFunc x
    RRecEmpty -> RRecEmpty
    RPrimVal l -> RPrimVal l
    RError e -> RError e
    & Ann (Const typ)
    where
        r f = f (addTypes nomsMap) (unwrapTInsts nomsMap typ)