system :: Int -> [InstructionMem] -> SystemState -> t -> SystemState

system nrOfSprs instrss systemState _ = systemState'
        where
          SystemState{..} = systemState

          -- Sprockells
          (sprStates',sprRequests)                              = unzip $ sprockell $> instrss |$| sprStates |$| chReplies

          -- Communication
          ((requestChnls',replyChnls'), (chReplies,chRequests)) = transfer (requestChnls,replyChnls) (sprRequests,(i,shMemReply))

          -- Shared Memory
          ((sharedMem',requestFifo'), (i,shMemReply))           = shMem (sharedMem,requestFifo) chRequests

          systemState' = SystemState
                { sprStates     = sprStates'
                , requestChnls  = requestChnls'
                , replyChnls    = replyChnls'
                , requestFifo   = requestFifo'
                , sharedMem     = sharedMem'
                }
system :: Int -> [InstructionMem] -> SystemState -> t -> SystemState
system nrOfSprs instrss systemState _ = systemState'
        where
          SystemState{..} = systemState

          -- Sprockells
          (sprStates',sprRequests)                              = unzip $ sprockell $> instrss |$| sprStates |$| chReplies

          -- Communication
          ((requestChnls',replyChnls'), (chReplies,chRequests)) = transfer (requestChnls,replyChnls) (sprRequests,(i,shMemReply))

          -- Shared Memory
          ((sharedMem',requestFifo'), (i,shMemReply))           = shMem (sharedMem,requestFifo) chRequests

          systemState' = SystemState
                { sprStates     = sprStates'
                , requestChnls  = requestChnls'
                , replyChnls    = replyChnls'
                , requestFifo   = requestFifo'
                , sharedMem     = sharedMem'
                }
system nrOfSprs instrss systemState _ = systemState'
        where
          SystemState{..} = systemState

          -- Sprockells
          (sprStates',sprRequests)                              = unzip $ sprockell $> instrss |$| sprStates |$| chReplies

          -- Communication
          ((requestChnls',replyChnls'), (chReplies,chRequests)) = transfer (requestChnls,replyChnls) (sprRequests,(i,shMemReply))

          -- Shared Memory
          ((sharedMem',requestFifo'), (i,shMemReply))           = shMem (sharedMem,requestFifo) chRequests

          systemState' = SystemState
                { sprStates     = sprStates'
                , requestChnls  = requestChnls'
                , replyChnls    = replyChnls'
                , requestFifo   = requestFifo'
                , sharedMem     = sharedMem'
                }