winery-1.1.1: A compact, well-typed seralisation format for Haskell values

Copyright(c) Fumiaki Kinoshita 2019
LicenseBSD3
StabilityExperimental
Safe HaskellNone
LanguageHaskell2010

Codec.Winery.Internal

Description

Maintainer : Fumiaki Kinoshita fumiexcel@gmail.com

Internal functions and datatypes

Synopsis

Documentation

varInt :: (Bits a, Integral a) => a -> Builder Source #

newtype Decoder a Source #

The Decoder monad

Constructors

Decoder 
Instances
Monad Decoder Source # 
Instance details

Defined in Codec.Winery.Internal

Methods

(>>=) :: Decoder a -> (a -> Decoder b) -> Decoder b #

(>>) :: Decoder a -> Decoder b -> Decoder b #

return :: a -> Decoder a #

fail :: String -> Decoder a #

Functor Decoder Source # 
Instance details

Defined in Codec.Winery.Internal

Methods

fmap :: (a -> b) -> Decoder a -> Decoder b #

(<$) :: a -> Decoder b -> Decoder a #

Applicative Decoder Source # 
Instance details

Defined in Codec.Winery.Internal

Methods

pure :: a -> Decoder a #

(<*>) :: Decoder (a -> b) -> Decoder a -> Decoder b #

liftA2 :: (a -> b -> c) -> Decoder a -> Decoder b -> Decoder c #

(*>) :: Decoder a -> Decoder b -> Decoder b #

(<*) :: Decoder a -> Decoder b -> Decoder a #

data DecoderResult a Source #

Constructors

DecoderResult !Int a 
Instances
Functor DecoderResult Source # 
Instance details

Defined in Codec.Winery.Internal

Methods

fmap :: (a -> b) -> DecoderResult a -> DecoderResult b #

(<$) :: a -> DecoderResult b -> DecoderResult a #

newtype State s a Source #

A state monad. The reason being not State from transformers is to allow coercion for newtype deriving and DerivingVia.

Constructors

State 

Fields

Instances
Monad (State s) Source # 
Instance details

Defined in Codec.Winery.Internal

Methods

(>>=) :: State s a -> (a -> State s b) -> State s b #

(>>) :: State s a -> State s b -> State s b #

return :: a -> State s a #

fail :: String -> State s a #

Functor (State s) Source # 
Instance details

Defined in Codec.Winery.Internal

Methods

fmap :: (a -> b) -> State s a -> State s b #

(<$) :: a -> State s b -> State s a #

MonadFix (State s) Source # 
Instance details

Defined in Codec.Winery.Internal

Methods

mfix :: (a -> State s a) -> State s a #

Applicative (State s) Source # 
Instance details

Defined in Codec.Winery.Internal

Methods

pure :: a -> State s a #

(<*>) :: State s (a -> b) -> State s a -> State s b #

liftA2 :: (a -> b -> c) -> State s a -> State s b -> State s c #

(*>) :: State s a -> State s b -> State s b #

(<*) :: State s a -> State s b -> State s a #

evalState :: State s a -> s -> a Source #

decodeVarIntFinite :: forall a. (Num a, FiniteBits a) => Decoder a Source #

indexDefault :: a -> [a] -> Int -> a Source #

unsafeIndexV :: Unbox a => String -> Vector a -> Int -> a Source #

lookupWithIndexV :: Eq k => k -> Vector (k, v) -> Maybe (Int, v) Source #

newtype Strategy e r a Source #

A monad with Reader [r] and Either WineryException combined, used internally to build an extractor. r is used to share environment such as extractors for fixpoints.

Constructors

Strategy 

Fields

Instances
Monad (Strategy e r) Source # 
Instance details

Defined in Codec.Winery.Internal

Methods

(>>=) :: Strategy e r a -> (a -> Strategy e r b) -> Strategy e r b #

(>>) :: Strategy e r a -> Strategy e r b -> Strategy e r b #

return :: a -> Strategy e r a #

fail :: String -> Strategy e r a #

Functor (Strategy e r) Source # 
Instance details

Defined in Codec.Winery.Internal

Methods

fmap :: (a -> b) -> Strategy e r a -> Strategy e r b #

(<$) :: a -> Strategy e r b -> Strategy e r a #

MonadFix (Strategy e r) Source # 
Instance details

Defined in Codec.Winery.Internal

Methods

mfix :: (a -> Strategy e r a) -> Strategy e r a #

Applicative (Strategy e r) Source # 
Instance details

Defined in Codec.Winery.Internal

Methods

pure :: a -> Strategy e r a #

(<*>) :: Strategy e r (a -> b) -> Strategy e r a -> Strategy e r b #

liftA2 :: (a -> b -> c) -> Strategy e r a -> Strategy e r b -> Strategy e r c #

(*>) :: Strategy e r a -> Strategy e r b -> Strategy e r b #

(<*) :: Strategy e r a -> Strategy e r b -> Strategy e r a #

IsString e => Alternative (Strategy e r) Source # 
Instance details

Defined in Codec.Winery.Internal

Methods

empty :: Strategy e r a #

(<|>) :: Strategy e r a -> Strategy e r a -> Strategy e r a #

some :: Strategy e r a -> Strategy e r [a] #

many :: Strategy e r a -> Strategy e r [a] #

newtype TransFusion f g a Source #

A Bazaar (chain of indexed store comonad)-like structure which instead works for natural transformations.

Constructors

TransFusion 

Fields

Instances
Functor (TransFusion f g) Source # 
Instance details

Defined in Codec.Winery.Internal

Methods

fmap :: (a -> b) -> TransFusion f g a -> TransFusion f g b #

(<$) :: a -> TransFusion f g b -> TransFusion f g a #

Applicative (TransFusion f g) Source # 
Instance details

Defined in Codec.Winery.Internal

Methods

pure :: a -> TransFusion f g a #

(<*>) :: TransFusion f g (a -> b) -> TransFusion f g a -> TransFusion f g b #

liftA2 :: (a -> b -> c) -> TransFusion f g a -> TransFusion f g b -> TransFusion f g c #

(*>) :: TransFusion f g a -> TransFusion f g b -> TransFusion f g b #

(<*) :: TransFusion f g a -> TransFusion f g b -> TransFusion f g a #