Comments (6)
For the array suggestion, you could even make the channel index polymorphic. That is, instead of (Int, Int)
, it would be Ix i => (Int, i)
. The user could still make i
be Int
, but they could also use something like data Channel = Left | Right
or what not. The functions needed to convert arrays to pointers do not care what index you use as long as it is Ix
.
from bindings-portaudio.
I'm not a big fan of using Arrays or lists; there's a deliberate design choice of using a storable vector of static length data (e.g. V2), because it doesn't make sense to have dynamically changing number of channels in a stream. It also helps to have cache-friendly efficient operations.
from bindings-portaudio.
Storable Arrays can not change length in any dimension. Also, the current library does not guarantee static length, since Foldables can have a length that is different than the number of items they physically contain, perhaps in a variable way. For example, you can have data Foo a = Foo Int a
, with toList (Foo n a) = replicate n a
.
from bindings-portaudio.
If you want the length to be encoded in the type, you could use arrays where the bounds for the channel are (minBound, maxBound)
, or use fixed-vector which provides this typeclass specifically for fixed length vector types.
from bindings-portaudio.
I don't want 2D arrays because of the lack of API and you'll have to write elements one by one, for each channel. Fixed length vectors from the linear package are intended ones right now.
from bindings-portaudio.
Okay, I think I understand why the library is the way it is now. I'll just close this issue.
from bindings-portaudio.
Related Issues (8)
- collect2: error: ld returned 1 exit status HOT 1
- Please release new version HOT 3
- Suggestion: Add a way to check if the stream is finished to System.PortAudio HOT 2
- Please don't bundle portaudio HOT 9
- No available API on x86_64 linux HOT 4
- Linking failure on OSX
- cabal file points at wrong repository HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bindings-portaudio.