Index: libcfa/src/Makefile.am
===================================================================
--- libcfa/src/Makefile.am	(revision 73abe950d807eab747c9e14353b158fcca827308)
+++ libcfa/src/Makefile.am	(revision 524ed86476e43c6c764a1b5335fc8d4fd281dacd)
@@ -67,5 +67,5 @@
 	bits/debug.hfa         \
 	bits/locks.hfa         \
-	concurrency/invoke.hfa
+	concurrency/invoke.h
 
 MOSTLYCLEANFILES = prelude.c
Index: libcfa/src/Makefile.in
===================================================================
--- libcfa/src/Makefile.in	(revision 73abe950d807eab747c9e14353b158fcca827308)
+++ libcfa/src/Makefile.in	(revision 524ed86476e43c6c764a1b5335fc8d4fd281dacd)
@@ -343,14 +343,18 @@
 AM_CCASFLAGS = -g -Wall -Wno-unused-function @ARCH_FLAGS@
 
+#----------------------------------------------------------------------------------------------------------------
+
 # not all platforms support concurrency, add option do disable it
-headers = fstream iostream iterator limits rational time stdlib common \
-	containers/maybe containers/pair containers/result \
-	containers/vector concurrency/coroutine concurrency/thread \
-	concurrency/kernel concurrency/monitor concurrency/mutex
-libobjs = ${headers:=.o}
+headers = fstream.hfa iostream.hfa iterator.hfa limits.hfa \
+	rational.hfa time.hfa stdlib.hfa common.hfa \
+	containers/maybe.hfa containers/pair.hfa containers/result.hfa \
+	containers/vector.hfa concurrency/coroutine.hfa \
+	concurrency/thread.hfa concurrency/kernel.hfa \
+	concurrency/monitor.hfa concurrency/mutex.hfa
+libobjs = ${headers:.hfa=.o}
 
 # not all platforms support concurrency, add option do disable it
 libsrc = prelude.c startup.cfa interpose.cfa bits/debug.cfa assert.cfa \
-	exception.c virtual.c heap.cfa ${headers:=.cfa} \
+	exception.c virtual.c heap.cfa ${headers:.hfa=.cfa} \
 	concurrency/CtxSwitch-@ARCHITECTURE@.S concurrency/alarm.cfa \
 	concurrency/invoke.c concurrency/preemption.cfa
@@ -359,17 +363,17 @@
 cfa_includedir = $(CFA_INCDIR)
 nobase_cfa_include_HEADERS = \
-	${headers}		\
-	${stdhdr}		\
-	math			\
-	gmp			\
-	time_t.h		\
-	bits/align.h 		\
-	bits/containers.h	\
-	bits/defs.h 		\
-	bits/debug.h 		\
-	bits/locks.h 		\
+	${headers}             \
+	${stdhdr}              \
+	math.hfa               \
+	gmp.hfa                \
+	time_t.hfa             \
+	bits/align.hfa         \
+	bits/containers.hfa    \
+	bits/defs.hfa          \
+	bits/debug.hfa         \
+	bits/locks.hfa         \
 	concurrency/invoke.h
 
-CLEANFILES = prelude.c
+MOSTLYCLEANFILES = prelude.c
 all: all-am
 
@@ -670,7 +674,7 @@
 	fi
 mostlyclean-generic:
+	-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
 
 clean-generic:
-	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
 
 distclean-generic:
@@ -783,17 +787,9 @@
 	$(am__mv) $$depbase.Tpo $$depbase.Po
 
-# extensionless header files are overridden by -o flag in default makerule => explicitly override default rule to silently do nothing
-# SKULLDUGGERY in order to make sure this isn't called make the rule always fail but also create a rule for headers
-% : %.c
-	echo "Dummy rule, should never be called"
-	false
-
-# This rule should always match headers and since it has no prerequisite it will never be called
-$(addprefix $(srcdir)/,$(headers)):
-	echo "Dummy rule, should never be called"
-	false
-
-${libobjs} : ${cfalib_DATA} # add dependency to cfa-cpp so all libraries are rebuilt with new translator
-
+#----------------------------------------------------------------------------------------------------------------
+# add dependency to cfa-cpp so all libraries are rebuilt with new translator
+${libobjs} : ${cfalib_DATA}
+
+#----------------------------------------------------------------------------------------------------------------
 maintainer-clean-local:
 	-rm -rf ${CFA_INCDIR} ${CFA_LIBDIR}
Index: libcfa/src/bits/signal.hfa
===================================================================
--- libcfa/src/bits/signal.hfa	(revision 73abe950d807eab747c9e14353b158fcca827308)
+++ libcfa/src/bits/signal.hfa	(revision 524ed86476e43c6c764a1b5335fc8d4fd281dacd)
@@ -22,5 +22,5 @@
 #include <errno.h>
 #define __USE_GNU
