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

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


Hey,

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
  rec
    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

Output:
<<loop>>

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?

Regards,
Nathan



More information about the Beginners mailing list