Advertisement
Guest User

Untitled

a guest
Jul 31st, 2021
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. convolve :: VS.Vector Float -> Pipe IQ IQ IO ()
  2. convolve kernel = do
  3. let klen = VS.length kernel
  4. bufSz = 1024
  5. mkCInt = CInt . fromIntegral
  6.  
  7. inBuf <- lift $ VSM.replicate bufSz 0.0
  8. outBuf <- lift $ VSM.replicate bufSz 0.0
  9. stateBuf <- lift $ VSM.replicate klen (0.0 :+ 0.0 :: IQ)
  10.  
  11.  
  12. lift $ VSM.mapM_ yield outBuf
  13.  
  14. Error:
  15.  
  16. • Couldn't match type ‘PrimState (Proxy () IQ () IQ IO)’
  17. with ‘RealWorld’
  18. Expected type: MVector (PrimState (Proxy () IQ () IQ IO)) IQ
  19. Actual type: MVector RealWorld IQ
  20. • In the second argument of ‘mapM_’, namely ‘outBuf’
  21. In a stmt of a 'do' block: mapM_ yield outBuf
  22. In the expression:
  23. do let klen = length kernel
  24. bufSz = 1024
  25. ....
  26. inBuf <- lift $ replicate bufSz 0.0
  27. outBuf <- lift $ replicate bufSz 0.0
  28. stateBuf <- lift $ replicate klen (0.0 :+ 0.0 :: IQ)
  29. ....
  30. |
  31. 71 | VSM.mapM_ yield outBuf
  32. | ^^^^^^
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement