Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."
Today's Topics:
1. Re: Announcement: Real World Haskell (Jeff Greer)
2. Re: doc on accessing C struct binary data (Sean Perry)
----------------------------------------------------------------------
Message: 1
Date: Sat, 31 Jul 2010 20:44:51 -0500
From: Jeff Greer <[email protected]>
Subject: [Haskell-beginners] Re: Announcement: Real World Haskell
To: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
Hi Ben,
There is plenty of room at linuxagora.com for new reading groups. I'll add
it to the list. If you know enough that would be interested in the Hutton
book, it could be done concurrently.
We are always open for new ideas.
Thanks, Jeff
Message: 2
> Date: Sun, 01 Aug 2010 02:54:58 +0900
> From: [email protected] (Benjamin L. Russell)
> Subject: [Haskell-beginners] Re: Announcement: Real World Haskell -
> Reading Group
> To: [email protected]
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset=utf-8
>
> Jeff Greer <[email protected]> writes:
>
> > Hi Russel,Thanks for the suggestion to start a Haskell Reading Group mail
> list. At the current time, I can not fit it into my schedul... full time
> teaching job, gard school, and family....I hope some find the reading group
> useful.
> > -- http://teacherwikiweb.com
>
> My pleasure. Incidentally, another great book I would suggest for a
> reading group would be _Programming in Haskell_ [1], by Graham Hutton.
>
> Does anybody have any plans to start a reading group for this book?
>
> -- Benjamin L. Russell
>
> [1] Hutton, Graham. _Programming in Haskell._ Cambridge: Cambridge
> University Press,
> 2007. Print.
> <http://www.cs.nott.ac.uk/~gmh/book.html<http://www.cs.nott.ac.uk/%7Egmh/book.html>
> >.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://www.haskell.org/pipermail/beginners/attachments/20100731/a95d9d28/attachment-0001.html
------------------------------
Message: 2
Date: Sun, 01 Aug 2010 00:55:39 -0700
From: Sean Perry <[email protected]>
Subject: Re: [Haskell-beginners] doc on accessing C struct binary data
To: Dean Herington <[email protected]>
Cc: [email protected]
Message-ID: <1280649339.1375.10.ca...@aspire>
Content-Type: text/plain; charset="UTF-8"
On Sat, 2010-07-31 at 17:05 -0400, Dean Herington wrote:
> At 11:40 PM -0700 7/30/10, Sean Perry wrote:
> >I would like to read C structs that have been written to disk as binary
> >data. Is there a reference on doing this somewhere. The IO is not too
> >hard, but how do I mimic the C struct in Haskell and still honor the
> >exact sizes of the various struct members?
>
> At 9:11 AM +0100 7/31/10, Stephen Tetley wrote:
> >Hi Sean
> >
> >Commonly people would use Data.Word and Data.Int to get sized
> >integrals. There's no corresponding sized types for floats - if you're
> >lucky your serialized C Structs won't use floats otherwise you'll have
> >to dig out a reference manual to see how they are laid out.
> >
> >To actually read C-structs Data.Binary.Get should provide the
> >primitives you need (getWord8, getWord16le, getWord16be, ...), you'll
> >then have to assemble a parser using these primitives to read your
> >struct.
> >
> >You might have to pay some attention to alignment - the C struct might
> >be laid out with elements on byte boundaries (usually 4-byte) rather
> >than directly adjacent. I suspect alignment is compiler dependent, its
> >a long time since I looked at this but I believe C99 has pragmas to
> >direct the compiler on alignment.
> >
> >Best wishes
> >
> >Stephen
>
> I would recommend using hsc2hs instead, as it avoids having to
> emulate the C compiler, which is tedious and error-prone. (See
> section 10.3 of the GHC User's Guide.) In a nutshell, you write (the
> necessary parts of) your program in a modestly extended Haskell. In
> an .hsc file you can #include C header files (no need to duplicate
> that code in Haskell!) and bring selected pieces of the C world
> (types, field offsets, ...) into Haskell. The hsc2hs translator
> actually creates a C program from your .hsc file that, when executed,
> writes your .hs file, incorporating the needed knowledge from C land.
>
> Dean
Sounds like what I am looking for, thanks!
------------------------------
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
End of Beginners Digest, Vol 26, Issue 1
****************************************