[Haskell-beginners] netwire, <<loop>> with accum1

Nathan Hüsken nathan.huesken at posteo.de
Sun Nov 4 15:21:48 CET 2012


I have another <<loop>> with netwire.
This is the minimal example I got it down to:

{-# LANGUAGE Arrows #-}

import Control.Wire

mainWire :: WireP () Double
mainWire = proc _ -> do
    out <- accum1 (+) 0 -< oldOut
    oldOut <- delay 0 -< out

  returnA -< out

main = wireLoop mainWire

wireLoop :: WireP () Double -> IO ()
wireLoop w' = do
     let (mx, w) = stepWireP w' 1.0 ()
     putStrLn $ show mx
     wireLoop w


I am aware, in this context I could just use accum. I triggered the
error where I changed integral_ and accum1.

By the way, is it apropriate, that I always write these "netwire bug
reports" over this list?


More information about the Beginners mailing list