Skip to content
This repository has been archived by the owner on Feb 10, 2021. It is now read-only.

Generalizing over input type #27

Open
mzero opened this issue Aug 13, 2017 · 2 comments
Open

Generalizing over input type #27

mzero opened this issue Aug 13, 2017 · 2 comments

Comments

@mzero
Copy link

mzero commented Aug 13, 2017

Any interest in generalizing this over input stream time?

I'm working on parsing MIDI messages (via JS WebMIDI API) - and recently had to essentially duplicate about half of this module so it could parse over byte streams, rather than Strings.

Many of the functions are agnostic about input stream type, and generalizing these is trivial. The rest are String specific, and might be better in a string specific module. Optionally there could be a module that makes the parsing types specific to String, and then adds the string specific functions.

@stil4m
Copy link
Contributor

stil4m commented Aug 13, 2017

I haven't heard a prior proposal for this, but it may be a good idea.
What would you then propose that the input becomes? A Listor Array of Char? Changing the parser type to take another type-constructor argument would do the trick I imagine.

By the way. Have you looked into elm-comidi? Maybe this already does what you try to do.

@rhofour
Copy link

rhofour commented Dec 23, 2017

I'm working on elm-comidi right now and debugging would be much nicer if things were in terms of a list of chars or ints (since we don't have proper bytes).

Edit: Actually, I think my debugging issues are more with how Elm is rending binary strings than the fact that they're strings.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants