[Haskell-beginners] Unformatted binary IO

Brent Yorgey byorgey at gmail.com
Mon Sep 29 23:43:00 UTC 2014


I am not sure I have quite understood your problem, but perhaps the
data-binary-ieee754 package may be of use?

-Brent


I am trying to read and write to/from files or stdout/stdin that have
an ascii header followed by unformatted float32 binary data.  (The
files are created using a C program.)  The ascii header first needs to
be parsed to understand the structure of the floating point data.  I
have solved the parsing problem, but getting the unformatted binary
float data into a series of float (or double) immutable, unboxed
vectors has defeated me so far.  The binary package doesn't help as
far as I can see, as the binary format it reads and writes has some
control information at the beginning that doesn't exist in the format
I am reading.

This is easy in C, but seems to be hard in Haskell unless I am missing
something.

Any suggestions?

--
David J. Raymond
Prof. of Physics
New Mexico Tech
http://www.physics.nmt.edu/~raymond/index.html
_______________________________________________
Beginners mailing list
Beginners at haskell.org
http://www.haskell.org/mailman/listinfo/beginners
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20140929/f9eb54c2/attachment.html>


More information about the Beginners mailing list