tinyMesh-0.1.0.0: TinyMesh - communicating with auto-meshing sensor network

Safe HaskellNone
LanguageHaskell2010

Packet.Parse

Description

Defines Parse class and its generic counterpart for easier parsing of packets.

Synopsis

Documentation

class Parse a where Source

Class of things that have a default parsing from ByteString.

Methods

parser :: Parser a Source

Instances

Parse Int 
Parse NetAddr 
Parse Packet

TODO: Hex literals

Parse Header 
(Parse a, Parse b) => Parse (a, b) 
(Parse a, Parse b, Parse c) => Parse (a, b, c) 
(Parse a, Parse b, Parse c, Parse d) => Parse (a, b, c, d) 

parseBS :: Parse a => ByteString -> a Source

Parse ByteString to any value that has Parse instance.

untilEOF :: Parser a -> Parser [a] Source

WARNING: doesn't seem to work!!!