module Connect() where -- An abstraction of data flow networks (DFN) in terms of "connect" -- and "union" operations. -- Connect: instantiate output node if not yet instantiated, and plug -- it into a processor input, removing that particular input from the -- abstracted input candidates. type Input a = a type Output a = a type Fun a = [a] -> [a] data Connect a = Connect (Output a) (Input a) data Ports a = Ports [Input a] [Output a] data DFN a = CNode (Ports a) [DFN a] [Connect a] | PNode (Ports a) [Fun a] -- connect :: Output a -> Input a -> DFN a -> DFN a