Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken ArrowLoop Instance #32

Closed
RiugaBachi opened this issue Sep 6, 2019 · 2 comments
Closed

Broken ArrowLoop Instance #32

RiugaBachi opened this issue Sep 6, 2019 · 2 comments

Comments

@RiugaBachi
Copy link

RiugaBachi commented Sep 6, 2019

A rec block inside VarT will cause an infinite cyclic reference crash, even for simple cases where the variable is fed constant input and is not referenced outside rec. Tested over both IO and Identity. Below is a minimal complete example. Compiler is GHC 8.6.5 using base 4.12.0.0.

module Main where

import Control.Varying.Core
import Control.Varying.Event
import Control.Arrow
import Data.Functor.Identity

main :: IO ()
main = do
  testVarOver testVar [5.0]
  where
    testVar :: VarT IO Double (Maybe Double)
    testVar = proc val -> do
      rec _ <- returnA -< 0.5
      returnA -< Just 5.0

For reference, the equivalent of the above runs fine in wires.

@schell
Copy link
Owner

schell commented Sep 9, 2019

Thanks for the report @RiugaBachi, I'll see how it was implemented in wires.

@schell
Copy link
Owner

schell commented Sep 9, 2019

Pattern matching inside 'loop' was a bit too strict, is all. I should have a new version up on hackage soonish. Thanks!

@schell schell closed this as completed Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants