Opaque / abstract types ?

David Teller David.Teller at univ-orleans.fr
Sun Oct 28 05:45:50 PDT 2007

   Hi list,

 After reading the Outline document, I find myself wondering if there's
a way to provide a type without any method for the user to manually
create an inhabitant of that type ? 

 This is a technique commonly used in functional programming (and
sometimes used in Java/C#, too, I believe) to provide type-checked
safety / security, e.g. you can only call function "read_from_file" with
an argument of type "FileOpenedForReading", which itself may only be
obtained from function "open_file" and cannot be forged. Of course, this
example applies to files, but could just as well apply to any kind of

 From the Outline, operator "as" and reflexivity make me think it's not
possible. Am I wrong ?


David Teller ------------------------------------------
Security of Distributed Systems -----------------------
Project JStify: Static Analysis for JavaScript 2  -----
-- http://www.univ-orleans.fr/lifo/Members/David.Teller
----- Laboratoire d'Informatique Fondamentale d'Orleans

More information about the Es4-discuss mailing list