megaparsec-9.2.1: Monadic parser combinators
Copyright © 2021–present Megaparsec contributors
License FreeBSD
Maintainer Mark Karpov <markkarpov92@gmail.com>
Stability experimental
Portability portable
Safe Haskell Safe
Language Haskell2010

Text.Megaparsec.Byte.Binary

Description

Binary-format number parsers.

Since: 9.2.0

Synopsis

Generic parsers

anyLE Source #

Arguments

:: forall a e s m. ( MonadParsec e s m, FiniteBits a, Num a, BinaryChunk ( Tokens s))
=> Maybe String

Label, if any

-> m a

Parse a little-endian number.

You may wish to call this with a visible type application:

number <- anyLE (Just "little-endian 32 bit word") @Word32

anyBE Source #

Arguments

:: forall a e s m. ( MonadParsec e s m, FiniteBits a, Num a, BinaryChunk ( Tokens s))
=> Maybe String

Label, if any

-> m a

Parse a big-endian number.

You may wish to call this with a visible type application:

number <- anyBE (Just "big-endian 32 bit word") @Word32

Parsing unsigned values

Parsing signed values