-#include <signal.hfa>
+#include <signal.h>
 #undef __USE_GNU
 #include <stdlib.h>
Index: libcfa/src/common.cfa
===================================================================
--- libcfa/src/common.cfa	(revision 73abe950d807eab747c9e14353b158fcca827308)
+++ libcfa/src/common.cfa	(revision 524ed86476e43c6c764a1b5335fc8d4fd281dacd)
@@ -1,11 +1,11 @@
-//                               -*- Mode: C -*- 
-// 
+//                               -*- Mode: C -*-
+//
 // Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
 //
 // The contents of this file are covered under the licence agreement in the
 // file "LICENCE" distributed with Cforall.
-// 
-// common.c -- 
-// 
+//
+// common.c --
+//
 // Author           : Peter A. Buhr
 // Created On       : Thu Jul 12 08:02:29 2018
@@ -13,7 +13,7 @@
 // Last Modified On : Thu Jul 12 08:38:47 2018
 // Update Count     : 3
-// 
+//
 
-#include "common"
+#include "common.hfa"
 #include <stdlib.h>					// div_t, *div
 
Index: libcfa/src/concurrency/alarm.hfa
===================================================================
--- libcfa/src/concurrency/alarm.hfa	(revision 73abe950d807eab747c9e14353b158fcca827308)
+++ libcfa/src/concurrency/alarm.hfa	(revision 524ed86476e43c6c764a1b5335fc8d4fd281dacd)
@@ -21,5 +21,5 @@
 #include <assert.h>
 
-#include "time"
+#include "time.hfa"
 
 struct thread_desc;
Index: libcfa/src/concurrency/coroutine.cfa
===================================================================
--- libcfa/src/concurrency/coroutine.cfa	(revision 73abe950d807eab747c9e14353b158fcca827308)
+++ libcfa/src/concurrency/coroutine.cfa	(revision 524ed86476e43c6c764a1b5335fc8d4fd281dacd)
@@ -14,5 +14,5 @@
 //
 
-#include "coroutine"
+#include "coroutine.hfa"
 
 extern "C" {
Index: libcfa/src/concurrency/kernel.cfa
===================================================================
--- libcfa/src/concurrency/kernel.cfa	(revision 73abe950d807eab747c9e14353b158fcca827308)
+++ libcfa/src/concurrency/kernel.cfa	(revision 524ed86476e43c6c764a1b5335fc8d4fd281dacd)
@@ -22,10 +22,10 @@
 #include <fenv.h>
 #include <sys/resource.h>
-#include <signal.hfa>
+#include <signal.h>
 #include <unistd.h>
 }
 
 //CFA Includes
-#include "time"
+#include "time.hfa"
 #include "kernel_private.hfa"
 #include "preemption.hfa"
Index: libcfa/src/concurrency/kernel_private.hfa
===================================================================
--- libcfa/src/concurrency/kernel_private.hfa	(revision 73abe950d807eab747c9e14353b158fcca827308)
+++ libcfa/src/concurrency/kernel_private.hfa	(revision 524ed86476e43c6c764a1b5335fc8d4fd281dacd)
@@ -16,6 +16,6 @@
 #pragma once
 
-#include "kernel"
-#include "thread"
+#include "kernel.hfa"
+#include "thread.hfa"
 
 #include "alarm.hfa"
Index: libcfa/src/concurrency/monitor.cfa
===================================================================
--- libcfa/src/concurrency/monitor.cfa	(revision 73abe950d807eab747c9e14353b158fcca827308)
+++ libcfa/src/concurrency/monitor.cfa	(revision 524ed86476e43c6c764a1b5335fc8d4fd281dacd)
@@ -14,5 +14,5 @@
 //
 
-#include "monitor"
+#include "monitor.hfa"
 
 #include <stdlib.hfa>
@@ -21,5 +21,5 @@
 #include "kernel_private.hfa"
 
-#include "bits/algorithms.hfa"
+#include "bits/algorithm.hfa"
 
 //-----------------------------------------------------------------------------
Index: libcfa/src/concurrency/monitor.hfa
===================================================================
--- libcfa/src/concurrency/monitor.hfa	(revision 73abe950d807eab747c9e14353b158fcca827308)
+++ libcfa/src/concurrency/monitor.hfa	(revision 524ed86476e43c6c764a1b5335fc8d4fd281dacd)
@@ -20,5 +20,5 @@
 #include <assert.h>
 #include "invoke.h"
