On 28 August 2005 20:00, Joel Reymont wrote:
> I get a message from Erlang once data arrives over TCP and the
> message is a {tcp, Socket, Bin} tuple where Bin is binary data. I can
> easily extract what I need using Erlang binary pattern matching:
>
> read(<<24, GID:32, Seq:16>>) ->
> {24,
On Tue, Aug 30, 2005 at 01:31:22PM +0200, Joel Reymont wrote:
> Can I beg for examples?
This is from some old code, slightly polished for presentation - the
code for parsing DNS domain name label in DNS packets:
parseLabel :: CharParser st Label
parseLabel = ( "label") $ do
len <-
On Tue, Aug 30, 2005 at 12:35:30PM +0100, Philippa Cowderoy wrote:
> On Tue, 30 Aug 2005, Tomasz Zielonka wrote:
>
> >On Tue, Aug 30, 2005 at 12:41:20PM +0200, Joel Reymont wrote:
> >>Erlang does this nicely, I replied to the LtU thread. I positively
> >>got the impression that nobody was parsing
On Mon, Aug 29, 2005 at 01:08:31AM +0200, Joel Reymont wrote:
> Alistair,
>
> Thanks alot for your examples. I still have one unanswered question...
>
> How would you read a tuple of values (24, GID, Seq) like in my Erlang
> example, where 24 is one byte, GID is a 4-byte integer and Seq is a 2-
Joel Reymont wrote,
> Can I beg for examples?
I've been using parsec for binary parsing (Java class files in my case)
as a first exercise with both Haskell and combinator parsing, with a
view to applying same to network protocols.
The experience has been surprisingly pleasant. In particular, it
On Tue, 30 Aug 2005, Tomasz Zielonka wrote:
On Tue, Aug 30, 2005 at 12:41:20PM +0200, Joel Reymont wrote:
Erlang does this nicely, I replied to the LtU thread. I positively
got the impression that nobody was parsing binary data in Haskell ;).
I am doing this quite often, I apologize for not s
Can I beg for examples?
On Aug 30, 2005, at 1:29 PM, Tomasz Zielonka wrote:
BTW, if efficiency is not a primary concern, Parsec can be quite nice
for decoding binary messages of many protocols.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
On Tue, Aug 30, 2005 at 12:41:20PM +0200, Joel Reymont wrote:
> Erlang does this nicely, I replied to the LtU thread. I positively
> got the impression that nobody was parsing binary data in Haskell ;).
I am doing this quite often, I apologize for not sharing my experience
and promise to improve
Erlang does this nicely, I replied to the LtU thread. I positively
got the impression that nobody was parsing binary data in Haskell ;).
On Aug 30, 2005, at 12:29 PM, Bayley, Alistair wrote:
There's a request on LtU for a similar ability (somewhat wider in
scope,
perhaps):
http://lambda-th
> From: Cale Gibbard [mailto:[EMAIL PROTECTED]
>
> Well, here's an attempt at a start on a similar mechanism for Haskell:
>
> -- (start Packet.hs)
> module Packet where
>
> import Data.Bits
> import Data.Word
>
> class Packet a where
> readPacket :: [Word8] -> (a, [Word8])
...
Th
Well, here's an attempt at a start on a similar mechanism for Haskell:
-- (start Packet.hs)
module Packet where
import Data.Bits
import Data.Word
concatBits :: (Integral a, Bits a, Bits b) => [a] -> b
concatBits [] = 0
concatBits (x:xs) = shift (fromIntegral x) (sum (map bitSize xs)) +
c
Alistair,
Thanks alot for your examples. I still have one unanswered question...
How would you read a tuple of values (24, GID, Seq) like in my Erlang
example, where 24 is one byte, GID is a 4-byte integer and Seq is a 2-
byte word? Is there an elegant way of specifying packet format and
re
> I wrote a poker server in Erlang (link in signature) and I'm learning
> Haskell with an eye towards using it with Erlang. Erlang would take
> care of the overall control, etc. whereas Haskell would take care of
> the rest. I'm stuck with the basics I'm afraid and Haskell hackers
> don't seem to b
13 matches
Mail list logo