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

Irrefutable pattern failed error #126

Closed
ra1u opened this issue Feb 9, 2016 · 4 comments

Comments

Projects
None yet
2 participants
@ra1u
Copy link

commented Feb 9, 2016

module MovingAvg where
import CLaSH.Prelude

windowN :: (Default a,KnownNat n) => SNat (n+1) -> Signal a -> Vec (n + 1) (Signal a)
windowN size = window
movingAvarageNaive size signal =  fold (+) <$> bundle (windowN size signal)

topEntity :: Signal (Signed 9) -> Signal (Signed 9)
topEntity = movingAvarageNaive d5

Fails at synthesis with

[1 of 1] Compiling MovingAvg        ( movingAvarege.hs, movingAvarege.o )
Loading dependencies took 0.259644s
clash: panic! (the 'impossible' happened)
  (GHC version 7.10.3 for x86_64-unknown-linux):
    src/CLaSH/Normalize/PrimitiveReductions.hs:250:9-46: Irrefutable pattern failed for pattern [_, consCon]


Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
@christiaanb

This comment has been minimized.

Copy link
Contributor

commented Feb 9, 2016

I think I know what's going on here, I'll fix it when I get back in the office tomorrow morning. Thanks for the bug report.

@christiaanb christiaanb added the bug label Feb 9, 2016

@christiaanb

This comment has been minimized.

Copy link
Contributor

commented Feb 10, 2016

As a temporary work-around, using either foldr1 or fold1 would work.

christiaanb added a commit that referenced this issue Feb 10, 2016

@christiaanb

This comment has been minimized.

Copy link
Contributor

commented Feb 10, 2016

I just released version 0.6.10 of CLaSH which includes this bug fix.

@ra1u

This comment has been minimized.

Copy link
Author

commented Feb 10, 2016

Great, I will play around with this when I get home.

On 10 February 2016 at 13:17, Christiaan Baaij notifications@github.com
wrote:

I just released version 0.6.10 of CLaSH which includes this bug fix.


Reply to this email directly or view it on GitHub
#126 (comment)
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.