Okay, I started to experiment things, and I came to some remarks:<br>First, I cannot use bare lists, because of the way their Applicative instance is declared.<br>I have to use the newtype ZipList (in Control.Applicative).<br>
So I have roughly this :<br><br><span style="font-family: courier new,monospace;">import Control.Applicative</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">newtype AgentSig a = AgentSig (ZipList a)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> deriving (Functor, Applicative)</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">(<+>) :: a -> AgentSig a -> AgentSig a</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">v <+> (AgentSig (ZipList sig)) = AgentSig . ZipList $ v:sig</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">toList :: AgentSig a -> [a]</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">toList (AgentSig (ZipList sig)) = sig</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">fromList :: [a] -> AgentSig a</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">fromList = AgentSig . ZipList</span><br><br>This enables me to do things like :<br><span style="font-family: courier new,monospace;">agent3 a b = (/) <$> a <*> b</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">run = z<br></span><span style="font-family: courier new,monospace;"> where x = agent1 y</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> y = 100 <+> agent2 x</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> z = agent3 x y</span><br><br>One problem though: How to make an instance of Monad out of AgentSig?<br>