Is there any good way to do the below, without having to define 'with-file' as untyped in a different file and exporting a type theory for it. The following (right rule) works, but I would like the body of 'with-file' to be type checked as well.
(datatype with-file
if (element? M [in out])
File : string;
K : ((stream M) --> B); ________________________________________________________________
(with-file File M K) : B;)
Maybe it would be a good idea if the Shen loader was modified for typed files. Currently, if a type signature is missing from a function definition it will throw an error, but instead maybe it should query the type system to see if it was defined through sequent rules, and use the left rule for it to introduce the variables?
File : string, M : M, K : ((stream M) --> B) >> P;
__________________________________________________________