First Class File I/O Marco Pil Computing Science Institute, University of Nijmegen, Postbus 9010, 6500 GL Nijmegen, The Netherlands e-mail: marcop@cs.kun.nl Abstract. In most functional languages little attention has been paid to file I/O. The file system is poorly typed at best and some classes of objects, in particular functions, cannot be stored on disk at all. In this article we present a mature type system for typing files. We also discuss briefly how we plan to implement the storage of functions in files. We make use of the concept of dynamic types, as introduced in Abadi et al., which provide an interface between statically and dynamically typed parts of a program. We have modified the concept of dynamic types to include polymorphic types in a natural way and we are implementing this modified system of dynamic types in the functional language Clean. We have developed a simple run-time matching algorithm for the dynamic type checks. We present some of the problems we encountered when the system of dynamic types is implemented to its full extent in a language that already has an elaborate type system. Finally we show that the same concepts that we used for constructing the file system can be used for communication between independently running programs in general.