-#include "stdlib"
+#include "stdlib.hfa"
 
 trait is_monitor(dtype T) {
Index: libcfa/src/concurrency/mutex.cfa
===================================================================
--- libcfa/src/concurrency/mutex.cfa	(revision 73abe950d807eab747c9e14353b158fcca827308)
+++ libcfa/src/concurrency/mutex.cfa	(revision 524ed86476e43c6c764a1b5335fc8d4fd281dacd)
@@ -16,5 +16,5 @@
 //
 
-#include "mutex"
+#include "mutex.hfa"
 
 #include "kernel_private.hfa"
Index: libcfa/src/concurrency/mutex.hfa
===================================================================
--- libcfa/src/concurrency/mutex.hfa	(revision 73abe950d807eab747c9e14353b158fcca827308)
+++ libcfa/src/concurrency/mutex.hfa	(revision 524ed86476e43c6c764a1b5335fc8d4fd281dacd)
@@ -20,5 +20,5 @@
 #include <stdbool.h>
 
-#include "bits/algorithms.hfa"
+#include "bits/algorithm.hfa"
 #include "bits/locks.hfa"
 
Index: libcfa/src/concurrency/thread.cfa
===================================================================
--- libcfa/src/concurrency/thread.cfa	(revision 73abe950d807eab747c9e14353b158fcca827308)
+++ libcfa/src/concurrency/thread.cfa	(revision 524ed86476e43c6c764a1b5335fc8d4fd281dacd)
@@ -14,5 +14,5 @@
 //
 
-#include "thread"
+#include "thread.hfa"
 
 #include "kernel_private.hfa"
Index: libcfa/src/concurrency/thread.hfa
===================================================================
--- libcfa/src/concurrency/thread.hfa	(revision 73abe950d807eab747c9e14353b158fcca827308)
+++ libcfa/src/concurrency/thread.hfa	(revision 524ed86476e43c6c764a1b5335fc8d4fd281dacd)
@@ -19,7 +19,7 @@
 #include "invoke.h"
 
-#include "coroutine"
-#include "kernel"
-#include "monitor"
+#include "coroutine.hfa"
+#include "kernel.hfa"
+#include "monitor.hfa"
 
 //-----------------------------------------------------------------------------
Index: libcfa/src/containers/maybe.cfa
===================================================================
--- libcfa/src/containers/maybe.cfa	(revision 73abe950d807eab747c9e14353b158fcca827308)
+++ libcfa/src/containers/maybe.cfa	(revision 524ed86476e43c6c764a1b5335fc8d4fd281dacd)
@@ -14,5 +14,5 @@
 //
 
-#include <containers/maybe>
+#include <containers/maybe.hfa>
 #include <assert.h>
 
Index: libcfa/src/containers/pair.cfa
===================================================================
--- libcfa/src/containers/pair.cfa	(revision 73abe950d807eab747c9e14353b158fcca827308)
+++ libcfa/src/containers/pair.cfa	(revision 524ed86476e43c6c764a1b5335fc8d4fd281dacd)
@@ -11,7 +11,7 @@
 //
 
-#include <containers/pair>
+#include <containers/pair.hfa>
 
-forall(otype R, otype S 
+forall(otype R, otype S
 	| { int ?==?(R, R); int ?<?(R, R); int ?<?(S, S); })
 int ?<?(pair(R, S) p, pair(R, S) q) {
@@ -19,5 +19,5 @@
 }
 
-forall(otype R, otype S 
+forall(otype R, otype S
 	| { int ?==?(R, R); int ?<?(R, R); int ?<=?(S, S); })
 int ?<=?(pair(R, S) p, pair(R, S) q) {
@@ -35,5 +35,5 @@
 }
 
-forall(otype R, otype S 
+forall(otype R, otype S
 	| { int ?==?(R, R); int ?>?(R, R); int ?>?(S, S); })
 int ?>?(pair(R, S) p, pair(R, S) q) {
@@ -41,5 +41,5 @@
 }
 
-forall(otype R, otype S 
+forall(otype R, otype S
 	| { int ?==?(R, R); int ?>?(R, R); int ?>=?(S, S); })
 int ?>=?(pair(R, S) p, pair(R, S) q) {
Index: libcfa/src/containers/result.cfa
===================================================================
--- libcfa/src/containers/result.cfa	(revision 73abe950d807eab747c9e14353b158fcca827308)
+++ libcfa/src/containers/result.cfa	(revision 524ed86476e43c6c764a1b5335fc8d4fd281dacd)
@@ -14,5 +14,5 @@
 //
 
-#include <containers/result>
+#include <containers/result.hfa>
 #include <assert.h>
 
Index: libcfa/src/containers/vector.cfa
===================================================================
--- libcfa/src/containers/vector.cfa	(revision 73abe950d807eab747c9e14353b158fcca827308)
+++ libcfa/src/containers/vector.cfa	(revision 524ed86476e43c6c764a1b5335fc8d4fd281dacd)
@@ -14,5 +14,5 @@
 //
 
-#include <containers/vector>
+#include <containers/vector.hfa>
 
 #include <stdlib.hfa>
Index: libcfa/src/fstream.cfa
===================================================================
--- libcfa/src/fstream.cfa	(revision 73abe950d807eab747c9e14353b158fcca827308)
+++ libcfa/src/fstream.cfa	(revision 524ed86476e43c6c764a1b5335fc8d4fd281dacd)
@@ -14,5 +14,5 @@
 //
 
-#include "fstream"
+#include "fstream.hfa"
 
 #include <stdio.h>										// vfprintf, vfscanf
Index: libcfa/src/fstream.hfa
===================================================================
--- libcfa/src/fstream.hfa	(revision 73abe950d807eab747c9e14353b158fcca827308)
+++ libcfa/src/fstream.hfa	(revision 524ed86476e43c6c764a1b5335fc8d4fd281dacd)
@@ -16,5 +16,5 @@
 #pragma once
 
-#include "iostream"
+#include "iostream.hfa"
 
 enum { sepSize = 16 };
Index: libcfa/src/heap.cfa
===================================================================
--- libcfa/src/heap.cfa	(revision 73abe950d807eab747c9e14353b158fcca827308)
+++ libcfa/src/heap.cfa	(revision 524ed86476e43c6c764a1b5335fc8d4fd281dacd)
@@ -26,5 +26,5 @@
 #include "bits/locks.hfa"									// __spinlock_t
 #include "startup.hfa"									// STARTUP_PRIORITY_MEMORY
-#include "stdlib"										// bsearchl
+#include "stdlib.hfa"										// bsearchl
 #include "malloc.h"
 
Index: libcfa/src/interpose.cfa
===================================================================
--- libcfa/src/interpose.cfa	(revision 73abe950d807eab747c9e14353b158fcca827308)
+++ libcfa/src/interpose.cfa	(revision 524ed86476e43c6c764a1b5335fc8d4fd281dacd)
@@ -18,5 +18,5 @@
 #include <unistd.h>										// _exit, getpid
 #define __USE_GNU
-#include <signal.hfa>
+#include <signal.h>
 #undef __USE_GNU
 extern "C" {
Index: libcfa/src/iostream
===================================================================
--- libcfa/src/iostream	(revision 73abe950d807eab747c9e14353b158fcca827308)
+++ 	(revision )
@@ -1,175 +1,0 @@
-//
-// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
-//
-// The contents of this file are covered under the licence agreement in the
-// file "LICENCE" distributed with Cforall.
-//
-// iostream --
-//
-// Author           : Peter A. Buhr
-// Created On       : Wed May 27 17:56:53 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Sun Jul  1 12:12:22 2018
-// Update Count     : 155
-//
-
-#pragma once
-
-#include "iterator"
-
-trait ostream( dtype ostype ) {
-	// private
-	_Bool sepPrt( ostype & );							// return separator state (on/off)
-	void sepReset( ostype & );							// set separator state to default state
-	void sepReset( ostype &, _Bool );					// set separator and default state
-	const char * sepGetCur( ostype & );					// get current separator string
-	void sepSetCur( ostype &, const char * );			// set current separator string
-	_Bool getNL( ostype & );							// check newline
-	void setNL( ostype &, _Bool );						// saw newline
-	// public
-	void sepOn( ostype & );								// turn separator state on
-	void sepOff( ostype & );							// turn separator state off
-	_Bool sepDisable( ostype & );						// set default state to off, and return previous state
-	_Bool sepEnable( ostype & );						// set default state to on, and return previous state
-
-	const char * sepGet( ostype & );					// get separator string
-	void sepSet( ostype &, const char * );				// set separator to string (15 character maximum)
-	const char * sepGetTuple( ostype & );				// get tuple separator string
-	void sepSetTuple( ostype &, const char * );			// set tuple separator to string (15 character maximum)
-
-	int fail( ostype & );
-	int flush( ostype & );
-	void open( ostype & os, const char * name, const char * mode );
-	void close( ostype & os );
-	ostype & write( ostype &, const char *, size_t );
-	int fmt( ostype &, const char fmt[], ... );
-}; // ostream
-
-// trait writeable( otype T ) {
-// 	forall( dtype ostype | ostream( ostype ) ) ostype & ?|?( ostype &, T );
-// }; // writeable
-
-trait writeable( otype T, dtype ostype | ostream( ostype ) ) {
-	ostype & ?|?( ostype &, T );
-}; // writeable
-
-// implement writable for intrinsic types
-
-forall( dtype ostype | ostream( ostype ) ) {
-	ostype & ?|?( ostype &, _Bool );
-
-	ostype & ?|?( ostype &, char );
-	ostype & ?|?( ostype &, signed char );
-	ostype & ?|?( ostype &, unsigned char );
-
-	ostype & ?|?( ostype &, short int );
-	ostype & ?|?( ostype &, unsigned short int );
-	ostype & ?|?( ostype &, int );
-	ostype & ?|?( ostype &, unsigned int );
-	ostype & ?|?( ostype &, long int );
-	ostype & ?|?( ostype &, long long int );
-	ostype & ?|?( ostype &, unsigned long int );
-	ostype & ?|?( ostype &, unsigned long long int );
-
-	ostype & ?|?( ostype &, float ); // FIX ME: should not be required
-	ostype & ?|?( ostype &, double );
-	ostype & ?|?( ostype &, long double );
-
-	ostype & ?|?( ostype &, float _Complex );
-	ostype & ?|?( ostype &, double _Complex );
-	ostype & ?|?( ostype &, long double _Complex );
-
-	ostype & ?|?( ostype &, const char * );
-	// ostype & ?|?( ostype &, const char16_t * );
-#if ! ( __ARM_ARCH_ISA_ARM == 1 && __ARM_32BIT_STATE == 1 ) // char32_t == wchar_t => ambiguous
-	// ostype & ?|?( ostype &, const char32_t * );
-#endif // ! ( __ARM_ARCH_ISA_ARM == 1 && __ARM_32BIT_STATE == 1 )
-	// ostype & ?|?( ostype &, const wchar_t * );
-	ostype & ?|?( ostype &, const void * );
-
-	// manipulators
-	ostype & ?|?( ostype &, ostype & (*)( ostype & ) );
-	ostype & endl( ostype & );
-	ostype & sep( ostype & );
-	ostype & sepTuple( ostype & );
-	ostype & sepOn( ostype & );
-	ostype & sepOff( ostype & );
-	ostype & sepDisable( ostype & );
-	ostype & sepEnable( ostype & );
-} // distribution
-
-// tuples
-forall( dtype ostype, otype T, ttype Params | writeable( T, ostype ) | { ostype & ?|?( ostype &, Params ); } )
-ostype & ?|?( ostype & os, T arg, Params rest );
-
-// writes the range [begin, end) to the given stream
-forall( dtype ostype, otype elt_type | writeable( elt_type, ostype ), otype iterator_type | iterator( iterator_type, elt_type ) )
-void write( iterator_type begin, iterator_type end, ostype & os );
-
-forall( dtype ostype, otype elt_type | writeable( elt_type, ostype ), otype iterator_type | iterator( iterator_type, elt_type ) )
-void write_reverse( iterator_type begin, iterator_type end, ostype & os );
-
-//---------------------------------------
-
-trait istream( dtype istype ) {
-	int fail( istype & );
-	int eof( istype & );
-	void open( istype & is, const char * name );
-	void close( istype & is );
-	istype & read( istype &, char *, size_t );
-	istype & ungetc( istype &, char );
-	int fmt( istype &, const char fmt[], ... );
-}; // istream
-
-trait readable( otype T ) {
-	forall( dtype istype | istream( istype ) ) istype & ?|?( istype &, T );
-}; // readable
-
-forall( dtype istype | istream( istype ) ) {
-	istype & ?|?( istype &, _Bool & );
-
-	istype & ?|?( istype &, char & );
-	istype & ?|?( istype &, signed char & );
-	istype & ?|?( istype &, unsigned char & );
-
-	istype & ?|?( istype &, short int & );
-	istype & ?|?( istype &, unsigned short int & );
-	istype & ?|?( istype &, int & );
-	istype & ?|?( istype &, unsigned int & );
-	istype & ?|?( istype &, long int & );
-	istype & ?|?( istype &, long long int & );
-	istype & ?|?( istype &, unsigned long int & );
-	istype & ?|?( istype &, unsigned long long int & );
-
-	istype & ?|?( istype &, float & );
-	istype & ?|?( istype &, double & );
-	istype & ?|?( istype &, long double & );
-
-	istype & ?|?( istype &, float _Complex & );
-	istype & ?|?( istype &, double _Complex & );
-	istype & ?|?( istype &, long double _Complex & );
-
-	// manipulators
-	istype & ?|?( istype &, istype & (*)( istype & ) );
-	istype & endl( istype & is );
-} // distribution
-
-struct _Istream_cstrUC { char * s; };
-_Istream_cstrUC cstr( char * );
-forall( dtype istype | istream( istype ) ) istype & ?|?( istype &, _Istream_cstrUC );
-
-struct _Istream_cstrC { char * s; int size; };
-_Istream_cstrC cstr( char *, int size );
-forall( dtype istype | istream( istype ) ) istype & ?|?( istype &, _Istream_cstrC );
-
-
-#include <time_t.hfa>										// Duration (constructors) / Time (constructors)
-
-forall( dtype ostype | ostream( ostype ) ) ostype & ?|?( ostype & os, Duration dur );
-forall( dtype ostype | ostream( ostype ) ) ostype & ?|?( ostype & os, Time time );
-
-
-// Local Variables: //
-// mode: c //
-// tab-width: 4 //
-// End: //
Index: libcfa/src/iostream.cfa
===================================================================
--- libcfa/src/iostream.cfa	(revision 73abe950d807eab747c9e14353b158fcca827308)
+++ libcfa/src/iostream.cfa	(revision 524ed86476e43c6c764a1b5335fc8d4fd281dacd)
@@ -14,5 +14,5 @@
 //
 
-#include "iostream"
+#include "iostream.hfa"
 
 extern "C" {
Index: libcfa/src/iostream.hfa
===================================================================
--- libcfa/src/iostream.hfa	(revision 524ed86476e43c6c764a1b5335fc8d4fd281dacd)
+++ libcfa/src/iostream.hfa	(revision 524ed86476e43c6c764a1b5335fc8d4fd281dacd)
@@ -0,0 +1,175 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// iostream --
+//
+// Author           : Peter A. Buhr
+// Created On       : Wed May 27 17:56:53 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sun Jul  1 12:12:22 2018
+// Update Count     : 155
+//
+
+#pragma once
+
+#include "iterator.hfa"
+
+trait ostream( dtype ostype ) {
+	// private
+	_Bool sepPrt( ostype & );							// return separator state (on/off)
+	void sepReset( ostype & );							// set separator state to default state
+	void sepReset( ostype &, _Bool );					// set separator and default state
+	const char * sepGetCur( ostype & );					// get current separator string
+	void sepSetCur( ostype &, const char * );			// set current separator string
+	_Bool getNL( ostype & );							// check newline
+	void setNL( ostype &, _Bool );						// saw newline
+	// public
+	void sepOn( ostype & );								// turn separator state on
+	void sepOff( ostype & );							// turn separator state off
+	_Bool sepDisable( ostype & );						// set default state to off, and return previous state
+	_Bool sepEnable( ostype & );						// set default state to on, and return previous state
+
+	const char * sepGet( ostype & );					// get separator string
+	void sepSet( ostype &, const char * );				// set separator to string (15 character maximum)
+	const char * sepGetTuple( ostype & );				// get tuple separator string
+	void sepSetTuple( ostype &, const char * );			// set tuple separator to string (15 character maximum)
+
+	int fail( ostype & );
+	int flush( ostype & );
+	void open( ostype & os, const char * name, const char * mode );
+	void close( ostype & os );
+	ostype & write( ostype &, const char *, size_t );
+	int fmt( ostype &, const char fmt[], ... );
+}; // ostream
+
+// trait writeable( otype T ) {
+// 	forall( dtype ostype | ostream( ostype ) ) ostype & ?|?( ostype &, T );
+// }; // writeable
+
+trait writeable( otype T, dtype ostype | ostream( ostype ) ) {
+	ostype & ?|?( ostype &, T );
+}; // writeable
+
+// implement writable for intrinsic types
+
+forall( dtype ostype | ostream( ostype ) ) {
+	ostype & ?|?( ostype &, _Bool );
+
+	ostype & ?|?( ostype &, char );
+	ostype & ?|?( ostype &, signed char );
+	ostype & ?|?( ostype &, unsigned char );
+
+	ostype & ?|?( ostype &, short int );
+	ostype & ?|?( ostype &, unsigned short int );
+	ostype & ?|?( ostype &, int );
+	ostype & ?|?( ostype &, unsigned int );
+	ostype & ?|?( ostype &, long int );
+	ostype & ?|?( ostype &, long long int );
+	ostype & ?|?( ostype &, unsigned long int );
+	ostype & ?|?( ostype &, unsigned long long int );
+
+	ostype & ?|?( ostype &, float ); // FIX ME: should not be required
+	ostype & ?|?( ostype &, double );
+	ostype & ?|?( ostype &, long double );
+
+	ostype & ?|?( ostype &, float _Complex );
+	ostype & ?|?( ostype &, double _Complex );
+	ostype & ?|?( ostype &, long double _Complex );
+
+	ostype & ?|?( ostype &, const char * );
+	// ostype & ?|?( ostype &, const char16_t * );
+#if ! ( __ARM_ARCH_ISA_ARM == 1 && __ARM_32BIT_STATE == 1 ) // char32_t == wchar_t => ambiguous
+	// ostype & ?|?( ostype &, const char32_t * );
+#endif // ! ( __ARM_ARCH_ISA_ARM == 1 && __ARM_32BIT_STATE == 1 )
+	// ostype & ?|?( ostype &, const wchar_t * );
+	ostype & ?|?( ostype &, const void * );
+
+	// manipulators
+	ostype & ?|?( ostype &, ostype & (*)( ostype & ) );
+	ostype & endl( ostype & );
+	ostype & sep( ostype & );
+	ostype & sepTuple( ostype & );
+	ostype & sepOn( ostype & );
+	ostype & sepOff( ostype & );
+	ostype & sepDisable( ostype & );
+	ostype & sepEnable( ostype & );
+} // distribution
+
+// tuples
+forall( dtype ostype, otype T, ttype Params | writeable( T, ostype ) | { ostype & ?|?( ostype &, Params ); } )
+ostype & ?|?( ostype & os, T arg, Params rest );
+
+// writes the range [begin, end) to the given stream
+forall( dtype ostype, otype elt_type | writeable( elt_type, ostype ), otype iterator_type | iterator( iterator_type, elt_type ) )
+void write( iterator_type begin, iterator_type end, ostype & os );
+
+forall( dtype ostype, otype elt_type | writeable( elt_type, ostype ), otype iterator_type | iterator( iterator_type, elt_type ) )
+void write_reverse( iterator_type begin, iterator_type end, ostype & os );
+
+//---------------------------------------
+
+trait istream( dtype istype ) {
+	int fail( istype & );
+	int eof( istype & );
+	void open( istype & is, const char * name );
+	void close( istype & is );
+	istype & read( istype &, char *, size_t );
+	istype & ungetc( istype &, char );
+	int fmt( istype &, const char fmt[], ... );
+}; // istream
+
+trait readable( otype T ) {
+	forall( dtype istype | istream( istype ) ) istype & ?|?( istype &, T );
+}; // readable
+
+forall( dtype istype | istream( istype ) ) {
+	istype & ?|?( istype &, _Bool & );
+
+	istype & ?|?( istype &, char & );
+	istype & ?|?( istype &, signed char & );
+	istype & ?|?( istype &, unsigned char & );
+
+	istype & ?|?( istype &, short int & );
+	istype & ?|?( istype &, unsigned short int & );
+	istype & ?|?( istype &, int & );
+	istype & ?|?( istype &, unsigned int & );
+	istype & ?|?( istype &, long int & );
+	istype & ?|?( istype &, long long int & );
+	istype & ?|?( istype &, unsigned long int & );
+	istype & ?|?( istype &, unsigned long long int & );
+
+	istype & ?|?( istype &, float & );
+	istype & ?|?( istype &, double & );
+	istype & ?|?( istype &, long double & );
+
+	istype & ?|?( istype &, float _Complex & );
+	istype & ?|?( istype &, double _Complex & );
+	istype & ?|?( istype &, long double _Complex & );
+
+	// manipulators
+	istype & ?|?( istype &, istype & (*)( istype & ) );
+	istype & endl( istype & is );
+} // distribution
+
+struct _Istream_cstrUC { char * s; };
+_Istream_cstrUC cstr( char * );
+forall( dtype istype | istream( istype ) ) istype & ?|?( istype &, _Istream_cstrUC );
+
+struct _Istream_cstrC { char * s; int size; };
+_Istream_cstrC cstr( char *, int size );
+forall( dtype istype | istream( istype ) ) istype & ?|?( istype &, _Istream_cstrC );
+
+
+#include <time_t.hfa>										// Duration (constructors) / Time (constructors)
+
+forall( dtype ostype | ostream( ostype ) ) ostype & ?|?( ostype & os, Duration dur );
+forall( dtype ostype | ostream( ostype ) ) ostype & ?|?( ostype & os, Time time );
+
+
+// Local Variables: //
+// mode: c //
+// tab-width: 4 //
+// End: //
Index: libcfa/src/iterator.cfa
===================================================================
--- libcfa/src/iterator.cfa	(revision 73abe950d807eab747c9e14353b158fcca827308)
+++ libcfa/src/iterator.cfa	(revision 524ed86476e43c6c764a1b5335fc8d4fd281dacd)
@@ -5,5 +5,5 @@
 // file "LICENCE" distributed with Cforall.
 //
-// iterator.c -- 
+// iterator.c --
 //
 // Author           : Richard C. Bilson
@@ -14,5 +14,5 @@
 //
 
-#include "iterator"
+#include "iterator.hfa"
 
 forall( otype iterator_type, otype elt_type | iterator( iterator_type, elt_type ) )
Index: libcfa/src/limits.cfa
===================================================================
--- libcfa/src/limits.cfa	(revision 73abe950d807eab747c9e14353b158fcca827308)
+++ libcfa/src/limits.cfa	(revision 524ed86476e43c6c764a1b5335fc8d4fd281dacd)
@@ -1,10 +1,10 @@
-// 
+//
 // Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
 //
 // The contents of this file are covered under the licence agreement in the
 // file "LICENCE" distributed with Cforall.
-// 
-// limits.c -- 
-// 
+//
+// limits.c --
+//
 // Author           : Peter A. Buhr
 // Created On       : Wed Apr  6 18:06:52 2016
@@ -12,5 +12,5 @@
 // Last Modified On : Thu Mar  1 16:22:51 2018
 // Update Count     : 74
-// 
+//
 
 #include <limits.h>
@@ -19,5 +19,5 @@
 #include <math.h>
 #include <complex.h>
-#include "limits"
+#include "limits.hfa"
 
 // Integral Constants
Index: libcfa/src/math.hfa
===================================================================
--- libcfa/src/math.hfa	(revision 73abe950d807eab747c9e14353b158fcca827308)
+++ libcfa/src/math.hfa	(revision 524ed86476e43c6c764a1b5335fc8d4fd281dacd)
@@ -350,5 +350,5 @@
 //---------------------------------------
 
-#include "common"
+#include "common.hfa"
 
 //---------------------------------------
Index: libcfa/src/rational.cfa
===================================================================
--- libcfa/src/rational.cfa	(revision 73abe950d807eab747c9e14353b158fcca827308)
+++ libcfa/src/rational.cfa	(revision 524ed86476e43c6c764a1b5335fc8d4fd281dacd)
@@ -14,7 +14,7 @@
 //
 
-#include "rational"
-#include "fstream"
-#include "stdlib"
+#include "rational.hfa"
+#include "fstream.hfa"
+#include "stdlib.hfa"
 
 forall( otype RationalImpl | arithmetic( RationalImpl ) ) {
Index: libcfa/src/rational.hfa
===================================================================
--- libcfa/src/rational.hfa	(revision 73abe950d807eab747c9e14353b158fcca827308)
+++ libcfa/src/rational.hfa	(revision 524ed86476e43c6c764a1b5335fc8d4fd281dacd)
@@ -18,5 +18,5 @@
 #pragma once
 
-#include "iostream"
+#include "iostream.hfa"
 
 trait scalar( otype T ) {
Index: libcfa/src/stdlib.cfa
===================================================================
--- libcfa/src/stdlib.cfa	(revision 73abe950d807eab747c9e14353b158fcca827308)
+++ libcfa/src/stdlib.cfa	(revision 524ed86476e43c6c764a1b5335fc8d4fd281dacd)
@@ -14,5 +14,5 @@
 //
 
-#include "stdlib"
+#include "stdlib.hfa"
 
 //---------------------------------------
Index: libcfa/src/stdlib.hfa
===================================================================
--- libcfa/src/stdlib.hfa	(revision 73abe950d807eab747c9e14353b158fcca827308)
+++ libcfa/src/stdlib.hfa	(revision 524ed86476e43c6c764a1b5335fc8d4fd281dacd)
@@ -251,5 +251,5 @@
 //---------------------------------------
 
-#include "common"
+#include "common.hfa"
 
 // Local Variables: //
Index: libcfa/src/time.cfa
===================================================================
--- libcfa/src/time.cfa	(revision 73abe950d807eab747c9e14353b158fcca827308)
+++ libcfa/src/time.cfa	(revision 524ed86476e43c6c764a1b5335fc8d4fd281dacd)
@@ -1,10 +1,10 @@
-// 
+//
 // Cforall Version 1.0.0 Copyright (C) 2018 University of Waterloo
 //
 // The contents of this file are covered under the licence agreement in the
 // file "LICENCE" distributed with Cforall.
-// 
-// time.c -- 
-// 
+//
+// time.c --
+//
 // Author           : Peter A. Buhr
 // Created On       : Tue Mar 27 13:33:14 2018
@@ -12,8 +12,8 @@
 // Last Modified On : Sun May  6 22:26:00 2018
 // Update Count     : 37
-// 
+//
 
-#include "time"
-#include "iostream"
+#include "time.hfa"
+#include "iostream.hfa"
 #include <stdio.h>										// snprintf
 #include <assert.h>
