AS Cap'p Scheme Language <https://capnproto.org/language.html#generic-types> 
says: "A *struct or interface* type may be parameterized, making it 
“generic”." 

I am wondering is it possible (technically) to have *Generic Enums*?
In Rust, this is very common that a method can return "Result" Generic 
Enum, that can be an error or a generic value:

enum Result<T, E> { 
 Ok(T),
 Err(E), 
}

If technically it is not possible to define a generic enum, what is the 
bests practice of define this function in Cap'n Proto:

fn foo() -> Result<String, Error> {
    ...
}


-- 
You received this message because you are subscribed to the Google Groups 
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/capnproto/5515b78c-8da3-4fc8-9fb3-93ff7c21ea26%40googlegroups.com.

Reply via email to