diff --git a/Data-Map-Strict-Expiring.html b/Data-Map-Strict-Expiring.html index 08b85ed..11d9781 100644 --- a/Data-Map-Strict-Expiring.html +++ b/Data-Map-Strict-Expiring.html @@ -1,4 +1,4 @@ -Data.Map.Strict.Expiring
net-mqtt-0.8.5.0: An MQTT Protocol Implementation.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Map.Strict.Expiring

Contents

Synopsis

Documentation

data Map g k a Source #

A map of values that expire after a given generation.

Instances

Instances details
Ord g => Foldable (Map g k) Source # 
Instance details

Defined in Data.Map.Strict.Expiring

Methods

fold :: Monoid m => Map g k m -> m #

foldMap :: Monoid m => (a -> m) -> Map g k a -> m #

foldMap' :: Monoid m => (a -> m) -> Map g k a -> m #

foldr :: (a -> b -> b) -> b -> Map g k a -> b #

foldr' :: (a -> b -> b) -> b -> Map g k a -> b #

foldl :: (b -> a -> b) -> b -> Map g k a -> b #

foldl' :: (b -> a -> b) -> b -> Map g k a -> b #

foldr1 :: (a -> a -> a) -> Map g k a -> a #

foldl1 :: (a -> a -> a) -> Map g k a -> a #

toList :: Map g k a -> [a] #

null :: Map g k a -> Bool #

length :: Map g k a -> Int #

elem :: Eq a => a -> Map g k a -> Bool #

maximum :: Ord a => Map g k a -> a #

minimum :: Ord a => Map g k a -> a #

sum :: Num a => Map g k a -> a #

product :: Num a => Map g k a -> a #

Functor (Map g k) Source # 
Instance details

Defined in Data.Map.Strict.Expiring

Methods

fmap :: (a -> b) -> Map g k a -> Map g k b #

(<$) :: a -> Map g k b -> Map g k a #

(Ord a, Ord g, Ord k) => Semigroup (Map g k a) Source # 
Instance details

Defined in Data.Map.Strict.Expiring

Methods

(<>) :: Map g k a -> Map g k a -> Map g k a #

sconcat :: NonEmpty (Map g k a) -> Map g k a #

stimes :: Integral b => b -> Map g k a -> Map g k a #

(Show k, Show a, Show g) => Show (Map g k a) Source # 
Instance details

Defined in Data.Map.Strict.Expiring

Methods

showsPrec :: Int -> Map g k a -> ShowS #

show :: Map g k a -> String #

showList :: [Map g k a] -> ShowS #

new :: g -> Map g k a Source #

Make a new empty Map at the starting generation.

generation :: Map g k a -> g Source #

The current generation

newGen :: (Ord k, Ord g) => g -> Map g k a -> Map g k a Source #

𝑂(log𝑛). Assign the next generation and expire any data this new generation invalidates. +Data.Map.Strict.Expiring

net-mqtt-0.8.5.0: An MQTT Protocol Implementation.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Map.Strict.Expiring

Contents

Synopsis

Documentation

data Map g k a Source #

A map of values that expire after a given generation.

Instances

Instances details
Ord g => Foldable (Map g k) Source # 
Instance details

Defined in Data.Map.Strict.Expiring

Methods

fold :: Monoid m => Map g k m -> m #

foldMap :: Monoid m => (a -> m) -> Map g k a -> m #

foldMap' :: Monoid m => (a -> m) -> Map g k a -> m #

foldr :: (a -> b -> b) -> b -> Map g k a -> b #

foldr' :: (a -> b -> b) -> b -> Map g k a -> b #

foldl :: (b -> a -> b) -> b -> Map g k a -> b #

foldl' :: (b -> a -> b) -> b -> Map g k a -> b #

foldr1 :: (a -> a -> a) -> Map g k a -> a #

foldl1 :: (a -> a -> a) -> Map g k a -> a #

toList :: Map g k a -> [a] #

null :: Map g k a -> Bool #

length :: Map g k a -> Int #

elem :: Eq a => a -> Map g k a -> Bool #

maximum :: Ord a => Map g k a -> a #

minimum :: Ord a => Map g k a -> a #

sum :: Num a => Map g k a -> a #

product :: Num a => Map g k a -> a #

Functor (Map g k) Source # 
Instance details

Defined in Data.Map.Strict.Expiring

Methods

fmap :: (a -> b) -> Map g k a -> Map g k b #

(<$) :: a -> Map g k b -> Map g k a #

(Show k, Show a, Show g) => Show (Map g k a) Source # 
Instance details

Defined in Data.Map.Strict.Expiring

Methods

showsPrec :: Int -> Map g k a -> ShowS #

show :: Map g k a -> String #

showList :: [Map g k a] -> ShowS #

new :: g -> Map g k a Source #

Make a new empty Map at the starting generation.

generation :: Map g k a -> g Source #

The current generation

newGen :: (Ord k, Ord g) => g -> Map g k a -> Map g k a Source #

𝑂(log𝑛). Assign the next generation and expire any data this new generation invalidates. The generation may never decrease. Attempts to decrease it are ignored.

insert :: (Ord k, Ord g) => g -> k -> a -> Map g k a -> Map g k a Source #

𝑂(log𝑛). Insert a new value into the map to expire after the given generation.

delete :: (Ord k, Ord g) => k -> Map g k a -> Map g k a Source #

𝑂(log𝑛). Delete an item.

lookup :: (Ord k, Ord g) => k -> Map g k a -> Maybe a Source #

𝑂(log𝑛). Lookup a value in the map. This will not return any items that have expired.

updateLookupWithKey :: (Ord g, Ord k) => g -> (k -> a -> Maybe a) -> k -> Map g k a -> (Maybe a, Map g k a) Source #

𝑂(log𝑛). Lookup and update. The function returns changed value, if it is updated. Returns the original key value if the map entry is deleted.

assocs :: Ord g => Map g k a -> [(k, a)] Source #

𝑂(𝑛). Return all current key/value associations.

for testing

inspect :: Ord k => Map g k a -> (Int, g, Int) Source #

Inspect stored size for testing.

\ No newline at end of file diff --git a/net-mqtt.haddock b/net-mqtt.haddock index c20c43e..c8342c2 100644 Binary files a/net-mqtt.haddock and b/net-mqtt.haddock differ diff --git a/net-mqtt.txt b/net-mqtt.txt index a526675..cee5ac3 100644 --- a/net-mqtt.txt +++ b/net-mqtt.txt @@ -51,7 +51,6 @@ instance GHC.Base.Functor (Data.Map.Strict.Expiring.Entry g) instance (GHC.Show.Show k, GHC.Show.Show a, GHC.Show.Show g) => GHC.Show.Show (Data.Map.Strict.Expiring.Map g k a) instance GHC.Base.Functor (Data.Map.Strict.Expiring.Map g k) instance GHC.Classes.Ord g => Data.Foldable.Foldable (Data.Map.Strict.Expiring.Map g k) -instance (GHC.Classes.Ord a, GHC.Classes.Ord g, GHC.Classes.Ord k) => GHC.Base.Semigroup (Data.Map.Strict.Expiring.Map g k a) module Data.Map.Strict.Decaying data Map k a diff --git a/src/Data.Map.Strict.Decaying.html b/src/Data.Map.Strict.Decaying.html index 28e2118..c26084b 100644 --- a/src/Data.Map.Strict.Decaying.html +++ b/src/Data.Map.Strict.Decaying.html @@ -27,161 +27,161 @@ import GHC.Conc (threadDelay) import System.Mem.Weak (deRefWeak) -data Map k a = Map { +data Map k a = Map { forall k a. Map k a -> TVar (Map POSIXTime k a) -mapVar :: TVar (Map.Map POSIXTime k a), +mapVar :: TVar (Map.Map POSIXTime k a), forall k a. Map k a -> POSIXTime maxAge :: NominalDiffTime } -expiry :: NominalDiffTime -> Map.Map POSIXTime k a -> POSIXTime +expiry :: NominalDiffTime -> Map.Map POSIXTime k a -> POSIXTime expiry :: forall k a. POSIXTime -> Map POSIXTime k a -> POSIXTime -expiry POSIXTime -ma = (forall a. Num a => a -> a -> a +expiry POSIXTime +ma = (forall a. Num a => a -> a -> a + POSIXTime -ma) forall b c a. (b -> c) -> (a -> b) -> a -> c +ma) forall b c a. (b -> c) -> (a -> b) -> a -> c . forall g k a. Map g k a -> g Map.generation -insert :: Ord k => k -> v -> Map k v -> STM () +insert :: Ord k => k -> v -> Map k v -> STM () insert :: forall k v. Ord k => k -> v -> Map k v -> STM () -insert k -k v -v (Map TVar (Map POSIXTime k v) -m POSIXTime -ma) = forall a. TVar a -> (a -> a) -> STM () +insert k +k v +v (Map TVar (Map POSIXTime k v) +m POSIXTime +ma) = forall a. TVar a -> (a -> a) -> STM () modifyTVar' TVar (Map POSIXTime k v) -m (\Map POSIXTime k v -m -> forall k g a. +m (\Map POSIXTime k v +m -> forall k g a. (Ord k, Ord g) => g -> k -> a -> Map g k a -> Map g k a Map.insert (forall k a. POSIXTime -> Map POSIXTime k a -> POSIXTime expiry POSIXTime -ma Map POSIXTime k v -m) k -k v -v Map POSIXTime k v -m) +ma Map POSIXTime k v +m) k +k v +v Map POSIXTime k v +m) -delete :: Ord k => k -> Map k v -> STM () +delete :: Ord k => k -> Map k v -> STM () delete :: forall k v. Ord k => k -> Map k v -> STM () -delete k -k (Map TVar (Map POSIXTime k v) -m POSIXTime +delete k +k (Map TVar (Map POSIXTime k v) +m POSIXTime _) = forall a. TVar a -> (a -> a) -> STM () modifyTVar' TVar (Map POSIXTime k v) -m (forall k g a. (Ord k, Ord g) => k -> Map g k a -> Map g k a +m (forall k g a. (Ord k, Ord g) => k -> Map g k a -> Map g k a Map.delete k -k) +k) -findWithDefault :: Ord k => v -> k -> Map k v -> STM v +findWithDefault :: Ord k => v -> k -> Map k v -> STM v findWithDefault :: forall k v. Ord k => v -> k -> Map k v -> STM v -findWithDefault v -d k -k Map{TVar (Map POSIXTime k v) +findWithDefault v +d k +k Map{TVar (Map POSIXTime k v) POSIXTime maxAge :: POSIXTime mapVar :: TVar (Map POSIXTime k v) maxAge :: forall k a. Map k a -> POSIXTime mapVar :: forall k a. Map k a -> TVar (Map POSIXTime k a) -..} = forall a. a -> Maybe a -> a +..} = forall a. a -> Maybe a -> a fromMaybe v -d forall b c a. (b -> c) -> (a -> b) -> a -> c +d forall b c a. (b -> c) -> (a -> b) -> a -> c . forall k g a. (Ord k, Ord g) => k -> Map g k a -> Maybe a Map.lookup k -k forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b +k forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> forall a. TVar a -> STM a readTVar TVar (Map POSIXTime k v) -mapVar +mapVar -- | All visible records. -elems :: Map k a -> STM [a] +elems :: Map k a -> STM [a] elems :: forall k a. Map k a -> STM [a] -elems Map{TVar (Map POSIXTime k a) +elems Map{TVar (Map POSIXTime k a) POSIXTime maxAge :: POSIXTime mapVar :: TVar (Map POSIXTime k a) maxAge :: forall k a. Map k a -> POSIXTime mapVar :: forall k a. Map k a -> TVar (Map POSIXTime k a) -..} = forall (t :: * -> *) a. Foldable t => t a -> [a] +..} = forall (t :: * -> *) a. Foldable t => t a -> [a] toList forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> forall a. TVar a -> STM a readTVar TVar (Map POSIXTime k a) -mapVar +mapVar -tick :: Ord k => Map k v -> IO () +tick :: Ord k => Map k v -> IO () tick :: forall k v. Ord k => Map k v -> IO () -tick Map{TVar (Map POSIXTime k v) +tick Map{TVar (Map POSIXTime k v) POSIXTime maxAge :: POSIXTime mapVar :: TVar (Map POSIXTime k v) maxAge :: forall k a. Map k a -> POSIXTime mapVar :: forall k a. Map k a -> TVar (Map POSIXTime k a) -..} = IO POSIXTime +..} = IO POSIXTime getPOSIXTime forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b ->>= \POSIXTime -t -> forall a. STM a -> IO a +>>= \POSIXTime +t -> forall a. STM a -> IO a atomically forall a b. (a -> b) -> a -> b $ forall a. TVar a -> (a -> a) -> STM () modifyTVar' TVar (Map POSIXTime k v) -mapVar (forall k g a. (Ord k, Ord g) => g -> Map g k a -> Map g k a +mapVar (forall k g a. (Ord k, Ord g) => g -> Map g k a -> Map g k a Map.newGen POSIXTime -t) +t) -updateLookupWithKey :: Ord k => (k -> a -> Maybe a) -> k -> Map k a -> STM (Maybe a) +updateLookupWithKey :: Ord k => (k -> a -> Maybe a) -> k -> Map k a -> STM (Maybe a) updateLookupWithKey :: forall k a. Ord k => (k -> a -> Maybe a) -> k -> Map k a -> STM (Maybe a) -updateLookupWithKey k -> a -> Maybe a -f k -k (Map TVar (Map POSIXTime k a) -mv POSIXTime -ma) = forall s a. TVar s -> (s -> (a, s)) -> STM a +updateLookupWithKey k -> a -> Maybe a +f k +k (Map TVar (Map POSIXTime k a) +mv POSIXTime +ma) = forall s a. TVar s -> (s -> (a, s)) -> STM a stateTVar TVar (Map POSIXTime k a) -mv (\Map POSIXTime k a -m -> forall g k a. +mv (\Map POSIXTime k a +m -> forall g k a. (Ord g, Ord k) => g -> (k -> a -> Maybe a) -> k -> Map g k a -> (Maybe a, Map g k a) Map.updateLookupWithKey (forall k a. POSIXTime -> Map POSIXTime k a -> POSIXTime expiry POSIXTime -ma Map POSIXTime k a -m) k -> a -> Maybe a -f k -k Map POSIXTime k a -m) +ma Map POSIXTime k a +m) k -> a -> Maybe a +f k +k Map POSIXTime k a +m) -new :: Ord k => NominalDiffTime -> IO (Map k a) +new :: Ord k => NominalDiffTime -> IO (Map k a) new :: forall k a. Ord k => POSIXTime -> IO (Map k a) -new POSIXTime -maxAge = forall b. ((forall a. IO a -> IO a) -> IO b) -> IO b +new POSIXTime +maxAge = forall b. ((forall a. IO a -> IO a) -> IO b) -> IO b mask forall a b. (a -> b) -> a -> b -$ \forall a. IO a -> IO a -restore -> do - POSIXTime -now <- IO POSIXTime +$ \forall a. IO a -> IO a +restore -> do + POSIXTime +now <- IO POSIXTime getPOSIXTime - TVar (Map POSIXTime k a) -var <- forall a. a -> IO (TVar a) + TVar (Map POSIXTime k a) +var <- forall a. a -> IO (TVar a) newTVarIO (forall g k a. g -> Map g k a Map.new POSIXTime -now) - Weak (TVar (Map POSIXTime k a)) -wVar <- forall a. TVar a -> IO () -> IO (Weak (TVar a)) +now) + Weak (TVar (Map POSIXTime k a)) +wVar <- forall a. TVar a -> IO () -> IO (Weak (TVar a)) mkWeakTVar TVar (Map POSIXTime k a) -var forall a b. (a -> b) -> a -> b +var forall a b. (a -> b) -> a -> b $ forall (f :: * -> *) a. Applicative f => a -> f a pure () - let m :: Map k a -m = forall k a. TVar (Map POSIXTime k a) -> POSIXTime -> Map k a + let m :: Map k a +m = forall k a. TVar (Map POSIXTime k a) -> POSIXTime -> Map k a Map TVar (Map POSIXTime k a) -var POSIXTime -maxAge +var POSIXTime +maxAge forall a. Async a -> IO () link forall (m :: * -> *) b c a. Monad m => (b -> m c) -> (a -> m b) -> a -> m c <=< forall a. IO a -> IO a -restore forall a b. (a -> b) -> a -> b +restore forall a b. (a -> b) -> a -> b $ forall a. IO a -> IO (Async a) async forall a b. (a -> b) -> a -> b $ forall (m :: * -> *) a b. @@ -189,27 +189,27 @@ m (Maybe a) -> (a -> m b) -> m () whileJust_ (forall v. Weak v -> IO (Maybe v) deRefWeak Weak (TVar (Map POSIXTime k a)) -wVar) (\TVar (Map POSIXTime k a) -m' -> forall {k} {a}. Ord k => TVar (Map POSIXTime k a) -> IO () -tick' TVar (Map POSIXTime k a) -m' forall (f :: * -> *) a b. Applicative f => f a -> f b -> f b +wVar) (\TVar (Map POSIXTime k a) +m' -> forall {k} {a}. Ord k => TVar (Map POSIXTime k a) -> IO () +tick' TVar (Map POSIXTime k a) +m' forall (f :: * -> *) a b. Applicative f => f a -> f b -> f b *> Int -> IO () threadDelay Int 1000000) forall (f :: * -> *) a. Applicative f => a -> f a pure Map k a -m +m where - tick' :: TVar (Map POSIXTime k a) -> IO () -tick' TVar (Map POSIXTime k a) -m = IO POSIXTime + tick' :: TVar (Map POSIXTime k a) -> IO () +tick' TVar (Map POSIXTime k a) +m = IO POSIXTime getPOSIXTime forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b ->>= \POSIXTime -t -> forall a. STM a -> IO a +>>= \POSIXTime +t -> forall a. STM a -> IO a atomically forall a b. (a -> b) -> a -> b $ forall a. TVar a -> (a -> a) -> STM () modifyTVar' TVar (Map POSIXTime k a) -m (forall k g a. (Ord k, Ord g) => g -> Map g k a -> Map g k a +m (forall k g a. (Ord k, Ord g) => g -> Map g k a -> Map g k a Map.newGen POSIXTime -t) +t) \ No newline at end of file diff --git a/src/Data.Map.Strict.Expiring.html b/src/Data.Map.Strict.Expiring.html index c3cca44..89d6aa3 100644 --- a/src/Data.Map.Strict.Expiring.html +++ b/src/Data.Map.Strict.Expiring.html @@ -23,12 +23,12 @@ import qualified Data.Set as Set import Prelude hiding (lookup, map) -data Entry g a = Entry { +data Entry g a = Entry { forall g a. Entry g a -> a -value :: !a, +value :: !a, forall g a. Entry g a -> g -gen :: !g -} deriving (forall a b. a -> Entry g b -> Entry g a +gen :: !g +} deriving (forall a b. a -> Entry g b -> Entry g a forall a b. (a -> b) -> Entry g a -> Entry g b forall g a b. a -> Entry g b -> Entry g a forall g a b. (a -> b) -> Entry g a -> Entry g b @@ -39,7 +39,7 @@ $c<$ :: forall g a b. a -> Entry g b -> Entry g a fmap :: forall a b. (a -> b) -> Entry g a -> Entry g b $cfmap :: forall g a b. (a -> b) -> Entry g a -> Entry g b -Functor, Int -> Entry g a -> ShowS +Functor, Int -> Entry g a -> ShowS forall a. (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a forall g a. (Show a, Show g) => Int -> Entry g a -> ShowS @@ -54,17 +54,17 @@ Show) -- | A map of values that expire after a given generation. -data Map g k a = Map { +data Map g k a = Map { -- | Primary store of values. forall g k a. Map g k a -> Map k (Entry g a) -map :: !(Map.Map k (Entry g a)), +map :: !(Map.Map k (Entry g a)), -- | The current generation forall g k a. Map g k a -> g -generation :: !g, +generation :: !g, -- | A map of generations to keys that are expiring at that generation. forall g k a. Map g k a -> Map g (Set k) -aging :: !(Map.Map g (Set k)) -} deriving (forall a b. a -> Map g k b -> Map g k a +aging :: !(Map.Map g (Set k)) +} deriving (forall a b. a -> Map g k b -> Map g k a forall a b. (a -> b) -> Map g k a -> Map g k b forall g k a b. a -> Map g k b -> Map g k a forall g k a b. (a -> b) -> Map g k a -> Map g k b @@ -75,7 +75,7 @@ $c<$ :: forall g k a b. a -> Map g k b -> Map g k a fmap :: forall a b. (a -> b) -> Map g k a -> Map g k b $cfmap :: forall g k a b. (a -> b) -> Map g k a -> Map g k b -Functor, Int -> Map g k a -> ShowS +Functor, Int -> Map g k a -> ShowS forall a. (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a forall g k a. (Show k, Show a, Show g) => Int -> Map g k a -> ShowS @@ -89,14 +89,14 @@ $cshowsPrec :: forall g k a. (Show k, Show a, Show g) => Int -> Map g k a -> ShowS Show) -instance Ord g => Foldable (Map g k) where - foldMap :: forall m a. Monoid m => (a -> m) -> Map g k a -> m -foldMap a -> m -f = forall (t :: * -> *) m a. +instance Ord g => Foldable (Map g k) where + foldMap :: forall m a. Monoid m => (a -> m) -> Map g k a -> m +foldMap a -> m +f = forall (t :: * -> *) m a. (Foldable t, Monoid m) => (a -> m) -> t a -> m foldMap (a -> m -f forall b c a. (b -> c) -> (a -> b) -> a -> c +f forall b c a. (b -> c) -> (a -> b) -> a -> c . forall g a. Entry g a -> a value) forall b c a. (b -> c) -> (a -> b) -> a -> c . forall k a. Map k a -> [a] @@ -104,76 +104,56 @@ . forall g k a. Map g k a -> Map k (Entry g a) map -instance (Ord a, Ord g, Ord k) => Semigroup (Map g k a) where - Map Map k (Entry g a) -m1 g -g1 Map g (Set k) -a1 <> :: Map g k a -> Map g k a -> Map g k a -<> Map Map k (Entry g a) -m2 g -g2 Map g (Set k) -a2 = forall g k a. Map k (Entry g a) -> g -> Map g (Set k) -> Map g k a -Map (Map k (Entry g a) -m1 forall a. Semigroup a => a -> a -> a -<> Map k (Entry g a) -m2) (forall a. Ord a => a -> a -> a -max g -g1 g -g2) (Map g (Set k) -a1 forall a. Semigroup a => a -> a -> a -<> Map g (Set k) -a2) - --- | Make a new empty Map at the starting generation. -new :: g -> Map g k a -new :: forall g k a. g -> Map g k a -new g -g = forall g k a. Map k (Entry g a) -> g -> Map g (Set k) -> Map g k a +-- | Make a new empty Map at the starting generation. +new :: g -> Map g k a +new :: forall g k a. g -> Map g k a +new g +g = forall g k a. Map k (Entry g a) -> g -> Map g (Set k) -> Map g k a Map forall k a. Map k a Map.empty g -g forall k a. Map k a +g forall k a. Map k a Map.empty - --- | 𝑂(log𝑛). Assign the next generation and expire any data this new generation invalidates. --- The generation may never decrease. Attempts to decrease it are ignored. -newGen :: (Ord k, Ord g) => g -> Map g k a -> Map g k a -newGen :: forall k g a. (Ord k, Ord g) => g -> Map g k a -> Map g k a -newGen g -g Map g k a -m - | g -g forall a. Ord a => a -> a -> Bool + +-- | 𝑂(log𝑛). Assign the next generation and expire any data this new generation invalidates. +-- The generation may never decrease. Attempts to decrease it are ignored. +newGen :: (Ord k, Ord g) => g -> Map g k a -> Map g k a +newGen :: forall k g a. (Ord k, Ord g) => g -> Map g k a -> Map g k a +newGen g +g Map g k a +m + | g +g forall a. Ord a => a -> a -> Bool > forall g k a. Map g k a -> g generation Map g k a -m = forall g k a. (Ord g, Ord k) => Map g k a -> Map g k a +m = forall g k a. (Ord g, Ord k) => Map g k a -> Map g k a expire Map g k a -m { generation :: g +m { generation :: g generation = g -g } - | Bool +g } + | Bool otherwise = Map g k a -m - --- | 𝑂(log𝑛). Insert a new value into the map to expire after the given generation. -insert :: (Ord k, Ord g) => g -> k -> a -> Map g k a -> Map g k a -insert :: forall k g a. +m + +-- | 𝑂(log𝑛). Insert a new value into the map to expire after the given generation. +insert :: (Ord k, Ord g) => g -> k -> a -> Map g k a -> Map g k a +insert :: forall k g a. (Ord k, Ord g) => g -> k -> a -> Map g k a -> Map g k a -insert g -g k +insert g +g k _ a -_ Map g k a -m | g -g forall a. Ord a => a -> a -> Bool +_ Map g k a +m | g +g forall a. Ord a => a -> a -> Bool < forall g k a. Map g k a -> g generation Map g k a -m = Map g k a -m -insert g -g k -k a -v m :: Map g k a -m@Map{g +m = Map g k a +m +insert g +g k +k a +v m :: Map g k a +m@Map{g Map k (Entry g a) Map g (Set k) aging :: Map g (Set k) @@ -182,48 +162,48 @@ aging :: forall g k a. Map g k a -> Map g (Set k) map :: forall g k a. Map g k a -> Map k (Entry g a) generation :: forall g k a. Map g k a -> g -..} = Map g k a -m { - map :: Map k (Entry g a) +..} = Map g k a +m { + map :: Map k (Entry g a) map = forall k a. Ord k => k -> a -> Map k a -> Map k a Map.insert k -k (forall g a. a -> g -> Entry g a +k (forall g a. a -> g -> Entry g a Entry a -v g -g) Map k (Entry g a) -map, - aging :: Map g (Set k) +v g +g) Map k (Entry g a) +map, + aging :: Map g (Set k) aging = forall k a. Ord k => (a -> a -> a) -> k -> a -> Map k a -> Map k a Map.insertWith forall a. Semigroup a => a -> a -> a (<>) g -g (forall a. a -> Set a +g (forall a. a -> Set a Set.singleton k -k) Map g (Set k) -aging -} - --- | 𝑂(log𝑛). Lookup and update. --- The function returns changed value, if it is updated. Returns the original key value if the map entry is deleted. -updateLookupWithKey :: (Ord g, Ord k) => g -> (k -> a -> Maybe a) -> k -> Map g k a -> (Maybe a, Map g k a) -updateLookupWithKey :: forall g k a. +k) Map g (Set k) +aging +} + +-- | 𝑂(log𝑛). Lookup and update. +-- The function returns changed value, if it is updated. Returns the original key value if the map entry is deleted. +updateLookupWithKey :: (Ord g, Ord k) => g -> (k -> a -> Maybe a) -> k -> Map g k a -> (Maybe a, Map g k a) +updateLookupWithKey :: forall g k a. (Ord g, Ord k) => g -> (k -> a -> Maybe a) -> k -> Map g k a -> (Maybe a, Map g k a) -updateLookupWithKey g -g k -> a -> Maybe a +updateLookupWithKey g +g k -> a -> Maybe a _ k -_ Map g k a -m | g -g forall a. Ord a => a -> a -> Bool +_ Map g k a +m | g +g forall a. Ord a => a -> a -> Bool < forall g k a. Map g k a -> g generation Map g k a -m = (forall a. Maybe a +m = (forall a. Maybe a Nothing, Map g k a -m) -updateLookupWithKey g -g k -> a -> Maybe a -f k -k m :: Map g k a -m@Map{g +m) +updateLookupWithKey g +g k -> a -> Maybe a +f k +k m :: Map g k a +m@Map{g Map g (Set k) Map k (Entry g a) aging :: Map g (Set k) @@ -232,83 +212,83 @@ aging :: forall g k a. Map g k a -> Map g (Set k) map :: forall g k a. Map g k a -> Map k (Entry g a) generation :: forall g k a. Map g k a -> g -..} = case forall k a. +..} = case forall k a. Ord k => (k -> a -> Maybe a) -> k -> Map k a -> (Maybe a, Map k a) Map.updateLookupWithKey forall {p} {g}. p -> Entry g a -> Maybe (Entry g a) -f' k -k Map k (Entry g a) -map of - (Maybe (Entry g a) +f' k +k Map k (Entry g a) +map of + (Maybe (Entry g a) Nothing, Map k (Entry g a) _) -> (forall a. Maybe a Nothing, Map g k a -m) - (Just Entry g a -e, Map k (Entry g a) -m') -> (forall a. a -> Maybe a +m) + (Just Entry g a +e, Map k (Entry g a) +m') -> (forall a. a -> Maybe a Just (forall g a. Entry g a -> a value Entry g a -e), Map g k a -m { - map :: Map k (Entry g a) +e), Map g k a +m { + map :: Map k (Entry g a) map = Map k (Entry g a) -m', - aging :: Map g (Set k) +m', + aging :: Map g (Set k) aging = forall k a. Ord k => k -> a -> Map k a -> Map k a Map.insert g -g (forall a. a -> Set a +g (forall a. a -> Set a Set.singleton k -k) (forall g k. +k) (forall g k. (Ord g, Ord k) => g -> k -> Map g (Set k) -> Map g (Set k) removeAging (forall g a. Entry g a -> g gen Entry g a -e) k -k Map g (Set k) -aging) - }) - where - f' :: p -> Entry g a -> Maybe (Entry g a) -f' p -_ Entry g a -e = (forall g a. a -> g -> Entry g a +e) k +k Map g (Set k) +aging) + }) + where + f' :: p -> Entry g a -> Maybe (Entry g a) +f' p +_ Entry g a +e = (forall g a. a -> g -> Entry g a `Entry` g -g) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b +g) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> k -> a -> Maybe a -f k -k (forall g a. Entry g a -> a +f k +k (forall g a. Entry g a -> a value Entry g a -e) - -removeAging :: (Ord g, Ord k) => g -> k -> Map.Map g (Set k) -> Map.Map g (Set k) -removeAging :: forall g k. +e) + +removeAging :: (Ord g, Ord k) => g -> k -> Map.Map g (Set k) -> Map.Map g (Set k) +removeAging :: forall g k. (Ord g, Ord k) => g -> k -> Map g (Set k) -> Map g (Set k) -removeAging g -g k -k = forall k a. Ord k => (a -> Maybe a) -> k -> Map k a -> Map k a +removeAging g +g k +k = forall k a. Ord k => (a -> Maybe a) -> k -> Map k a -> Map k a Map.update (forall {a}. Set a -> Maybe (Set a) -nonNull forall b c a. (b -> c) -> (a -> b) -> a -> c +nonNull forall b c a. (b -> c) -> (a -> b) -> a -> c . forall a. Ord a => a -> Set a -> Set a Set.delete k -k) g -g - where nonNull :: Set a -> Maybe (Set a) -nonNull Set a -s = if forall a. Set a -> Bool +k) g +g + where nonNull :: Set a -> Maybe (Set a) +nonNull Set a +s = if forall a. Set a -> Bool Set.null Set a -s then forall a. Maybe a +s then forall a. Maybe a Nothing else forall a. a -> Maybe a Just Set a -s - --- | 𝑂(log𝑛). Lookup a value in the map. --- This will not return any items that have expired. -lookup :: (Ord k, Ord g) => k -> Map g k a -> Maybe a -lookup :: forall k g a. (Ord k, Ord g) => k -> Map g k a -> Maybe a -lookup k -k Map{g +s + +-- | 𝑂(log𝑛). Lookup a value in the map. +-- This will not return any items that have expired. +lookup :: (Ord k, Ord g) => k -> Map g k a -> Maybe a +lookup :: forall k g a. (Ord k, Ord g) => k -> Map g k a -> Maybe a +lookup k +k Map{g Map k (Entry g a) Map g (Set k) aging :: Map g (Set k) @@ -317,19 +297,19 @@ aging :: forall g k a. Map g k a -> Map g (Set k) map :: forall g k a. Map g k a -> Map k (Entry g a) generation :: forall g k a. Map g k a -> g -..} = forall g a. Entry g a -> a +..} = forall g a. Entry g a -> a value forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> forall k a. Ord k => k -> Map k a -> Maybe a Map.lookup k -k Map k (Entry g a) -map - --- | 𝑂(log𝑛). Delete an item. -delete :: (Ord k, Ord g) => k -> Map g k a -> Map g k a -delete :: forall k g a. (Ord k, Ord g) => k -> Map g k a -> Map g k a -delete k -k m :: Map g k a -m@Map{g +k Map k (Entry g a) +map + +-- | 𝑂(log𝑛). Delete an item. +delete :: (Ord k, Ord g) => k -> Map g k a -> Map g k a +delete :: forall k g a. (Ord k, Ord g) => k -> Map g k a -> Map g k a +delete k +k m :: Map g k a +m@Map{g Map k (Entry g a) Map g (Set k) aging :: Map g (Set k) @@ -338,37 +318,37 @@ aging :: forall g k a. Map g k a -> Map g (Set k) map :: forall g k a. Map g k a -> Map k (Entry g a) generation :: forall g k a. Map g k a -> g -..} = case forall k a. Ord k => k -> Map k a -> Maybe a +..} = case forall k a. Ord k => k -> Map k a -> Maybe a Map.lookup k -k Map k (Entry g a) -map of - Maybe (Entry g a) +k Map k (Entry g a) +map of + Maybe (Entry g a) Nothing -> Map g k a -m - Just Entry{g +m + Just Entry{g a gen :: g value :: a gen :: forall g a. Entry g a -> g value :: forall g a. Entry g a -> a -..} -> Map g k a -m { map :: Map k (Entry g a) +..} -> Map g k a +m { map :: Map k (Entry g a) map = forall k a. Ord k => k -> Map k a -> Map k a Map.delete k -k Map k (Entry g a) -map, aging :: Map g (Set k) +k Map k (Entry g a) +map, aging :: Map g (Set k) aging = forall g k. (Ord g, Ord k) => g -> k -> Map g (Set k) -> Map g (Set k) removeAging g -gen k -k Map g (Set k) -aging } - --- | 𝑂(𝑛). Return all current key/value associations. -assocs :: Ord g => Map g k a -> [(k,a)] -assocs :: forall g k a. Ord g => Map g k a -> [(k, a)] -assocs Map{g +gen k +k Map g (Set k) +aging } + +-- | 𝑂(𝑛). Return all current key/value associations. +assocs :: Ord g => Map g k a -> [(k,a)] +assocs :: forall g k a. Ord g => Map g k a -> [(k, a)] +assocs Map{g Map g (Set k) Map k (Entry g a) aging :: Map g (Set k) @@ -377,18 +357,18 @@ aging :: forall g k a. Map g k a -> Map g (Set k) map :: forall g k a. Map g k a -> Map k (Entry g a) generation :: forall g k a. Map g k a -> g -..} = forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b +..} = forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap forall g a. Entry g a -> a value forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> forall k a. Map k a -> [(k, a)] Map.assocs Map k (Entry g a) -map - --- | 𝑂(log𝑛). Expire older generation items. -expire :: (Ord g, Ord k) => Map g k a -> Map g k a -expire :: forall g k a. (Ord g, Ord k) => Map g k a -> Map g k a -expire m :: Map g k a -m@Map{g +map + +-- | 𝑂(log𝑛). Expire older generation items. +expire :: (Ord g, Ord k) => Map g k a -> Map g k a +expire :: forall g k a. (Ord g, Ord k) => Map g k a -> Map g k a +expire m :: Map g k a +m@Map{g Map g (Set k) Map k (Entry g a) aging :: Map g (Set k) @@ -397,43 +377,43 @@ aging :: forall g k a. Map g k a -> Map g (Set k) map :: forall g k a. Map g k a -> Map k (Entry g a) generation :: forall g k a. Map g k a -> g -..} = Map g k a -m{ map :: Map k (Entry g a) +..} = Map g k a +m{ map :: Map k (Entry g a) map = Map k (Entry g a) -map', aging :: Map g (Set k) +map', aging :: Map g (Set k) aging = Map g (Set k) -aging'} - where - (Map g (Set k) -todo, Maybe (Set k) -exact, Map g (Set k) -later) = forall k a. Ord k => k -> Map k a -> (Map k a, Maybe a, Map k a) +aging'} + where + (Map g (Set k) +todo, Maybe (Set k) +exact, Map g (Set k) +later) = forall k a. Ord k => k -> Map k a -> (Map k a, Maybe a, Map k a) Map.splitLookup g -generation Map g (Set k) -aging - aging' :: Map g (Set k) -aging' = Map g (Set k) -later forall a. Semigroup a => a -> a -> a +generation Map g (Set k) +aging + aging' :: Map g (Set k) +aging' = Map g (Set k) +later forall a. Semigroup a => a -> a -> a <> forall b a. b -> (a -> b) -> Maybe a -> b maybe forall a. Monoid a => a mempty (forall k a. k -> a -> Map k a Map.singleton g -generation) Maybe (Set k) -exact - map' :: Map k (Entry g a) -map' = forall (t :: * -> *) a b. +generation) Maybe (Set k) +exact + map' :: Map k (Entry g a) +map' = forall (t :: * -> *) a b. Foldable t => (a -> b -> b) -> b -> t a -> b foldr forall k a. Ord k => k -> Map k a -> Map k a Map.delete Map k (Entry g a) -map (forall (t :: * -> *) m. (Foldable t, Monoid m) => t m -> m +map (forall (t :: * -> *) m. (Foldable t, Monoid m) => t m -> m fold Map g (Set k) -todo) - --- | Inspect stored size for testing. -inspect :: Ord k => Map g k a -> (Int, g, Int) -inspect :: forall k g a. Ord k => Map g k a -> (Int, g, Int) -inspect Map{g +todo) + +-- | Inspect stored size for testing. +inspect :: Ord k => Map g k a -> (Int, g, Int) +inspect :: forall k g a. Ord k => Map g k a -> (Int, g, Int) +inspect Map{g Map k (Entry g a) Map g (Set k) aging :: Map g (Set k) @@ -442,12 +422,12 @@ aging :: forall g k a. Map g k a -> Map g (Set k) map :: forall g k a. Map g k a -> Map k (Entry g a) generation :: forall g k a. Map g k a -> g -..} = (forall k a. Map k a -> Int +..} = (forall k a. Map k a -> Int Map.size Map k (Entry g a) -map, g -generation, forall (t :: * -> *) a. Foldable t => t a -> Int +map, g +generation, forall (t :: * -> *) a. Foldable t => t a -> Int length forall a b. (a -> b) -> a -> b $ forall (t :: * -> *) m. (Foldable t, Monoid m) => t m -> m fold Map g (Set k) -aging) - \ No newline at end of file +aging) + \ No newline at end of file diff --git a/src/Network.MQTT.Arbitrary.html b/src/Network.MQTT.Arbitrary.html index d184d7d..fcc1e56 100644 --- a/src/Network.MQTT.Arbitrary.html +++ b/src/Network.MQTT.Arbitrary.html @@ -35,13 +35,13 @@ -- | Arbitrary type fitting variable integers. -newtype SizeT = SizeT Int deriving(SizeT -> SizeT -> Bool +newtype SizeT = SizeT Int deriving(SizeT -> SizeT -> Bool forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a /= :: SizeT -> SizeT -> Bool $c/= :: SizeT -> SizeT -> Bool == :: SizeT -> SizeT -> Bool $c== :: SizeT -> SizeT -> Bool -Eq, Int -> SizeT -> ShowS +Eq, Int -> SizeT -> ShowS [SizeT] -> ShowS SizeT -> String forall a. @@ -54,8 +54,8 @@ $cshowsPrec :: Int -> SizeT -> ShowS Show) -instance Arbitrary SizeT where - arbitrary :: Gen SizeT +instance Arbitrary SizeT where + arbitrary :: Gen SizeT arbitrary = Int -> SizeT SizeT forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> forall a. [Gen a] -> Gen a @@ -76,9 +76,9 @@ 2097152, Int 268435455)] -instance Arbitrary LastWill where - arbitrary :: Gen LastWill -arbitrary = Bool -> QoS -> ByteString -> ByteString -> [Property] -> LastWill +instance Arbitrary LastWill where + arbitrary :: Gen LastWill +arbitrary = Bool -> QoS -> ByteString -> ByteString -> [Property] -> LastWill LastWill forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> forall a. Arbitrary a => Gen a arbitrary forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b @@ -91,33 +91,33 @@ <*> forall a. Arbitrary a => Gen a arbitrary -instance Arbitrary ProtocolLevel where arbitrary :: Gen ProtocolLevel -arbitrary = forall a. (Bounded a, Enum a) => Gen a +instance Arbitrary ProtocolLevel where arbitrary :: Gen ProtocolLevel +arbitrary = forall a. (Bounded a, Enum a) => Gen a arbitraryBoundedEnum -instance Arbitrary ConnectRequest where - arbitrary :: Gen ConnectRequest -arbitrary = do - Maybe ByteString -_username <- Gen (Maybe ByteString) +instance Arbitrary ConnectRequest where + arbitrary :: Gen ConnectRequest +arbitrary = do + Maybe ByteString +_username <- Gen (Maybe ByteString) mastr - Maybe ByteString -_password <- Gen (Maybe ByteString) + Maybe ByteString +_password <- Gen (Maybe ByteString) mastr - ByteString -_connID <- Gen ByteString + ByteString +_connID <- Gen ByteString astr - Bool -_cleanSession <- forall a. Arbitrary a => Gen a + Bool +_cleanSession <- forall a. Arbitrary a => Gen a arbitrary - Word16 -_keepAlive <- forall a. Arbitrary a => Gen a + Word16 +_keepAlive <- forall a. Arbitrary a => Gen a arbitrary - Maybe LastWill -_lastWill <- forall a. Arbitrary a => Gen a + Maybe LastWill +_lastWill <- forall a. Arbitrary a => Gen a arbitrary - [Property] -_connProperties <- forall a. Arbitrary a => Gen a + [Property] +_connProperties <- forall a. Arbitrary a => Gen a arbitrary forall (f :: * -> *) a. Applicative f => a -> f a @@ -166,18 +166,18 @@ <$> forall a. Arbitrary a => Gen a arbitrary -instance Arbitrary QoS where - arbitrary :: Gen QoS -arbitrary = forall a. (Bounded a, Enum a) => Gen a +instance Arbitrary QoS where + arbitrary :: Gen QoS +arbitrary = forall a. (Bounded a, Enum a) => Gen a arbitraryBoundedEnum -instance Arbitrary SessionReuse where arbitrary :: Gen SessionReuse -arbitrary = forall a. (Bounded a, Enum a) => Gen a +instance Arbitrary SessionReuse where arbitrary :: Gen SessionReuse +arbitrary = forall a. (Bounded a, Enum a) => Gen a arbitraryBoundedEnum instance Arbitrary ConnACKFlags where - arbitrary :: Gen ConnACKFlags -arbitrary = SessionReuse -> ConnACKRC -> [Property] -> ConnACKFlags + arbitrary :: Gen ConnACKFlags +arbitrary = SessionReuse -> ConnACKRC -> [Property] -> ConnACKFlags ConnACKFlags forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> forall a. Arbitrary a => Gen a arbitrary forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b @@ -185,51 +185,51 @@ arbitrary forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> forall a. Arbitrary a => Gen a arbitrary - shrink :: ConnACKFlags -> [ConnACKFlags] -shrink (ConnACKFlags SessionReuse -b ConnACKRC -c [Property] -pl) + shrink :: ConnACKFlags -> [ConnACKFlags] +shrink (ConnACKFlags SessionReuse +b ConnACKRC +c [Property] +pl) | forall (t :: * -> *) a. Foldable t => t a -> Bool null [Property] -pl = [] +pl = [] | Bool otherwise = SessionReuse -> ConnACKRC -> [Property] -> ConnACKFlags ConnACKFlags SessionReuse -b ConnACKRC -c forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b +b ConnACKRC +c forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> forall a. Arbitrary a => a -> [a] shrink [Property] -pl +pl -instance Arbitrary PublishRequest where - arbitrary :: Gen PublishRequest -arbitrary = do - Bool -_pubDup <- forall a. Arbitrary a => Gen a +instance Arbitrary PublishRequest where + arbitrary :: Gen PublishRequest +arbitrary = do + Bool +_pubDup <- forall a. Arbitrary a => Gen a arbitrary - QoS -_pubQoS <- forall a. Arbitrary a => Gen a + QoS +_pubQoS <- forall a. Arbitrary a => Gen a arbitrary - Bool -_pubRetain <- forall a. Arbitrary a => Gen a + Bool +_pubRetain <- forall a. Arbitrary a => Gen a arbitrary - ByteString -_pubTopic <- Gen ByteString + ByteString +_pubTopic <- Gen ByteString astr - Word16 -_pubPktID <- if QoS -_pubQoS forall a. Eq a => a -> a -> Bool + Word16 +_pubPktID <- if QoS +_pubQoS forall a. Eq a => a -> a -> Bool == QoS QoS0 then forall (f :: * -> *) a. Applicative f => a -> f a pure Word16 0 else forall a. Arbitrary a => Gen a arbitrary - ByteString -_pubBody <- Gen ByteString + ByteString +_pubBody <- Gen ByteString astr - [Property] -_pubProps <- forall a. Arbitrary a => Gen a + [Property] +_pubProps <- forall a. Arbitrary a => Gen a arbitrary forall (f :: * -> *) a. Applicative f => a -> f a pure PublishRequest{Bool @@ -253,9 +253,9 @@ _pubDup :: Bool ..} -instance Arbitrary PubACK where - arbitrary :: Gen PubACK -arbitrary = Word16 -> Word8 -> [Property] -> PubACK +instance Arbitrary PubACK where + arbitrary :: Gen PubACK +arbitrary = Word16 -> Word8 -> [Property] -> PubACK PubACK forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> forall a. Arbitrary a => Gen a arbitrary forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b @@ -264,9 +264,9 @@ <*> forall a. Arbitrary a => Gen a arbitrary -instance Arbitrary PubREL where - arbitrary :: Gen PubREL -arbitrary = Word16 -> Word8 -> [Property] -> PubREL +instance Arbitrary PubREL where + arbitrary :: Gen PubREL +arbitrary = Word16 -> Word8 -> [Property] -> PubREL PubREL forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> forall a. Arbitrary a => Gen a arbitrary forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b @@ -275,9 +275,9 @@ <*> forall a. Arbitrary a => Gen a arbitrary -instance Arbitrary PubREC where - arbitrary :: Gen PubREC -arbitrary = Word16 -> Word8 -> [Property] -> PubREC +instance Arbitrary PubREC where + arbitrary :: Gen PubREC +arbitrary = Word16 -> Word8 -> [Property] -> PubREC PubREC forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> forall a. Arbitrary a => Gen a arbitrary forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b @@ -286,9 +286,9 @@ <*> forall a. Arbitrary a => Gen a arbitrary -instance Arbitrary PubCOMP where - arbitrary :: Gen PubCOMP -arbitrary = Word16 -> Word8 -> [Property] -> PubCOMP +instance Arbitrary PubCOMP where + arbitrary :: Gen PubCOMP +arbitrary = Word16 -> Word8 -> [Property] -> PubCOMP PubCOMP forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> forall a. Arbitrary a => Gen a arbitrary forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b @@ -298,62 +298,62 @@ arbitrary instance Arbitrary SubscribeRequest where - arbitrary :: Gen SubscribeRequest -arbitrary = forall a. Arbitrary a => Gen a + arbitrary :: Gen SubscribeRequest +arbitrary = forall a. Arbitrary a => Gen a arbitrary forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b ->>= \Word16 -pid -> forall a. Random a => (a, a) -> Gen a +>>= \Word16 +pid -> forall a. Random a => (a, a) -> Gen a choose (Int 1,Int 11) forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b ->>= \Int -n -> Word16 +>>= \Int +n -> Word16 -> [(ByteString, SubOptions)] -> [Property] -> SubscribeRequest SubscribeRequest Word16 -pid forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b +pid forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> forall a. Int -> Gen a -> Gen [a] vectorOf Int -n Gen (ByteString, SubOptions) -sub forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b +n Gen (ByteString, SubOptions) +sub forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> forall a. Arbitrary a => Gen a arbitrary - where sub :: Gen (ByteString, SubOptions) -sub = forall (f :: * -> *) a b c. + where sub :: Gen (ByteString, SubOptions) +sub = forall (f :: * -> *) a b c. Applicative f => (a -> b -> c) -> f a -> f b -> f c liftA2 (,) Gen ByteString astr forall a. Arbitrary a => Gen a arbitrary - shrink :: SubscribeRequest -> [SubscribeRequest] -shrink (SubscribeRequest Word16 -w [(ByteString, SubOptions)] -s [Property] -p) = + shrink :: SubscribeRequest -> [SubscribeRequest] +shrink (SubscribeRequest Word16 +w [(ByteString, SubOptions)] +s [Property] +p) = if forall (t :: * -> *) a. Foldable t => t a -> Int length [(ByteString, SubOptions)] -s forall a. Ord a => a -> a -> Bool +s forall a. Ord a => a -> a -> Bool < Int 2 then [] else [Word16 -> [(ByteString, SubOptions)] -> [Property] -> SubscribeRequest SubscribeRequest Word16 -w (forall a. Int -> [a] -> [a] +w (forall a. Int -> [a] -> [a] take Int 1 [(ByteString, SubOptions)] -s) [Property] -p' | Bool -> Bool +s) [Property] +p' | Bool -> Bool not (forall (t :: * -> *) a. Foldable t => t a -> Bool null [Property] -p), [Property] -p' <- forall a. (a -> [a]) -> [a] -> [[a]] +p), [Property] +p' <- forall a. (a -> [a]) -> [a] -> [[a]] shrinkList (forall a b. a -> b -> a const []) [Property] -p] +p] -instance Arbitrary SubOptions where - arbitrary :: Gen SubOptions -arbitrary = RetainHandling -> Bool -> Bool -> QoS -> SubOptions +instance Arbitrary SubOptions where + arbitrary :: Gen SubOptions +arbitrary = RetainHandling -> Bool -> Bool -> QoS -> SubOptions SubOptions forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> forall a. (Bounded a, Enum a) => Gen a arbitraryBoundedEnum forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b @@ -364,104 +364,104 @@ <*> forall a. Arbitrary a => Gen a arbitrary -instance Arbitrary SubErr where arbitrary :: Gen SubErr -arbitrary = forall a. (Bounded a, Enum a) => Gen a +instance Arbitrary SubErr where arbitrary :: Gen SubErr +arbitrary = forall a. (Bounded a, Enum a) => Gen a arbitraryBoundedEnum instance Arbitrary SubscribeResponse where - arbitrary :: Gen SubscribeResponse -arbitrary = forall a. Arbitrary a => Gen a + arbitrary :: Gen SubscribeResponse +arbitrary = forall a. Arbitrary a => Gen a arbitrary forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b ->>= \Word16 -pid -> forall a. Random a => (a, a) -> Gen a +>>= \Word16 +pid -> forall a. Random a => (a, a) -> Gen a choose (Int 1,Int 11) forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b ->>= \Int -n -> Word16 -> [Either SubErr QoS] -> [Property] -> SubscribeResponse +>>= \Int +n -> Word16 -> [Either SubErr QoS] -> [Property] -> SubscribeResponse SubscribeResponse Word16 -pid forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b +pid forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> forall a. Int -> Gen a -> Gen [a] vectorOf Int -n forall a. Arbitrary a => Gen a +n forall a. Arbitrary a => Gen a arbitrary forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> forall a. Arbitrary a => Gen a arbitrary - shrink :: SubscribeResponse -> [SubscribeResponse] -shrink (SubscribeResponse Word16 -pid [Either SubErr QoS] -l [Property] -props) + shrink :: SubscribeResponse -> [SubscribeResponse] +shrink (SubscribeResponse Word16 +pid [Either SubErr QoS] +l [Property] +props) | forall (t :: * -> *) a. Foldable t => t a -> Int length [Either SubErr QoS] -l forall a. Eq a => a -> a -> Bool +l forall a. Eq a => a -> a -> Bool == Int 1 = [] | Bool otherwise = [Word16 -> [Either SubErr QoS] -> [Property] -> SubscribeResponse SubscribeResponse Word16 -pid [Either SubErr QoS] -sl [Property] -props | [Either SubErr QoS] -sl <- forall a. (a -> [a]) -> [a] -> [[a]] +pid [Either SubErr QoS] +sl [Property] +props | [Either SubErr QoS] +sl <- forall a. (a -> [a]) -> [a] -> [[a]] shrinkList (forall a b. a -> b -> a const []) [Either SubErr QoS] -l, Bool -> Bool +l, Bool -> Bool not (forall (t :: * -> *) a. Foldable t => t a -> Bool null [Either SubErr QoS] -sl)] +sl)] instance Arbitrary UnsubscribeRequest where - arbitrary :: Gen UnsubscribeRequest -arbitrary = forall a. Arbitrary a => Gen a + arbitrary :: Gen UnsubscribeRequest +arbitrary = forall a. Arbitrary a => Gen a arbitrary forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b ->>= \Word16 -pid -> forall a. Random a => (a, a) -> Gen a +>>= \Word16 +pid -> forall a. Random a => (a, a) -> Gen a choose (Int 1,Int 11) forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b ->>= \Int -n -> Word16 -> [ByteString] -> [Property] -> UnsubscribeRequest +>>= \Int +n -> Word16 -> [ByteString] -> [Property] -> UnsubscribeRequest UnsubscribeRequest Word16 -pid forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b +pid forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> forall a. Int -> Gen a -> Gen [a] vectorOf Int -n Gen ByteString +n Gen ByteString astr forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> forall a. Arbitrary a => Gen a arbitrary - shrink :: UnsubscribeRequest -> [UnsubscribeRequest] -shrink (UnsubscribeRequest Word16 -p [ByteString] -l [Property] -props) + shrink :: UnsubscribeRequest -> [UnsubscribeRequest] +shrink (UnsubscribeRequest Word16 +p [ByteString] +l [Property] +props) | forall (t :: * -> *) a. Foldable t => t a -> Int length [ByteString] -l forall a. Eq a => a -> a -> Bool +l forall a. Eq a => a -> a -> Bool == Int 1 = [] | Bool otherwise = [Word16 -> [ByteString] -> [Property] -> UnsubscribeRequest UnsubscribeRequest Word16 -p [ByteString] -sl [Property] -props | [ByteString] -sl <- forall a. (a -> [a]) -> [a] -> [[a]] +p [ByteString] +sl [Property] +props | [ByteString] +sl <- forall a. (a -> [a]) -> [a] -> [[a]] shrinkList (forall a b. a -> b -> a const []) [ByteString] -l, Bool -> Bool +l, Bool -> Bool not (forall (t :: * -> *) a. Foldable t => t a -> Bool null [ByteString] -sl)] +sl)] -instance Arbitrary UnsubStatus where arbitrary :: Gen UnsubStatus -arbitrary = forall a. (Bounded a, Enum a) => Gen a +instance Arbitrary UnsubStatus where arbitrary :: Gen UnsubStatus +arbitrary = forall a. (Bounded a, Enum a) => Gen a arbitraryBoundedEnum -instance Arbitrary UnsubscribeResponse where - arbitrary :: Gen UnsubscribeResponse -arbitrary = Word16 -> [Property] -> [UnsubStatus] -> UnsubscribeResponse +instance Arbitrary UnsubscribeResponse where + arbitrary :: Gen UnsubscribeResponse +arbitrary = Word16 -> [Property] -> [UnsubStatus] -> UnsubscribeResponse UnsubscribeResponse forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> forall a. Arbitrary a => Gen a arbitrary forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b @@ -470,9 +470,9 @@ <*> forall a. Arbitrary a => Gen a arbitrary -instance Arbitrary MT.Property where - arbitrary :: Gen Property -arbitrary = forall a. [Gen a] -> Gen a +instance Arbitrary MT.Property where + arbitrary :: Gen Property +arbitrary = forall a. [Gen a] -> Gen a oneof [ Word8 -> Property PropPayloadFormatIndicator forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b @@ -593,26 +593,26 @@ arbitrary ] -instance Arbitrary AuthRequest where - arbitrary :: Gen AuthRequest -arbitrary = Word8 -> [Property] -> AuthRequest +instance Arbitrary AuthRequest where + arbitrary :: Gen AuthRequest +arbitrary = Word8 -> [Property] -> AuthRequest AuthRequest forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> forall a. Arbitrary a => Gen a arbitrary forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> forall a. Arbitrary a => Gen a arbitrary -instance Arbitrary ConnACKRC where arbitrary :: Gen ConnACKRC -arbitrary = forall a. (Bounded a, Enum a) => Gen a +instance Arbitrary ConnACKRC where arbitrary :: Gen ConnACKRC +arbitrary = forall a. (Bounded a, Enum a) => Gen a arbitraryBoundedEnum -instance Arbitrary DiscoReason where arbitrary :: Gen DiscoReason -arbitrary = forall a. (Bounded a, Enum a) => Gen a +instance Arbitrary DiscoReason where arbitrary :: Gen DiscoReason +arbitrary = forall a. (Bounded a, Enum a) => Gen a arbitraryBoundedEnum -instance Arbitrary DisconnectRequest where - arbitrary :: Gen DisconnectRequest -arbitrary = DiscoReason -> [Property] -> DisconnectRequest +instance Arbitrary DisconnectRequest where + arbitrary :: Gen DisconnectRequest +arbitrary = DiscoReason -> [Property] -> DisconnectRequest DisconnectRequest forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> forall a. Arbitrary a => Gen a arbitrary forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b @@ -620,8 +620,8 @@ arbitrary instance Arbitrary MQTTPkt where - arbitrary :: Gen MQTTPkt -arbitrary = forall a. [Gen a] -> Gen a + arbitrary :: Gen MQTTPkt +arbitrary = forall a. [Gen a] -> Gen a oneof [ ConnectRequest -> ProtocolLevel -> MQTTPkt ConnPkt forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b @@ -684,39 +684,39 @@ <$> forall a. Arbitrary a => Gen a arbitrary ] - shrink :: MQTTPkt -> [MQTTPkt] -shrink (SubACKPkt SubscribeResponse -x) = SubscribeResponse -> MQTTPkt + shrink :: MQTTPkt -> [MQTTPkt] +shrink (SubACKPkt SubscribeResponse +x) = SubscribeResponse -> MQTTPkt SubACKPkt forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> forall a. Arbitrary a => a -> [a] shrink SubscribeResponse -x - shrink (ConnACKPkt ConnACKFlags -x) = ConnACKFlags -> MQTTPkt +x + shrink (ConnACKPkt ConnACKFlags +x) = ConnACKFlags -> MQTTPkt ConnACKPkt forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> forall a. Arbitrary a => a -> [a] shrink ConnACKFlags -x - shrink (UnsubscribePkt UnsubscribeRequest -x) = UnsubscribeRequest -> MQTTPkt +x + shrink (UnsubscribePkt UnsubscribeRequest +x) = UnsubscribeRequest -> MQTTPkt UnsubscribePkt forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> forall a. Arbitrary a => a -> [a] shrink UnsubscribeRequest -x - shrink (SubscribePkt SubscribeRequest -x) = SubscribeRequest -> MQTTPkt +x + shrink (SubscribePkt SubscribeRequest +x) = SubscribeRequest -> MQTTPkt SubscribePkt forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> forall a. Arbitrary a => a -> [a] shrink SubscribeRequest -x +x shrink MQTTPkt _ = [] -- | v311mask strips all the v5 specific bits from an MQTTPkt. v311mask :: MQTTPkt -> MQTTPkt v311mask :: MQTTPkt -> MQTTPkt -v311mask (ConnPkt c :: ConnectRequest -c@ConnectRequest{Bool +v311mask (ConnPkt c :: ConnectRequest +c@ConnectRequest{Bool [Property] Maybe ByteString Maybe LastWill @@ -736,61 +736,61 @@ _lastWill :: ConnectRequest -> Maybe LastWill _password :: ConnectRequest -> Maybe ByteString _username :: ConnectRequest -> Maybe ByteString -..} ProtocolLevel +..} ProtocolLevel _) = ConnectRequest -> ProtocolLevel -> MQTTPkt ConnPkt (ConnectRequest -c{_connProperties :: [Property] +c{_connProperties :: [Property] _connProperties=forall a. Monoid a => a mempty, _password :: Maybe ByteString _password=forall {a} {a}. Maybe a -> Maybe a -> Maybe a -mpw Maybe ByteString -_username Maybe ByteString -_password, +mpw Maybe ByteString +_username Maybe ByteString +_password, _lastWill :: Maybe LastWill _lastWill=LastWill -> LastWill -cl forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b +cl forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> Maybe LastWill -_lastWill}) ProtocolLevel +_lastWill}) ProtocolLevel Protocol311 - where cl :: LastWill -> LastWill -cl LastWill -lw = LastWill -lw{_willProps :: [Property] + where cl :: LastWill -> LastWill +cl LastWill +lw = LastWill +lw{_willProps :: [Property] _willProps=forall a. Monoid a => a mempty} - mpw :: Maybe a -> Maybe a -> Maybe a -mpw Maybe a + mpw :: Maybe a -> Maybe a -> Maybe a +mpw Maybe a Nothing Maybe a _ = forall a. Maybe a Nothing - mpw Maybe a -_ Maybe a -p = Maybe a -p -v311mask (ConnACKPkt (ConnACKFlags SessionReuse -a ConnACKRC -b [Property] + mpw Maybe a +_ Maybe a +p = Maybe a +p +v311mask (ConnACKPkt (ConnACKFlags SessionReuse +a ConnACKRC +b [Property] _)) = ConnACKFlags -> MQTTPkt ConnACKPkt (SessionReuse -> ConnACKRC -> [Property] -> ConnACKFlags ConnACKFlags SessionReuse -a ConnACKRC -b forall a. Monoid a => a +a ConnACKRC +b forall a. Monoid a => a mempty) -v311mask (SubscribePkt (SubscribeRequest Word16 -p [(ByteString, SubOptions)] -s [Property] +v311mask (SubscribePkt (SubscribeRequest Word16 +p [(ByteString, SubOptions)] +s [Property] _)) = SubscribeRequest -> MQTTPkt SubscribePkt (Word16 -> [(ByteString, SubOptions)] -> [Property] -> SubscribeRequest SubscribeRequest Word16 -p [(ByteString, SubOptions)] -c forall a. Monoid a => a +p [(ByteString, SubOptions)] +c forall a. Monoid a => a mempty) - where c :: [(ByteString, SubOptions)] -c = forall a b. (a -> b) -> [a] -> [b] -map (\(ByteString -k,SubOptions{Bool + where c :: [(ByteString, SubOptions)] +c = forall a b. (a -> b) -> [a] -> [b] +map (\(ByteString +k,SubOptions{Bool RetainHandling QoS _subQoS :: SubOptions -> QoS @@ -802,42 +802,42 @@ _retainAsPublished :: Bool _retainHandling :: RetainHandling ..}) -> (ByteString -k,SubOptions +k,SubOptions subOptions{_subQoS :: QoS _subQoS=QoS -_subQoS})) [(ByteString, SubOptions)] -s -v311mask (SubACKPkt (SubscribeResponse Word16 -p [Either SubErr QoS] -s [Property] +_subQoS})) [(ByteString, SubOptions)] +s +v311mask (SubACKPkt (SubscribeResponse Word16 +p [Either SubErr QoS] +s [Property] _)) = SubscribeResponse -> MQTTPkt SubACKPkt (Word16 -> [Either SubErr QoS] -> [Property] -> SubscribeResponse SubscribeResponse Word16 -p [Either SubErr QoS] -s forall a. Monoid a => a +p [Either SubErr QoS] +s forall a. Monoid a => a mempty) -v311mask (UnsubscribePkt (UnsubscribeRequest Word16 -p [ByteString] -l [Property] +v311mask (UnsubscribePkt (UnsubscribeRequest Word16 +p [ByteString] +l [Property] _)) = UnsubscribeRequest -> MQTTPkt UnsubscribePkt (Word16 -> [ByteString] -> [Property] -> UnsubscribeRequest UnsubscribeRequest Word16 -p [ByteString] -l forall a. Monoid a => a +p [ByteString] +l forall a. Monoid a => a mempty) -v311mask (UnsubACKPkt (UnsubscribeResponse Word16 -p [Property] +v311mask (UnsubACKPkt (UnsubscribeResponse Word16 +p [Property] _ [UnsubStatus] _)) = UnsubscribeResponse -> MQTTPkt UnsubACKPkt (Word16 -> [Property] -> [UnsubStatus] -> UnsubscribeResponse UnsubscribeResponse Word16 -p forall a. Monoid a => a +p forall a. Monoid a => a mempty forall a. Monoid a => a mempty) -v311mask (PublishPkt PublishRequest -req) = PublishRequest -> MQTTPkt +v311mask (PublishPkt PublishRequest +req) = PublishRequest -> MQTTPkt PublishPkt PublishRequest -req{_pubProps :: [Property] +req{_pubProps :: [Property] _pubProps=forall a. Monoid a => a mempty} v311mask (DisconnectPkt DisconnectRequest @@ -846,49 +846,49 @@ DisconnectRequest DiscoReason DiscoNormalDisconnection forall a. Monoid a => a mempty) -v311mask (PubACKPkt (PubACK Word16 -x Word8 +v311mask (PubACKPkt (PubACK Word16 +x Word8 _ [Property] _)) = PubACK -> MQTTPkt PubACKPkt (Word16 -> Word8 -> [Property] -> PubACK PubACK Word16 -x Word8 +x Word8 0 forall a. Monoid a => a mempty) -v311mask (PubRECPkt (PubREC Word16 -x Word8 +v311mask (PubRECPkt (PubREC Word16 +x Word8 _ [Property] _)) = PubREC -> MQTTPkt PubRECPkt (Word16 -> Word8 -> [Property] -> PubREC PubREC Word16 -x Word8 +x Word8 0 forall a. Monoid a => a mempty) -v311mask (PubRELPkt (PubREL Word16 -x Word8 +v311mask (PubRELPkt (PubREL Word16 +x Word8 _ [Property] _)) = PubREL -> MQTTPkt PubRELPkt (Word16 -> Word8 -> [Property] -> PubREL PubREL Word16 -x Word8 +x Word8 0 forall a. Monoid a => a mempty) -v311mask (PubCOMPPkt (PubCOMP Word16 -x Word8 +v311mask (PubCOMPPkt (PubCOMP Word16 +x Word8 _ [Property] _)) = PubCOMP -> MQTTPkt PubCOMPPkt (Word16 -> Word8 -> [Property] -> PubCOMP PubCOMP Word16 -x Word8 +x Word8 0 forall a. Monoid a => a mempty) -v311mask MQTTPkt -x = MQTTPkt -x +v311mask MQTTPkt +x = MQTTPkt +x instance Arbitrary Topic where - arbitrary :: Gen Topic -arbitrary = String -> (Int, Int) -> (Int, Int) -> Gen Topic + arbitrary :: Gen Topic +arbitrary = String -> (Int, Int) -> (Int, Int) -> Gen Topic arbitraryTopic [Char 'a'..Char 'z'] (Int @@ -897,10 +897,10 @@ 1,Int 6) - shrink :: Topic -> [Topic] -shrink (Topic -> Text -unTopic -> Text -x) = forall a b. (a -> Maybe b) -> [a] -> [b] + shrink :: Topic -> [Topic] +shrink (Topic -> Text +unTopic -> Text +x) = forall a b. (a -> Maybe b) -> [a] -> [b] mapMaybe (Text -> Maybe Topic mkTopic forall b c a. (b -> c) -> (a -> b) -> a -> c . Text -> [Text] -> Text @@ -908,13 +908,13 @@ "/") forall b c a. (b -> c) -> (a -> b) -> a -> c . forall a. (a -> [a]) -> [a] -> [[a]] shrinkList Text -> [Text] -shrinkWord forall a b. (a -> b) -> a -> b +shrinkWord forall a b. (a -> b) -> a -> b $ Text -> Text -> [Text] Text.splitOn Text "/" Text -x - where shrinkWord :: Text -> [Text] -shrinkWord = forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b +x + where shrinkWord :: Text -> [Text] +shrinkWord = forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap String -> Text Text.pack forall b c a. (b -> c) -> (a -> b) -> a -> c . forall a. Arbitrary a => a -> [a] @@ -923,13 +923,13 @@ Text.unpack -- | An arbitrary Topic and an arbitrary Filter that should match it. -newtype MatchingTopic = MatchingTopic (Topic, [Filter]) deriving (MatchingTopic -> MatchingTopic -> Bool +newtype MatchingTopic = MatchingTopic (Topic, [Filter]) deriving (MatchingTopic -> MatchingTopic -> Bool forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a /= :: MatchingTopic -> MatchingTopic -> Bool $c/= :: MatchingTopic -> MatchingTopic -> Bool == :: MatchingTopic -> MatchingTopic -> Bool $c== :: MatchingTopic -> MatchingTopic -> Bool -Eq, Int -> MatchingTopic -> ShowS +Eq, Int -> MatchingTopic -> ShowS [MatchingTopic] -> ShowS MatchingTopic -> String forall a. @@ -943,8 +943,8 @@ Show) instance Arbitrary MatchingTopic where - arbitrary :: Gen MatchingTopic -arbitrary = (Topic, [Filter]) -> MatchingTopic + arbitrary :: Gen MatchingTopic +arbitrary = (Topic, [Filter]) -> MatchingTopic MatchingTopic forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> String -> (Int, Int) -> (Int, Int) -> (Int, Int) -> Gen (Topic, [Filter]) @@ -957,162 +957,162 @@ 6) (Int 1,Int 6) - shrink :: MatchingTopic -> [MatchingTopic] -shrink (MatchingTopic (Topic -t,[Filter] -ms)) = forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b + shrink :: MatchingTopic -> [MatchingTopic] +shrink (MatchingTopic (Topic +t,[Filter] +ms)) = forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap ((Topic, [Filter]) -> MatchingTopic MatchingTopic forall b c a. (b -> c) -> (a -> b) -> a -> c . (Topic -t,)) forall b c a. (b -> c) -> (a -> b) -> a -> c +t,)) forall b c a. (b -> c) -> (a -> b) -> a -> c . forall a. (a -> [a]) -> [a] -> [[a]] shrinkList (forall a b. a -> b -> a const []) forall a b. (a -> b) -> a -> b $ [Filter] -ms +ms -- | Generate an arbitrary topic segment (e.g. the 'X' in 'a\/X\/b') of a -- given length from the given alphabet. arbitraryTopicSegment :: [Char] -> Int -> Gen Text arbitraryTopicSegment :: String -> Int -> Gen Text -arbitraryTopicSegment String -alphabet Int -n = String -> Text +arbitraryTopicSegment String +alphabet Int +n = String -> Text Text.pack forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> forall a. Int -> Gen a -> Gen [a] vectorOf Int -n (forall a. [a] -> Gen a +n (forall a. [a] -> Gen a elements String -alphabet) +alphabet) -- | Generate an arbitrary Topic from the given alphabet with lengths -- of segments and the segment count specified by the given ranges. arbitraryTopic :: [Char] -> (Int,Int) -> (Int,Int) -> Gen Topic arbitraryTopic :: String -> (Int, Int) -> (Int, Int) -> Gen Topic -arbitraryTopic String -alphabet (Int, Int) -seglen (Int, Int) -nsegs = Gen [Text] -someSegs forall a b. Gen a -> (a -> Maybe b) -> Gen b +arbitraryTopic String +alphabet (Int, Int) +seglen (Int, Int) +nsegs = Gen [Text] +someSegs forall a b. Gen a -> (a -> Maybe b) -> Gen b `suchThatMap` (Text -> Maybe Topic mkTopic forall b c a. (b -> c) -> (a -> b) -> a -> c . Text -> [Text] -> Text Text.intercalate Text "/") - where someSegs :: Gen [Text] -someSegs = forall a. Random a => (a, a) -> Gen a + where someSegs :: Gen [Text] +someSegs = forall a. Random a => (a, a) -> Gen a choose (Int, Int) -nsegs forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b +nsegs forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b >>= forall a b c. (a -> b -> c) -> b -> a -> c flip forall a. Int -> Gen a -> Gen [a] vectorOf Gen Text -aSeg - aSeg :: Gen Text -aSeg = forall a. Random a => (a, a) -> Gen a +aSeg + aSeg :: Gen Text +aSeg = forall a. Random a => (a, a) -> Gen a choose (Int, Int) -seglen forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b +seglen forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b >>= String -> Int -> Gen Text arbitraryTopicSegment String -alphabet +alphabet -- | Generate an arbitrary topic similarly to arbitraryTopic as well -- as some arbitrary filters that should match that topic. arbitraryMatchingTopic :: [Char] -> (Int,Int) -> (Int,Int) -> (Int,Int) -> Gen (Topic, [Filter]) arbitraryMatchingTopic :: String -> (Int, Int) -> (Int, Int) -> (Int, Int) -> Gen (Topic, [Filter]) -arbitraryMatchingTopic String -alphabet (Int, Int) -seglen (Int, Int) -nsegs (Int, Int) -nfilts = do - Topic -t <- String -> (Int, Int) -> (Int, Int) -> Gen Topic +arbitraryMatchingTopic String +alphabet (Int, Int) +seglen (Int, Int) +nsegs (Int, Int) +nfilts = do + Topic +t <- String -> (Int, Int) -> (Int, Int) -> Gen Topic arbitraryTopic String -alphabet (Int, Int) -seglen (Int, Int) -nsegs - let tsegs :: [Text] -tsegs = Text -> Text -> [Text] +alphabet (Int, Int) +seglen (Int, Int) +nsegs + let tsegs :: [Text] +tsegs = Text -> Text -> [Text] Text.splitOn Text "/" (Topic -> Text unTopic Topic -t) - Int -fn <- forall a. Random a => (a, a) -> Gen a +t) + Int +fn <- forall a. Random a => (a, a) -> Gen a choose (Int, Int) -nfilts - [[Text -> Text]] -reps <- forall a. Int -> Gen a -> Gen [a] +nfilts + [[Text -> Text]] +reps <- forall a. Int -> Gen a -> Gen [a] vectorOf Int -fn forall a b. (a -> b) -> a -> b +fn forall a b. (a -> b) -> a -> b $ forall a. Int -> Gen a -> Gen [a] vectorOf (forall (t :: * -> *) a. Foldable t => t a -> Int length [Text] -tsegs) (forall a. [a] -> Gen a +tsegs) (forall a. [a] -> Gen a elements [forall a. a -> a id, forall a b. a -> b -> a const Text "+", forall a b. a -> b -> a const Text "#"]) - let m :: [Filter] -m = forall a b. (a -> Maybe b) -> [a] -> [b] + let m :: [Filter] +m = forall a b. (a -> Maybe b) -> [a] -> [b] mapMaybe (Text -> Maybe Filter mkFilter forall b c a. (b -> c) -> (a -> b) -> a -> c . Text -> [Text] -> Text Text.intercalate Text "/" forall b c a. (b -> c) -> (a -> b) -> a -> c . forall {a}. (Eq a, IsString a) => [a] -> [a] -clean forall b c a. (b -> c) -> (a -> b) -> a -> c +clean forall b c a. (b -> c) -> (a -> b) -> a -> c . forall a b c. (a -> b -> c) -> [a] -> [b] -> [c] zipWith forall a b. a -> (a -> b) -> b (&) [Text] -tsegs) [[Text -> Text]] -reps +tsegs) [[Text -> Text]] +reps forall (f :: * -> *) a. Applicative f => a -> f a pure (Topic -t, [Filter] -m) +t, [Filter] +m) where - clean :: [a] -> [a] -clean [] = [] - clean (a + clean :: [a] -> [a] +clean [] = [] + clean (a "#":[a] _) = [a "#"] - clean (a -x:[a] -xs) = a -x forall a. a -> [a] -> [a] + clean (a +x:[a] +xs) = a +x forall a. a -> [a] -> [a] : [a] -> [a] -clean [a] -xs +clean [a] +xs -- | Generate an arbitrary Filter from the given alphabet with lengths -- of segments and the segment count specified by the given ranges. -- Segments may contain wildcards. arbitraryFilter :: [Char] -> (Int,Int) -> (Int,Int) -> Gen Filter arbitraryFilter :: String -> (Int, Int) -> (Int, Int) -> Gen Filter -arbitraryFilter String -alphabet (Int, Int) -seglen (Int, Int) -nsegs = Gen [Text] -someSegs forall a b. Gen a -> (a -> Maybe b) -> Gen b +arbitraryFilter String +alphabet (Int, Int) +seglen (Int, Int) +nsegs = Gen [Text] +someSegs forall a b. Gen a -> (a -> Maybe b) -> Gen b `suchThatMap` (Text -> Maybe Filter mkFilter forall b c a. (b -> c) -> (a -> b) -> a -> c . Text -> [Text] -> Text Text.intercalate Text "/") - where someSegs :: Gen [Text] -someSegs = forall a. Random a => (a, a) -> Gen a + where someSegs :: Gen [Text] +someSegs = forall a. Random a => (a, a) -> Gen a choose (Int, Int) -nsegs forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b +nsegs forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b >>= forall a b c. (a -> b -> c) -> b -> a -> c flip forall a. Int -> Gen a -> Gen [a] vectorOf Gen Text -aSeg - aSeg :: Gen Text -aSeg = forall a. [Gen a] -> Gen a +aSeg + aSeg :: Gen Text +aSeg = forall a. [Gen a] -> Gen a oneof [ forall (f :: * -> *) a. Applicative f => a -> f a pure Text @@ -1121,15 +1121,15 @@ "#", forall a. Random a => (a, a) -> Gen a choose (Int, Int) -seglen forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b +seglen forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b >>= String -> Int -> Gen Text arbitraryTopicSegment String -alphabet +alphabet ] instance Arbitrary Filter where - arbitrary :: Gen Filter -arbitrary = String -> (Int, Int) -> (Int, Int) -> Gen Filter + arbitrary :: Gen Filter +arbitrary = String -> (Int, Int) -> (Int, Int) -> Gen Filter arbitraryFilter [Char 'a'..Char 'z'] (Int @@ -1138,10 +1138,10 @@ 1,Int 6) - shrink :: Filter -> [Filter] -shrink (Filter -> Text -unFilter -> Text -x) = forall a b. (a -> Maybe b) -> [a] -> [b] + shrink :: Filter -> [Filter] +shrink (Filter -> Text +unFilter -> Text +x) = forall a b. (a -> Maybe b) -> [a] -> [b] mapMaybe (Text -> Maybe Filter mkFilter forall b c a. (b -> c) -> (a -> b) -> a -> c . Text -> [Text] -> Text @@ -1149,13 +1149,13 @@ "/") forall b c a. (b -> c) -> (a -> b) -> a -> c . forall a. (a -> [a]) -> [a] -> [[a]] shrinkList Text -> [Text] -shrinkWord forall a b. (a -> b) -> a -> b +shrinkWord forall a b. (a -> b) -> a -> b $ Text -> Text -> [Text] Text.splitOn Text "/" Text -x - where shrinkWord :: Text -> [Text] -shrinkWord = forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b +x + where shrinkWord :: Text -> [Text] +shrinkWord = forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap String -> Text Text.pack forall b c a. (b -> c) -> (a -> b) -> a -> c . forall a. Arbitrary a => a -> [a] diff --git a/src/Network.MQTT.Client.html b/src/Network.MQTT.Client.html index 78e488b..caa83a9 100644 --- a/src/Network.MQTT.Client.html +++ b/src/Network.MQTT.Client.html @@ -1,4 +1,4 @@ -
{-|
+
{-|
 Module      : Network.MQTT.Client.
 Description : An MQTT client.
 Copyright   : (c) Dustin Sallings, 2019
@@ -82,13 +82,13 @@
                | Stopped
                | Disconnected
                | DiscoErr DisconnectRequest
-               | ConnErr ConnACKFlags deriving (ConnState -> ConnState -> Bool
+               | ConnErr ConnACKFlags deriving (ConnState -> ConnState -> Bool
 forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
 /= :: ConnState -> ConnState -> Bool
 $c/= :: ConnState -> ConnState -> Bool
 == :: ConnState -> ConnState -> Bool
 $c== :: ConnState -> ConnState -> Bool
-Eq, Int -> ConnState -> ShowS
+Eq, Int -> ConnState -> ShowS
 [ConnState] -> ShowS
 ConnState -> String
 forall a.
@@ -102,13 +102,13 @@
 Show)
 
 data DispatchType = DSubACK | DUnsubACK | DPubACK | DPubREC | DPubREL | DPubCOMP
-  deriving (DispatchType -> DispatchType -> Bool
+  deriving (DispatchType -> DispatchType -> Bool
 forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
 /= :: DispatchType -> DispatchType -> Bool
 $c/= :: DispatchType -> DispatchType -> Bool
 == :: DispatchType -> DispatchType -> Bool
 $c== :: DispatchType -> DispatchType -> Bool
-Eq, Int -> DispatchType -> ShowS
+Eq, Int -> DispatchType -> ShowS
 [DispatchType] -> ShowS
 DispatchType -> String
 forall a.
@@ -119,7 +119,7 @@
 $cshow :: DispatchType -> String
 showsPrec :: Int -> DispatchType -> ShowS
 $cshowsPrec :: Int -> DispatchType -> ShowS
-Show, Eq DispatchType
+Show, Eq DispatchType
 DispatchType -> DispatchType -> Bool
 DispatchType -> DispatchType -> Ordering
 DispatchType -> DispatchType -> DispatchType
@@ -147,7 +147,7 @@
 $c< :: DispatchType -> DispatchType -> Bool
 compare :: DispatchType -> DispatchType -> Ordering
 $ccompare :: DispatchType -> DispatchType -> Ordering
-Ord, Int -> DispatchType
+Ord, Int -> DispatchType
 DispatchType -> Int
 DispatchType -> [DispatchType]
 DispatchType -> DispatchType
@@ -179,7 +179,7 @@
 $cpred :: DispatchType -> DispatchType
 succ :: DispatchType -> DispatchType
 $csucc :: DispatchType -> DispatchType
-Enum, DispatchType
+Enum, DispatchType
 forall a. a -> a -> Bounded a
 maxBound :: DispatchType
 $cmaxBound :: DispatchType
@@ -333,8 +333,8 @@
 -- >   publish mc "tmp/topic" "hello!" False
 connectURI :: MQTTConfig -> URI -> IO MQTTClient
 connectURI :: MQTTConfig -> URI -> IO MQTTClient
-connectURI cfg :: MQTTConfig
-cfg@MQTTConfig{Bool
+connectURI cfg :: MQTTConfig
+cfg@MQTTConfig{Bool
 Int
 String
 [Property]
@@ -371,12 +371,12 @@
 _msgCB :: MQTTConfig -> MessageCallback
 _lwt :: MQTTConfig -> Maybe LastWill
 _cleanSession :: MQTTConfig -> Bool
-..} URI
-uri = do
-  let cf :: MQTTConfig -> IO MQTTClient
-cf = case URI -> String
+..} URI
+uri = do
+  let cf :: MQTTConfig -> IO MQTTClient
+cf = case URI -> String
 uriScheme URI
-uri of
+uri of
              String
 "mqtt:"  -> MQTTConfig -> IO MQTTClient
 runClient
@@ -386,66 +386,66 @@
              String
 "ws:"    -> URI -> Bool -> MQTTConfig -> IO MQTTClient
 runWS URI
-uri Bool
+uri Bool
 False
              String
 "wss:"   -> URI -> Bool -> MQTTConfig -> IO MQTTClient
 runWS URI
-uri Bool
+uri Bool
 True
-             String
-us       -> forall a. String -> a
+             String
+us       -> forall a. String -> a
 mqttFail forall a b. (a -> b) -> a -> b
 $ String
 "invalid URI scheme: " forall a. Semigroup a => a -> a -> a
 <> String
-us
+us
 
-      a :: URIAuth
-a = forall a. a -> Maybe a -> a
+      a :: URIAuth
+a = forall a. a -> Maybe a -> a
 fromMaybe URIAuth
 nullURIAuth forall a b. (a -> b) -> a -> b
 $ URI -> Maybe URIAuth
 uriAuthority URI
-uri
-      (Maybe String
-u,Maybe String
-p) = String -> (Maybe String, Maybe String)
-up (URIAuth -> String
+uri
+      (Maybe String
+u,Maybe String
+p) = String -> (Maybe String, Maybe String)
+up (URIAuth -> String
 uriUserInfo URIAuth
-a)
+a)
 
-  Maybe MQTTClient
-v <- forall a. String -> Int -> IO a -> IO (Maybe a)
+  Maybe MQTTClient
+v <- forall a. String -> Int -> IO a -> IO (Maybe a)
 namedTimeout String
 "MQTT connect" Int
-_connectTimeout forall a b. (a -> b) -> a -> b
+_connectTimeout forall a b. (a -> b) -> a -> b
 $
     MQTTConfig -> IO MQTTClient
-cf MQTTConfig
-cfg{_connID :: String
+cf MQTTConfig
+cfg{_connID :: String
 Network.MQTT.Client._connID=forall {p}. p -> ShowS
-cid ProtocolLevel
-_protocol (URI -> String
+cid ProtocolLevel
+_protocol (URI -> String
 uriFragment URI
-uri),
+uri),
            _hostname :: String
 _hostname=URIAuth -> String
 uriRegName URIAuth
-a, _port :: Int
+a, _port :: Int
 _port=forall {a} {a}.
 (Eq a, IsString a, Num a, Read a) =>
 String -> a -> a
-port (URIAuth -> String
+port (URIAuth -> String
 uriPort URIAuth
-a) (URI -> String
+a) (URI -> String
 uriScheme URI
-uri),
+uri),
            _username :: Maybe String
 Network.MQTT.Client._username=Maybe String
-u, _password :: Maybe String
+u, _password :: Maybe String
 Network.MQTT.Client._password=Maybe String
-p}
+p}
 
   forall b a. b -> (a -> b) -> Maybe a -> b
 maybe (forall a. String -> a
@@ -454,72 +454,72 @@
 "connection to " forall a. Semigroup a => a -> a -> a
 <> forall a. Show a => a -> String
 show URI
-uri forall a. Semigroup a => a -> a -> a
+uri forall a. Semigroup a => a -> a -> a
 <> String
 " timed out") forall (f :: * -> *) a. Applicative f => a -> f a
 pure Maybe MQTTClient
-v
+v
 
   where
-    port :: String -> a -> a
-port String
+    port :: String -> a -> a
+port String
 "" a
 "mqtt:"  = a
 1883
-    port String
+    port String
 "" a
 "mqtts:" = a
 8883
-    port String
+    port String
 "" a
 "ws:"    = a
 80
-    port String
+    port String
 "" a
 "wss:"   = a
 443
-    port String
-x a
+    port String
+x a
 _         = (forall a. Read a => String -> a
 read forall b c a. (b -> c) -> (a -> b) -> a -> c
 . forall a. [a] -> [a]
 tail) String
-x
+x
 
-    cid :: p -> ShowS
-cid p
+    cid :: p -> ShowS
+cid p
 _ [Char
 '#']    = String
 ""
-    cid p
+    cid p
 _ (Char
-'#':String
-xs) = String
-xs
-    cid p
+'#':String
+xs) = String
+xs
+    cid p
 _ String
 _        = String
 ""
 
-    up :: String -> (Maybe String, Maybe String)
-up String
+    up :: String -> (Maybe String, Maybe String)
+up String
 "" = (forall a. Maybe a
 Nothing, forall a. Maybe a
 Nothing)
-    up String
-x = let (String
-u,String
-r) = forall a. (a -> Bool) -> [a] -> ([a], [a])
+    up String
+x = let (String
+u,String
+r) = forall a. (a -> Bool) -> [a] -> ([a], [a])
 break (forall a. Eq a => a -> a -> Bool
 == Char
 ':') (forall a. [a] -> [a]
 init String
-x) in
+x) in
              (forall a. a -> Maybe a
 Just (ShowS
 unEscapeString String
-u), if String
-r forall a. Eq a => a -> a -> Bool
+u), if String
+r forall a. Eq a => a -> a -> Bool
 == String
 "" then forall a. Maybe a
 Nothing else forall a. a -> Maybe a
@@ -527,14 +527,14 @@
 unEscapeString forall a b. (a -> b) -> a -> b
 $ forall a. [a] -> [a]
 tail String
-r))
+r))
 
 
 -- | Set up and run a client from the given config.
 runClient :: MQTTConfig -> IO MQTTClient
 runClient :: MQTTConfig -> IO MQTTClient
-runClient cfg :: MQTTConfig
-cfg@MQTTConfig{Bool
+runClient cfg :: MQTTConfig
+cfg@MQTTConfig{Bool
 Int
 String
 [Property]
@@ -571,20 +571,20 @@
 _msgCB :: MQTTConfig -> MessageCallback
 _lwt :: MQTTConfig -> Maybe LastWill
 _cleanSession :: MQTTConfig -> Bool
-..} = ((AppData -> IO ()) -> IO ()) -> MQTTConfig -> IO MQTTClient
+..} = ((AppData -> IO ()) -> IO ()) -> MQTTConfig -> IO MQTTClient
 tcpCompat (forall a. ClientSettings -> (AppData -> IO a) -> IO a
 runTCPClient (Int -> ByteString -> ClientSettings
 clientSettings Int
-_port (String -> ByteString
+_port (String -> ByteString
 BCS.pack String
-_hostname))) MQTTConfig
-cfg
+_hostname))) MQTTConfig
+cfg
 
 -- | Set up and run a client connected via TLS.
 runClientTLS :: MQTTConfig -> IO MQTTClient
 runClientTLS :: MQTTConfig -> IO MQTTClient
-runClientTLS cfg :: MQTTConfig
-cfg@MQTTConfig{Bool
+runClientTLS cfg :: MQTTConfig
+cfg@MQTTConfig{Bool
 Int
 String
 [Property]
@@ -621,69 +621,69 @@
 _msgCB :: MQTTConfig -> MessageCallback
 _lwt :: MQTTConfig -> Maybe LastWill
 _cleanSession :: MQTTConfig -> Bool
-..} = ((AppData -> IO ()) -> IO ()) -> MQTTConfig -> IO MQTTClient
+..} = ((AppData -> IO ()) -> IO ()) -> MQTTConfig -> IO MQTTClient
 tcpCompat (forall (m :: * -> *) a.
 MonadUnliftIO m =>
 TLSClientConfig -> (AppData -> m a) -> m a
 runTLSClient TLSClientConfig
-tlsConf) MQTTConfig
-cfg
-  where tlsConf :: TLSClientConfig
-tlsConf = (Int -> ByteString -> TLSClientConfig
+tlsConf) MQTTConfig
+cfg
+  where tlsConf :: TLSClientConfig
+tlsConf = (Int -> ByteString -> TLSClientConfig
 tlsClientConfig Int
-_port (String -> ByteString
+_port (String -> ByteString
 BCS.pack String
-_hostname)) {tlsClientTLSSettings :: TLSSettings
+_hostname)) {tlsClientTLSSettings :: TLSSettings
 tlsClientTLSSettings=TLSSettings
-_tlsSettings}
+_tlsSettings}
 
 -- Compatibility mechanisms for TCP Conduit bits.
 tcpCompat :: ((AppData -> IO ()) -> IO ()) -> MQTTConfig -> IO MQTTClient
 tcpCompat :: ((AppData -> IO ()) -> IO ()) -> MQTTConfig -> IO MQTTClient
-tcpCompat (AppData -> IO ()) -> IO ()
-mkconn = ((MQTTConduit -> IO ()) -> IO ()) -> MQTTConfig -> IO MQTTClient
+tcpCompat (AppData -> IO ()) -> IO ()
+mkconn = ((MQTTConduit -> IO ()) -> IO ()) -> MQTTConfig -> IO MQTTClient
 runMQTTConduit (forall {a} {m :: * -> *} {m :: * -> *} {c} {t} {i} {o}.
 (HasReadWrite a, MonadIO m, MonadIO m) =>
 ((a -> c) -> t)
 -> ((ConduitT i ByteString m (), ConduitT ByteString o m ()) -> c)
 -> t
-adapt (AppData -> IO ()) -> IO ()
-mkconn)
-  where adapt :: ((a -> c) -> t)
+adapt (AppData -> IO ()) -> IO ()
+mkconn)
+  where adapt :: ((a -> c) -> t)
 -> ((ConduitT i ByteString m (), ConduitT ByteString o m ()) -> c)
 -> t
-adapt (a -> c) -> t
-mk (ConduitT i ByteString m (), ConduitT ByteString o m ()) -> c
-f = (a -> c) -> t
-mk ((ConduitT i ByteString m (), ConduitT ByteString o m ()) -> c
-f forall b c a. (b -> c) -> (a -> b) -> a -> c
+adapt (a -> c) -> t
+mk (ConduitT i ByteString m (), ConduitT ByteString o m ()) -> c
+f = (a -> c) -> t
+mk ((ConduitT i ByteString m (), ConduitT ByteString o m ()) -> c
+f forall b c a. (b -> c) -> (a -> b) -> a -> c
 . forall {ad} {m :: * -> *} {m :: * -> *} {i} {o}.
 (HasReadWrite ad, MonadIO m, MonadIO m) =>
 ad -> (ConduitT i ByteString m (), ConduitT ByteString o m ())
-adaptor)
-        adaptor :: ad -> (ConduitT i ByteString m (), ConduitT ByteString o m ())
-adaptor ad
-ad = (forall ad (m :: * -> *) i.
+adaptor)
+        adaptor :: ad -> (ConduitT i ByteString m (), ConduitT ByteString o m ())
+adaptor ad
+ad = (forall ad (m :: * -> *) i.
 (HasReadWrite ad, MonadIO m) =>
 ad -> ConduitT i ByteString m ()
 appSource ad
-ad, forall ad (m :: * -> *) o.
+ad, forall ad (m :: * -> *) o.
 (HasReadWrite ad, MonadIO m) =>
 ad -> ConduitT ByteString o m ()
 appSink ad
-ad)
+ad)
 
 runWS :: URI -> Bool -> MQTTConfig -> IO MQTTClient
 runWS :: URI -> Bool -> MQTTConfig -> IO MQTTClient
-runWS URI{String
+runWS URI{String
 uriPath :: URI -> String
 uriPath :: String
-uriPath, String
+uriPath, String
 uriQuery :: URI -> String
 uriQuery :: String
-uriQuery} Bool
-secure cfg :: MQTTConfig
-cfg@MQTTConfig{Bool
+uriQuery} Bool
+secure cfg :: MQTTConfig
+cfg@MQTTConfig{Bool
 Int
 String
 [Property]
@@ -720,10 +720,10 @@
 _msgCB :: MQTTConfig -> MessageCallback
 _lwt :: MQTTConfig -> Maybe LastWill
 _cleanSession :: MQTTConfig -> Bool
-..} =
+..} =
   ((MQTTConduit -> IO ()) -> IO ()) -> MQTTConfig -> IO MQTTClient
 runMQTTConduit (forall {c} {t}. ((Connection -> c) -> t) -> (MQTTConduit -> c) -> t
-adapt forall a b. (a -> b) -> a -> b
+adapt forall a b. (a -> b) -> a -> b
 $ Bool
 -> String
 -> Int
@@ -732,44 +732,44 @@
 -> Headers
 -> ClientApp ()
 -> IO ()
-cf Bool
-secure String
-_hostname Int
-_port String
-endpoint ConnectionOptions
+cf Bool
+secure String
+_hostname Int
+_port String
+endpoint ConnectionOptions
 WS.defaultConnectionOptions Headers
-hdrs) MQTTConfig
-cfg
+hdrs) MQTTConfig
+cfg
 
   where
-    hdrs :: Headers
-hdrs = [(CI ByteString
+    hdrs :: Headers
+hdrs = [(CI ByteString
 "Sec-WebSocket-Protocol", ByteString
 "mqtt")]
-    adapt :: ((Connection -> c) -> t) -> (MQTTConduit -> c) -> t
-adapt (Connection -> c) -> t
-mk MQTTConduit -> c
-f = (Connection -> c) -> t
-mk (MQTTConduit -> c
-f forall b c a. (b -> c) -> (a -> b) -> a -> c
+    adapt :: ((Connection -> c) -> t) -> (MQTTConduit -> c) -> t
+adapt (Connection -> c) -> t
+mk MQTTConduit -> c
+f = (Connection -> c) -> t
+mk (MQTTConduit -> c
+f forall b c a. (b -> c) -> (a -> b) -> a -> c
 . Connection -> MQTTConduit
-adaptor)
-    adaptor :: Connection -> MQTTConduit
-adaptor Connection
-s = (Connection -> ConduitT () ByteString IO ()
-wsSource Connection
-s, Connection -> ConduitT ByteString Void IO ()
-wsSink Connection
-s)
+adaptor)
+    adaptor :: Connection -> MQTTConduit
+adaptor Connection
+s = (Connection -> ConduitT () ByteString IO ()
+wsSource Connection
+s, Connection -> ConduitT ByteString Void IO ()
+wsSink Connection
+s)
 
-    endpoint :: String
-endpoint = String
-uriPath forall a. Semigroup a => a -> a -> a
+    endpoint :: String
+endpoint = String
+uriPath forall a. Semigroup a => a -> a -> a
 <> String
-uriQuery
+uriQuery
 
-    cf :: Bool -> String -> Int -> String -> WS.ConnectionOptions -> WS.Headers -> WS.ClientApp () -> IO ()
-    cf :: Bool
+    cf :: Bool -> String -> Int -> String -> WS.ConnectionOptions -> WS.Headers -> WS.ClientApp () -> IO ()
+    cf :: Bool
 -> String
 -> Int
 -> String
@@ -777,7 +777,7 @@
 -> Headers
 -> ClientApp ()
 -> IO ()
-cf Bool
+cf Bool
 False = forall a.
 String
 -> Int
@@ -787,7 +787,7 @@
 -> ClientApp a
 -> IO a
 WS.runClientWith
-    cf Bool
+    cf Bool
 True  = String
 -> Int
 -> String
@@ -795,96 +795,96 @@
 -> Headers
 -> ClientApp ()
 -> IO ()
-runWSS
+runWSS
 
-    wsSource :: WS.Connection -> ConduitT () BCS.ByteString IO ()
-    wsSource :: Connection -> ConduitT () ByteString IO ()
-wsSource Connection
-ws = forall (f :: * -> *) a b. Applicative f => f a -> f b
+    wsSource :: WS.Connection -> ConduitT () BCS.ByteString IO ()
+    wsSource :: Connection -> ConduitT () ByteString IO ()
+wsSource Connection
+ws = forall (f :: * -> *) a b. Applicative f => f a -> f b
 forever forall a b. (a -> b) -> a -> b
 $ do
-      ByteString
-bs <- forall (m :: * -> *) a. MonadIO m => IO a -> m a
+      ByteString
+bs <- forall (m :: * -> *) a. MonadIO m => IO a -> m a
 liftIO forall a b. (a -> b) -> a -> b
 $ forall a. WebSocketsData a => Connection -> IO a
 WS.receiveData Connection
-ws
+ws
       forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
 unless (ByteString -> Bool
 BCS.null ByteString
-bs) forall a b. (a -> b) -> a -> b
+bs) forall a b. (a -> b) -> a -> b
 $ forall (m :: * -> *) o i. Monad m => o -> ConduitT i o m ()
 yield ByteString
-bs
+bs
 
-    wsSink :: WS.Connection -> ConduitT BCS.ByteString Void IO ()
-    wsSink :: Connection -> ConduitT ByteString Void IO ()
-wsSink Connection
-ws = forall b a. b -> (a -> b) -> Maybe a -> b
+    wsSink :: WS.Connection -> ConduitT BCS.ByteString Void IO ()
+    wsSink :: Connection -> ConduitT ByteString Void IO ()
+wsSink Connection
+ws = forall b a. b -> (a -> b) -> Maybe a -> b
 maybe (forall (f :: * -> *) a. Applicative f => a -> f a
-pure ()) (\ByteString
-bs -> forall (m :: * -> *) a. MonadIO m => IO a -> m a
+pure ()) (\ByteString
+bs -> forall (m :: * -> *) a. MonadIO m => IO a -> m a
 liftIO (forall a. WebSocketsData a => Connection -> a -> IO ()
 WS.sendBinaryData Connection
-ws ByteString
-bs) forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
+ws ByteString
+bs) forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
 >> Connection -> ConduitT ByteString Void IO ()
-wsSink Connection
-ws) forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
+wsSink Connection
+ws) forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
 =<< forall (m :: * -> *) i o. Monad m => ConduitT i o m (Maybe i)
 await
 
-    runWSS :: String -> Int -> String -> WS.ConnectionOptions -> WS.Headers -> WS.ClientApp () -> IO ()
-    runWSS :: String
+    runWSS :: String -> Int -> String -> WS.ConnectionOptions -> WS.Headers -> WS.ClientApp () -> IO ()
+    runWSS :: String
 -> Int
 -> String
 -> ConnectionOptions
 -> Headers
 -> ClientApp ()
 -> IO ()
-runWSS String
-host Int
-port String
-path ConnectionOptions
-options Headers
-hdrs' ClientApp ()
-app = do
-      let connectionParams :: ConnectionParams
-connectionParams = ConnectionParams
+runWSS String
+host Int
+port String
+path ConnectionOptions
+options Headers
+hdrs' ClientApp ()
+app = do
+      let connectionParams :: ConnectionParams
+connectionParams = ConnectionParams
             { connectionHostname :: String
 connectionHostname = String
-host
+host
             , connectionPort :: PortNumber
 connectionPort =  forall a. Enum a => Int -> a
 toEnum Int
-port
+port
             , connectionUseSecure :: Maybe TLSSettings
 connectionUseSecure = forall a. a -> Maybe a
 Just TLSSettings
-_tlsSettings
+_tlsSettings
             , connectionUseSocks :: Maybe ProxySettings
 connectionUseSocks = forall a. Maybe a
 Nothing
             }
 
-      ConnectionContext
-context <- IO ConnectionContext
+      ConnectionContext
+context <- IO ConnectionContext
 initConnectionContext
       forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
 E.bracket (ConnectionContext -> ConnectionParams -> IO Connection
 connectTo ConnectionContext
-context ConnectionParams
-connectionParams) Connection -> IO ()
+context ConnectionParams
+connectionParams) Connection -> IO ()
 connectionClose
-        (\Connection
-conn -> do
-            Stream
-stream <- IO (Maybe ByteString) -> (Maybe ByteString -> IO ()) -> IO Stream
+        (\Connection
+conn -> do
+            Stream
+stream <- IO (Maybe ByteString) -> (Maybe ByteString -> IO ()) -> IO Stream
 makeStream (Connection -> IO (Maybe ByteString)
-reader Connection
-conn) (Connection -> Maybe ByteString -> IO ()
-writer Connection
-conn)
+reader Connection
+conn) (Connection -> Maybe ByteString -> IO ()
+writer Connection
+conn)
             forall a.
 Stream
 -> String
@@ -894,43 +894,43 @@
 -> ClientApp a
 -> IO a
 WS.runClientWithStream Stream
-stream String
-host String
-path ConnectionOptions
-options Headers
-hdrs' ClientApp ()
-app)
+stream String
+host String
+path ConnectionOptions
+options Headers
+hdrs' ClientApp ()
+app)
 
         where
-          reader :: Connection -> IO (Maybe ByteString)
-reader Connection
-conn =
+          reader :: Connection -> IO (Maybe ByteString)
+reader Connection
+conn =
             forall a. IO a -> (IOError -> IO a) -> IO a
 catchIOError (forall a. a -> Maybe a
 Just forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
 <$> Connection -> IO ByteString
 connectionGetChunk Connection
-conn)
-            (\IOError
-e -> if IOError -> Bool
+conn)
+            (\IOError
+e -> if IOError -> Bool
 isEOFError IOError
-e then forall (f :: * -> *) a. Applicative f => a -> f a
+e then forall (f :: * -> *) a. Applicative f => a -> f a
 pure forall a. Maybe a
 Nothing else forall e a. Exception e => e -> IO a
 E.throwIO IOError
-e)
+e)
 
-          writer :: Connection -> Maybe ByteString -> IO ()
-writer Connection
-conn = forall b a. b -> (a -> b) -> Maybe a -> b
+          writer :: Connection -> Maybe ByteString -> IO ()
+writer Connection
+conn = forall b a. b -> (a -> b) -> Maybe a -> b
 maybe (forall (f :: * -> *) a. Applicative f => a -> f a
 pure ()) (Connection -> ByteString -> IO ()
 connectionPut Connection
-conn forall b c a. (b -> c) -> (a -> b) -> a -> c
+conn forall b c a. (b -> c) -> (a -> b) -> a -> c
 . ByteString -> ByteString
 BC.toStrict)
 
-mqttFail :: String -> a
+mqttFail :: String -> a
 mqttFail :: forall a. String -> a
 mqttFail = forall a e. Exception e => e -> a
 E.throw forall b c a. (b -> c) -> (a -> b) -> a -> c
@@ -939,39 +939,39 @@
 
 -- A couple async utilities to get our stuff named.
 
-namedAsync :: String -> IO a -> IO (Async a)
+namedAsync :: String -> IO a -> IO (Async a)
 namedAsync :: forall a. String -> IO a -> IO (Async a)
-namedAsync String
-s IO a
-a = forall a. IO a -> IO (Async a)
+namedAsync String
+s IO a
+a = forall a. IO a -> IO (Async a)
 async IO a
-a forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
->>= \Async a
-p -> ThreadId -> String -> IO ()
+a forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
+>>= \Async a
+p -> ThreadId -> String -> IO ()
 labelThread (forall a. Async a -> ThreadId
 asyncThreadId Async a
-p) String
-s forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
+p) String
+s forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
 >> forall (f :: * -> *) a. Applicative f => a -> f a
 pure Async a
-p
+p
 
-namedTimeout :: String -> Int -> IO a -> IO (Maybe a)
+namedTimeout :: String -> Int -> IO a -> IO (Maybe a)
 namedTimeout :: forall a. String -> Int -> IO a -> IO (Maybe a)
-namedTimeout String
-n Int
-to IO a
-a = forall a. Int -> IO a -> IO (Maybe a)
+namedTimeout String
+n Int
+to IO a
+a = forall a. Int -> IO a -> IO (Maybe a)
 timeout Int
-to (IO ThreadId
+to (IO ThreadId
 myThreadId forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
->>= \ThreadId
-tid -> ThreadId -> String -> IO ()
+>>= \ThreadId
+tid -> ThreadId -> String -> IO ()
 labelThread ThreadId
-tid String
-n forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
+tid String
+n forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
 >> IO a
-a)
+a)
 
 -- | MQTTConduit provides a source and sink for data as used by 'runMQTTConduit'.
 type MQTTConduit = (ConduitT () BCS.ByteString IO (), ConduitT BCS.ByteString Void IO ())
@@ -985,8 +985,8 @@
                -> MQTTConfig -- ^ the 'MQTTConfig'
                -> IO MQTTClient
 runMQTTConduit :: ((MQTTConduit -> IO ()) -> IO ()) -> MQTTConfig -> IO MQTTClient
-runMQTTConduit (MQTTConduit -> IO ()) -> IO ()
-mkconn MQTTConfig{Bool
+runMQTTConduit (MQTTConduit -> IO ()) -> IO ()
+mkconn MQTTConfig{Bool
 Int
 String
 [Property]
@@ -1023,61 +1023,61 @@
 _msgCB :: MQTTConfig -> MessageCallback
 _lwt :: MQTTConfig -> Maybe LastWill
 _cleanSession :: MQTTConfig -> Bool
-..} = do
-  TChan MQTTPkt
-_ch <- forall a. IO (TChan a)
+..} = do
+  TChan MQTTPkt
+_ch <- forall a. IO (TChan a)
 newTChanIO
-  TVar Word16
-_pktID <- forall a. a -> IO (TVar a)
+  TVar Word16
+_pktID <- forall a. a -> IO (TVar a)
 newTVarIO Word16
 1
-  TVar (Map (DispatchType, Word16) (TChan MQTTPkt))
-_acks <- forall a. a -> IO (TVar a)
+  TVar (Map (DispatchType, Word16) (TChan MQTTPkt))
+_acks <- forall a. a -> IO (TVar a)
 newTVarIO forall a. Monoid a => a
 mempty
-  Map Word16 PublishRequest
-_inflight <- forall k a. Ord k => NominalDiffTime -> IO (Map k a)
+  Map Word16 PublishRequest
+_inflight <- forall k a. Ord k => NominalDiffTime -> IO (Map k a)
 Decaying.new NominalDiffTime
 60
-  TVar ConnState
-_st <- forall a. a -> IO (TVar a)
+  TVar ConnState
+_st <- forall a. a -> IO (TVar a)
 newTVarIO ConnState
 Starting
-  TVar (Maybe (Async ()))
-_ct <- forall a. a -> IO (TVar a)
+  TVar (Maybe (Async ()))
+_ct <- forall a. a -> IO (TVar a)
 newTVarIO forall a. Maybe a
 Nothing
-  TVar (Map Topic Word16)
-_outA <- forall a. a -> IO (TVar a)
+  TVar (Map Topic Word16)
+_outA <- forall a. a -> IO (TVar a)
 newTVarIO forall a. Monoid a => a
 mempty
-  TVar (Map Word16 Topic)
-_inA <- forall a. a -> IO (TVar a)
+  TVar (Map Word16 Topic)
+_inA <- forall a. a -> IO (TVar a)
 newTVarIO forall a. Monoid a => a
 mempty
-  TVar ConnACKFlags
-_connACKFlags <- forall a. a -> IO (TVar a)
+  TVar ConnACKFlags
+_connACKFlags <- forall a. a -> IO (TVar a)
 newTVarIO (SessionReuse -> ConnACKRC -> [Property] -> ConnACKFlags
 ConnACKFlags SessionReuse
 NewSession ConnACKRC
 ConnUnspecifiedError forall a. Monoid a => a
 mempty)
-  Map ByteString MessageCallback
-_corr <- forall k a. Ord k => NominalDiffTime -> IO (Map k a)
+  Map ByteString MessageCallback
+_corr <- forall k a. Ord k => NominalDiffTime -> IO (Map k a)
 Decaying.new NominalDiffTime
 600
-  MVar (IO ())
-_cbM <- forall a. IO (MVar a)
+  MVar (IO ())
+_cbM <- forall a. IO (MVar a)
 newEmptyMVar
-  TVar (Maybe (Async ()))
-_cbHandle <- forall a. a -> IO (TVar a)
+  TVar (Maybe (Async ()))
+_cbHandle <- forall a. a -> IO (TVar a)
 newTVarIO forall a. Maybe a
 Nothing
-  let _cb :: MessageCallback
-_cb = MessageCallback
-_msgCB
-      cli :: MQTTClient
-cli = MQTTClient{TVar (Maybe (Async ()))
+  let _cb :: MessageCallback
+_cb = MessageCallback
+_msgCB
+      cli :: MQTTClient
+cli = MQTTClient{TVar (Maybe (Async ()))
 TVar Word16
 TVar (Map Word16 Topic)
 TVar (Map (DispatchType, Word16) (TChan MQTTPkt))
@@ -1115,143 +1115,143 @@
 _cb :: MessageCallback
 _pktID :: TVar Word16
 _ch :: TChan MQTTPkt
-..}
+..}
 
-  Async ()
-t <- forall a. String -> IO a -> IO (Async a)
+  Async ()
+t <- forall a. String -> IO a -> IO (Async a)
 namedAsync String
 "MQTT clientThread" forall a b. (a -> b) -> a -> b
 $ MQTTClient -> IO ()
-clientThread MQTTClient
-cli
-  ConnState
-s <- forall a. STM a -> IO a
+clientThread MQTTClient
+cli
+  ConnState
+s <- forall a. STM a -> IO a
 atomically (MQTTClient -> Async () -> STM ConnState
-waitForLaunch MQTTClient
-cli Async ()
-t)
+waitForLaunch MQTTClient
+cli Async ()
+t)
 
   forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
 when (ConnState
-s forall a. Eq a => a -> a -> Bool
+s forall a. Eq a => a -> a -> Bool
 == ConnState
 Disconnected) forall a b. (a -> b) -> a -> b
 $ forall a. Async a -> IO a
 wait Async ()
-t
+t
 
   forall a. STM a -> IO a
 atomically forall a b. (a -> b) -> a -> b
 $ MQTTClient -> STM ()
 checkConnected MQTTClient
-cli
+cli
 
   forall (f :: * -> *) a. Applicative f => a -> f a
 pure MQTTClient
-cli
+cli
 
   where
-    clientThread :: MQTTClient -> IO ()
-clientThread MQTTClient
-cli = forall a b. IO a -> IO b -> IO a
+    clientThread :: MQTTClient -> IO ()
+clientThread MQTTClient
+cli = forall a b. IO a -> IO b -> IO a
 E.finally IO ()
-connectAndRun IO ()
-markDisco
+connectAndRun IO ()
+markDisco
       where
-        connectAndRun :: IO ()
-connectAndRun = (MQTTConduit -> IO ()) -> IO ()
-mkconn forall a b. (a -> b) -> a -> b
-$ \MQTTConduit
-ad -> forall {m :: * -> *} {b} {a} {a}.
+        connectAndRun :: IO ()
+connectAndRun = (MQTTConduit -> IO ()) -> IO ()
+mkconn forall a b. (a -> b) -> a -> b
+$ \MQTTConduit
+ad -> forall {m :: * -> *} {b} {a} {a}.
 Monad m =>
 b -> (a, ConduitT ByteString Void m a) -> m b
-start MQTTClient
-cli MQTTConduit
-ad forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
+start MQTTClient
+cli MQTTConduit
+ad forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
 >>= MQTTConduit -> MQTTClient -> IO ()
-run MQTTConduit
-ad
-        markDisco :: IO ()
-markDisco = forall a. STM a -> IO a
+run MQTTConduit
+ad
+        markDisco :: IO ()
+markDisco = forall a. STM a -> IO a
 atomically forall a b. (a -> b) -> a -> b
 $ do
-          ConnState
-st <- forall a. TVar a -> STM a
+          ConnState
+st <- forall a. TVar a -> STM a
 readTVar (MQTTClient -> TVar ConnState
 _st MQTTClient
-cli)
+cli)
           forall (f :: * -> *). Alternative f => Bool -> f ()
 guard forall a b. (a -> b) -> a -> b
 $ ConnState
-st forall a. Eq a => a -> a -> Bool
+st forall a. Eq a => a -> a -> Bool
 == ConnState
 Starting Bool -> Bool -> Bool
 || ConnState
-st forall a. Eq a => a -> a -> Bool
+st forall a. Eq a => a -> a -> Bool
 == ConnState
 Connected
           forall a. TVar a -> a -> STM ()
 writeTVar (MQTTClient -> TVar ConnState
 _st MQTTClient
-cli) ConnState
+cli) ConnState
 Disconnected
 
-    start :: b -> (a, ConduitT ByteString Void m a) -> m b
-start b
-c (a
-_,ConduitT ByteString Void m a
-sink) = do
+    start :: b -> (a, ConduitT ByteString Void m a) -> m b
+start b
+c (a
+_,ConduitT ByteString Void m a
+sink) = do
       forall (f :: * -> *) a. Functor f => f a -> f ()
 void forall b c a. (b -> c) -> (a -> b) -> a -> c
 . forall (m :: * -> *) r. Monad m => ConduitT () Void m r -> m r
 runConduit forall a b. (a -> b) -> a -> b
 $ do
-        let req :: ConnectRequest
-req = ConnectRequest
+        let req :: ConnectRequest
+req = ConnectRequest
 connectRequest{_connID :: ByteString
 T._connID=String -> ByteString
 BC.pack String
-_connID,
+_connID,
                                  _lastWill :: Maybe LastWill
 T._lastWill=Maybe LastWill
-_lwt,
+_lwt,
                                  _username :: Maybe ByteString
 T._username=String -> ByteString
 BC.pack forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
 <$> Maybe String
-_username,
+_username,
                                  _password :: Maybe ByteString
 T._password=String -> ByteString
 BC.pack forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
 <$> Maybe String
-_password,
+_password,
                                  _cleanSession :: Bool
 T._cleanSession=Bool
-_cleanSession,
+_cleanSession,
                                  _connProperties :: [Property]
 T._connProperties=[Property]
-_connProps}
+_connProps}
         forall (m :: * -> *) o i. Monad m => o -> ConduitT i o m ()
 yield (ByteString -> ByteString
 BL.toStrict forall a b. (a -> b) -> a -> b
 $ forall a. ByteMe a => ProtocolLevel -> a -> ByteString
 toByteString ProtocolLevel
-_protocol ConnectRequest
-req) forall (m :: * -> *) a b c r.
+_protocol ConnectRequest
+req) forall (m :: * -> *) a b c r.
 Monad m =>
 ConduitT a b m () -> ConduitT b c m r -> ConduitT a c m r
 .| ConduitT ByteString Void m a
-sink
+sink
 
       forall (f :: * -> *) a. Applicative f => a -> f a
 pure b
-c
+c
 
-    run :: MQTTConduit -> MQTTClient -> IO ()
-run (ConduitT () ByteString IO ()
-src,ConduitT ByteString Void IO ()
-sink) c :: MQTTClient
-c@MQTTClient{TVar (Maybe (Async ()))
+    run :: MQTTConduit -> MQTTClient -> IO ()
+run (ConduitT () ByteString IO ()
+src,ConduitT ByteString Void IO ()
+sink) c :: MQTTClient
+c@MQTTClient{TVar (Maybe (Async ()))
 TVar Word16
 TVar (Map Word16 Topic)
 TVar (Map (DispatchType, Word16) (TChan MQTTPkt))
@@ -1289,57 +1289,57 @@
 _cb :: MQTTClient -> MessageCallback
 _pktID :: MQTTClient -> TVar Word16
 _ch :: MQTTClient -> TChan MQTTPkt
-..} = do
-      TChan Bool
-pch <- forall a. IO (TChan a)
+..} = do
+      TChan Bool
+pch <- forall a. IO (TChan a)
 newTChanIO
-      Async ()
-o <- forall a. String -> IO a -> IO (Async a)
+      Async ()
+o <- forall a. String -> IO a -> IO (Async a)
 namedAsync String
 "MQTT out" forall a b. (a -> b) -> a -> b
 $ IO ()
-onceConnected forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
+onceConnected forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
 >> IO ()
-processOut
-      Async ()
-p <- forall a. String -> IO a -> IO (Async a)
+processOut
+      Async ()
+p <- forall a. String -> IO a -> IO (Async a)
 namedAsync String
 "MQTT ping" forall a b. (a -> b) -> a -> b
 $ IO ()
-onceConnected forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
+onceConnected forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
 >> forall {b}. IO b
-doPing
-      Async ()
-w <- forall a. String -> IO a -> IO (Async a)
+doPing
+      Async ()
+w <- forall a. String -> IO a -> IO (Async a)
 namedAsync String
 "MQTT watchdog" forall a b. (a -> b) -> a -> b
 $ forall {a} {b}. TChan a -> IO b
-watchdog TChan Bool
-pch
-      Async ()
-s <- forall a. String -> IO a -> IO (Async a)
+watchdog TChan Bool
+pch
+      Async ()
+s <- forall a. String -> IO a -> IO (Async a)
 namedAsync String
 "MQTT in" forall a b. (a -> b) -> a -> b
 $ TChan Bool -> IO ()
-doSrc TChan Bool
-pch
+doSrc TChan Bool
+pch
 
       forall (f :: * -> *) a. Functor f => f a -> f ()
 void forall a b. (a -> b) -> a -> b
 $ forall a. [Async a] -> IO (Async a, a)
 waitAnyCancel [Async ()
-o, Async ()
-p, Async ()
-w, Async ()
-s]
+o, Async ()
+p, Async ()
+w, Async ()
+s]
 
       where
-        doSrc :: TChan Bool -> IO ()
-doSrc TChan Bool
-pch = forall (m :: * -> *) r. Monad m => ConduitT () Void m r -> m r
+        doSrc :: TChan Bool -> IO ()
+doSrc TChan Bool
+pch = forall (m :: * -> *) r. Monad m => ConduitT () Void m r -> m r
 runConduit forall a b. (a -> b) -> a -> b
 $ ConduitT () ByteString IO ()
-src
+src
                     forall (m :: * -> *) a b c r.
 Monad m =>
 ConduitT a b m () -> ConduitT b c m r -> ConduitT a c m r
@@ -1348,7 +1348,7 @@
 Parser a b -> ConduitT a (PositionRange, b) m ()
 conduitParser (ProtocolLevel -> Parser MQTTPkt
 parsePacket ProtocolLevel
-_protocol)
+_protocol)
                     forall (m :: * -> *) a b c r.
 Monad m =>
 ConduitT a b m () -> ConduitT b c m r -> ConduitT a c m r
@@ -1356,17 +1356,17 @@
 Monad m =>
 (a -> m ()) -> ConduitT a o m ()
 C.mapM_ (\(PositionRange
-_,MQTTPkt
-x) -> forall (m :: * -> *) a. MonadIO m => IO a -> m a
+_,MQTTPkt
+x) -> forall (m :: * -> *) a. MonadIO m => IO a -> m a
 liftIO (MQTTClient -> TChan Bool -> MQTTPkt -> IO ()
 dispatch MQTTClient
-c TChan Bool
-pch forall a b. (a -> b) -> a -> b
+c TChan Bool
+pch forall a b. (a -> b) -> a -> b
 $! MQTTPkt
-x))
+x))
 
-        onceConnected :: IO ()
-onceConnected = forall a. STM a -> IO a
+        onceConnected :: IO ()
+onceConnected = forall a. STM a -> IO a
 atomically forall a b. (a -> b) -> a -> b
 $ Bool -> STM ()
 check forall b c a. (b -> c) -> (a -> b) -> a -> c
@@ -1375,10 +1375,10 @@
 Connected) forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
 =<< forall a. TVar a -> STM a
 readTVar TVar ConnState
-_st
+_st
 
-        processOut :: IO ()
-processOut = forall (m :: * -> *) r. Monad m => ConduitT () Void m r -> m r
+        processOut :: IO ()
+processOut = forall (m :: * -> *) r. Monad m => ConduitT () Void m r -> m r
 runConduit forall a b. (a -> b) -> a -> b
 $
           forall (m :: * -> *) a i. Monad m => m a -> ConduitT i a m ()
@@ -1387,10 +1387,10 @@
 atomically forall a b. (a -> b) -> a -> b
 $ MQTTClient -> STM ()
 checkConnected MQTTClient
-c forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
+c forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
 >> forall a. TChan a -> STM a
 readTChan TChan MQTTPkt
-_ch))
+_ch))
           forall (m :: * -> *) a b c r.
 Monad m =>
 ConduitT a b m () -> ConduitT b c m r -> ConduitT a c m r
@@ -1399,60 +1399,60 @@
 BL.toStrict forall b c a. (b -> c) -> (a -> b) -> a -> c
 . forall a. ByteMe a => ProtocolLevel -> a -> ByteString
 toByteString ProtocolLevel
-_protocol)
+_protocol)
           forall (m :: * -> *) a b c r.
 Monad m =>
 ConduitT a b m () -> ConduitT b c m r -> ConduitT a c m r
 .| ConduitT ByteString Void IO ()
-sink
+sink
 
-        doPing :: IO b
-doPing = forall (f :: * -> *) a b. Applicative f => f a -> f b
+        doPing :: IO b
+doPing = forall (f :: * -> *) a b. Applicative f => f a -> f b
 forever forall a b. (a -> b) -> a -> b
 $ Int -> IO ()
 threadDelay Int
-_pingPeriod forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
+_pingPeriod forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
 >> MQTTClient -> MQTTPkt -> IO ()
 sendPacketIO MQTTClient
-c MQTTPkt
+c MQTTPkt
 PingPkt
 
-        watchdog :: TChan a -> IO b
-watchdog TChan a
-ch = forall (f :: * -> *) a b. Applicative f => f a -> f b
+        watchdog :: TChan a -> IO b
+watchdog TChan a
+ch = forall (f :: * -> *) a b. Applicative f => f a -> f b
 forever forall a b. (a -> b) -> a -> b
 $ do
-          TVar Bool
-toch <- Int -> IO (TVar Bool)
+          TVar Bool
+toch <- Int -> IO (TVar Bool)
 registerDelay Int
-_pingPatience
-          Bool
-timedOut <- forall a. STM a -> IO a
+_pingPatience
+          Bool
+timedOut <- forall a. STM a -> IO a
 atomically forall a b. (a -> b) -> a -> b
 $ ((Bool -> STM ()
 check forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
 =<< forall a. TVar a -> STM a
 readTVar TVar Bool
-toch) forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
+toch) forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
 >> forall (f :: * -> *) a. Applicative f => a -> f a
 pure Bool
 True) forall a. STM a -> STM a -> STM a
 `orElse` (forall a. TChan a -> STM a
 readTChan TChan a
-ch forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
+ch forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
 >> forall (f :: * -> *) a. Applicative f => a -> f a
 pure Bool
 False)
           forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
 when Bool
-timedOut forall a b. (a -> b) -> a -> b
+timedOut forall a b. (a -> b) -> a -> b
 $ forall e. Exception e => MQTTClient -> e -> IO ()
 killConn MQTTClient
-c MQTTException
+c MQTTException
 Timeout
 
-    waitForLaunch :: MQTTClient -> Async () -> STM ConnState
-waitForLaunch MQTTClient{TVar (Maybe (Async ()))
+    waitForLaunch :: MQTTClient -> Async () -> STM ConnState
+waitForLaunch MQTTClient{TVar (Maybe (Async ()))
 TVar Word16
 TVar (Map Word16 Topic)
 TVar (Map (DispatchType, Word16) (TChan MQTTPkt))
@@ -1490,31 +1490,31 @@
 _cb :: MQTTClient -> MessageCallback
 _pktID :: MQTTClient -> TVar Word16
 _ch :: MQTTClient -> TChan MQTTPkt
-..} Async ()
-t = do
+..} Async ()
+t = do
       forall a. TVar a -> a -> STM ()
 writeTVar TVar (Maybe (Async ()))
-_ct (forall a. a -> Maybe a
+_ct (forall a. a -> Maybe a
 Just Async ()
-t)
-      ConnState
-c <- forall a. TVar a -> STM a
+t)
+      ConnState
+c <- forall a. TVar a -> STM a
 readTVar TVar ConnState
-_st
+_st
       if ConnState
-c forall a. Eq a => a -> a -> Bool
+c forall a. Eq a => a -> a -> Bool
 == ConnState
 Starting then forall a. STM a
 retry else forall (f :: * -> *) a. Applicative f => a -> f a
 pure ConnState
-c
+c
 
 -- | Wait for a client to terminate its connection.
 -- An exception is thrown if the client didn't terminate expectedly.
 waitForClient :: MQTTClient -> IO ()
 waitForClient :: MQTTClient -> IO ()
-waitForClient c :: MQTTClient
-c@MQTTClient{TVar (Maybe (Async ()))
+waitForClient c :: MQTTClient
+c@MQTTClient{TVar (Maybe (Async ()))
 TVar Word16
 TVar (Map Word16 Topic)
 TVar (Map (DispatchType, Word16) (TChan MQTTPkt))
@@ -1552,11 +1552,11 @@
 _cb :: MQTTClient -> MessageCallback
 _pktID :: MQTTClient -> TVar Word16
 _ch :: MQTTClient -> TChan MQTTPkt
-..} = forall a b c. (a -> b -> c) -> b -> a -> c
+..} = forall a b c. (a -> b -> c) -> b -> a -> c
 flip forall a b. IO a -> IO b -> IO a
 E.finally (MQTTClient -> IO ()
 stopCallbackThread MQTTClient
-c) forall a b. (a -> b) -> a -> b
+c) forall a b. (a -> b) -> a -> b
 $ do
   forall (f :: * -> *) a. Functor f => f a -> f ()
 void forall b c a. (b -> c) -> (a -> b) -> a -> c
@@ -1567,7 +1567,7 @@
 wait forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
 =<< forall a. TVar a -> IO a
 readTVarIO TVar (Maybe (Async ()))
-_ct
+_ct
   forall b a. b -> (a -> b) -> Maybe a -> b
 maybe (forall (f :: * -> *) a. Applicative f => a -> f a
 pure ()) forall e a. Exception e => e -> IO a
@@ -1575,7 +1575,7 @@
 =<< forall a. STM a -> IO a
 atomically (MQTTClient -> ConnState -> STM (Maybe SomeException)
 stateX MQTTClient
-c ConnState
+c ConnState
 Stopped)
 
 -- | Stops the client and closes the connection without sending a DISCONNECT
@@ -1583,7 +1583,7 @@
 -- by the broker if it has been defined.
 stopClient :: MQTTClient -> IO ()
 stopClient :: MQTTClient -> IO ()
-stopClient MQTTClient{TVar (Maybe (Async ()))
+stopClient MQTTClient{TVar (Maybe (Async ()))
 TVar Word16
 TVar (Map Word16 Topic)
 TVar (Map (DispatchType, Word16) (TChan MQTTPkt))
@@ -1621,7 +1621,7 @@
 _cb :: MQTTClient -> MessageCallback
 _pktID :: MQTTClient -> TVar Word16
 _ch :: MQTTClient -> TChan MQTTPkt
-..} = do
+..} = do
   forall (f :: * -> *) a. Functor f => f a -> f ()
 void forall b c a. (b -> c) -> (a -> b) -> a -> c
 . forall (t :: * -> *) (f :: * -> *) a b.
@@ -1631,7 +1631,7 @@
 cancel forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
 =<< forall a. TVar a -> IO a
 readTVarIO TVar (Maybe (Async ()))
-_ct
+_ct
   forall (f :: * -> *) a. Functor f => f a -> f ()
 void forall b c a. (b -> c) -> (a -> b) -> a -> c
 . forall (t :: * -> *) (f :: * -> *) a b.
@@ -1641,16 +1641,16 @@
 cancel forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
 =<< forall a. TVar a -> IO a
 readTVarIO TVar (Maybe (Async ()))
-_cbHandle
+_cbHandle
   forall a. STM a -> IO a
 atomically (forall a. TVar a -> a -> STM ()
 writeTVar TVar ConnState
-_st ConnState
+_st ConnState
 Stopped)
 
 stateX :: MQTTClient -> ConnState -> STM (Maybe E.SomeException)
 stateX :: MQTTClient -> ConnState -> STM (Maybe SomeException)
-stateX MQTTClient{TVar (Maybe (Async ()))
+stateX MQTTClient{TVar (Maybe (Async ()))
 TVar Word16
 TVar (Map Word16 Topic)
 TVar (Map (DispatchType, Word16) (TChan MQTTPkt))
@@ -1688,70 +1688,70 @@
 _cb :: MQTTClient -> MessageCallback
 _pktID :: MQTTClient -> TVar Word16
 _ch :: MQTTClient -> TChan MQTTPkt
-..} ConnState
-want = ConnState -> Maybe SomeException
-f forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
+..} ConnState
+want = ConnState -> Maybe SomeException
+f forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
 <$> forall a. TVar a -> STM a
 readTVar TVar ConnState
-_st
+_st
 
   where
-    je :: String -> Maybe SomeException
-je = forall a. a -> Maybe a
+    je :: String -> Maybe SomeException
+je = forall a. a -> Maybe a
 Just forall b c a. (b -> c) -> (a -> b) -> a -> c
 . forall e. Exception e => e -> SomeException
 E.toException forall b c a. (b -> c) -> (a -> b) -> a -> c
 . String -> MQTTException
 MQTTException
 
-    f :: ConnState -> Maybe E.SomeException
-    f :: ConnState -> Maybe SomeException
-f ConnState
+    f :: ConnState -> Maybe E.SomeException
+    f :: ConnState -> Maybe SomeException
+f ConnState
 Connected    = if ConnState
-want forall a. Eq a => a -> a -> Bool
+want forall a. Eq a => a -> a -> Bool
 == ConnState
 Connected then forall a. Maybe a
 Nothing else String -> Maybe SomeException
-je String
+je String
 "unexpectedly connected"
-    f ConnState
+    f ConnState
 Stopped      = if ConnState
-want forall a. Eq a => a -> a -> Bool
+want forall a. Eq a => a -> a -> Bool
 == ConnState
 Stopped then forall a. Maybe a
 Nothing else String -> Maybe SomeException
-je String
+je String
 "unexpectedly stopped"
-    f ConnState
+    f ConnState
 Disconnected = String -> Maybe SomeException
-je String
+je String
 "disconnected"
-    f ConnState
+    f ConnState
 Starting     = String -> Maybe SomeException
-je String
+je String
 "died while starting"
-    f (DiscoErr DisconnectRequest
-x) = forall a. a -> Maybe a
+    f (DiscoErr DisconnectRequest
+x) = forall a. a -> Maybe a
 Just forall b c a. (b -> c) -> (a -> b) -> a -> c
 . forall e. Exception e => e -> SomeException
 E.toException forall b c a. (b -> c) -> (a -> b) -> a -> c
 . DisconnectRequest -> MQTTException
 Discod forall a b. (a -> b) -> a -> b
 $ DisconnectRequest
-x
-    f (ConnErr ConnACKFlags
-e)  = String -> Maybe SomeException
-je (forall a. Show a => a -> String
+x
+    f (ConnErr ConnACKFlags
+e)  = String -> Maybe SomeException
+je (forall a. Show a => a -> String
 show ConnACKFlags
-e)
+e)
 
-data MQTTException = Timeout | BadData | Discod DisconnectRequest | MQTTException String deriving(MQTTException -> MQTTException -> Bool
+data MQTTException = Timeout | BadData | Discod DisconnectRequest | MQTTException String deriving(MQTTException -> MQTTException -> Bool
 forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
 /= :: MQTTException -> MQTTException -> Bool
 $c/= :: MQTTException -> MQTTException -> Bool
 == :: MQTTException -> MQTTException -> Bool
 $c== :: MQTTException -> MQTTException -> Bool
-Eq, Int -> MQTTException -> ShowS
+Eq, Int -> MQTTException -> ShowS
 [MQTTException] -> ShowS
 MQTTException -> String
 forall a.
@@ -1764,12 +1764,12 @@
 $cshowsPrec :: Int -> MQTTException -> ShowS
 Show)
 
-instance E.Exception MQTTException
+instance E.Exception MQTTException
 
 dispatch :: MQTTClient -> TChan Bool -> MQTTPkt -> IO ()
 dispatch :: MQTTClient -> TChan Bool -> MQTTPkt -> IO ()
-dispatch c :: MQTTClient
-c@MQTTClient{TVar (Maybe (Async ()))
+dispatch c :: MQTTClient
+c@MQTTClient{TVar (Maybe (Async ()))
 TVar Word16
 TVar (Map Word16 Topic)
 TVar (Map (DispatchType, Word16) (TChan MQTTPkt))
@@ -1807,81 +1807,81 @@
 _cb :: MQTTClient -> MessageCallback
 _pktID :: MQTTClient -> TVar Word16
 _ch :: MQTTClient -> TChan MQTTPkt
-..} TChan Bool
-pch MQTTPkt
-pkt =
+..} TChan Bool
+pch MQTTPkt
+pkt =
   case MQTTPkt
-pkt of
-    (ConnACKPkt ConnACKFlags
-p)                            -> ConnACKFlags -> IO ()
-connACKd ConnACKFlags
-p
-    (PublishPkt PublishRequest
-p)                            -> PublishRequest -> IO ()
-pub PublishRequest
-p
-    (SubACKPkt (SubscribeResponse Word16
-i [Either SubErr QoS]
+pkt of
+    (ConnACKPkt ConnACKFlags
+p)                            -> ConnACKFlags -> IO ()
+connACKd ConnACKFlags
+p
+    (PublishPkt PublishRequest
+p)                            -> PublishRequest -> IO ()
+pub PublishRequest
+p
+    (SubACKPkt (SubscribeResponse Word16
+i [Either SubErr QoS]
 _ [Property]
 _))     -> DispatchType -> Word16 -> IO ()
-delegate DispatchType
+delegate DispatchType
 DSubACK Word16
-i
-    (UnsubACKPkt (UnsubscribeResponse Word16
-i [Property]
+i
+    (UnsubACKPkt (UnsubscribeResponse Word16
+i [Property]
 _ [UnsubStatus]
 _)) -> DispatchType -> Word16 -> IO ()
-delegate DispatchType
+delegate DispatchType
 DUnsubACK Word16
-i
-    (PubACKPkt (PubACK Word16
-i Word8
+i
+    (PubACKPkt (PubACK Word16
+i Word8
 _ [Property]
 _))                -> DispatchType -> Word16 -> IO ()
-delegate DispatchType
+delegate DispatchType
 DPubACK Word16
-i
-    (PubRELPkt (PubREL Word16
-i Word8
+i
+    (PubRELPkt (PubREL Word16
+i Word8
 _ [Property]
 _))                -> Word16 -> IO ()
-pubd Word16
-i
-    (PubRECPkt (PubREC Word16
-i Word8
+pubd Word16
+i
+    (PubRECPkt (PubREC Word16
+i Word8
 _ [Property]
 _))                -> DispatchType -> Word16 -> IO ()
-delegate DispatchType
+delegate DispatchType
 DPubREC Word16
-i
-    (PubCOMPPkt (PubCOMP Word16
-i Word8
+i
+    (PubCOMPPkt (PubCOMP Word16
+i Word8
 _ [Property]
 _))              -> DispatchType -> Word16 -> IO ()
-delegate DispatchType
+delegate DispatchType
 DPubCOMP Word16
-i
-    (DisconnectPkt DisconnectRequest
-req)                       -> DisconnectRequest -> IO ()
-disco DisconnectRequest
-req
+i
+    (DisconnectPkt DisconnectRequest
+req)                       -> DisconnectRequest -> IO ()
+disco DisconnectRequest
+req
     MQTTPkt
 PongPkt                                   -> forall a. STM a -> IO a
 atomically forall b c a. (b -> c) -> (a -> b) -> a -> c
 . forall a. TChan a -> a -> STM ()
 writeTChan TChan Bool
-pch forall a b. (a -> b) -> a -> b
+pch forall a b. (a -> b) -> a -> b
 $ Bool
 True
 
     -- Not implemented
-    (AuthPkt AuthRequest
-p)                               -> forall a. String -> a
+    (AuthPkt AuthRequest
+p)                               -> forall a. String -> a
 mqttFail (String
 "unexpected incoming auth: " forall a. Semigroup a => a -> a -> a
 <> forall a. Show a => a -> String
 show AuthRequest
-p)
+p)
 
     -- Things clients shouldn't see
     MQTTPkt
@@ -1902,88 +1902,88 @@
 mqttFail String
 "unexpected incoming unsubscribe"
 
-  where connACKd :: ConnACKFlags -> IO ()
-connACKd connr :: ConnACKFlags
-connr@(ConnACKFlags SessionReuse
-_ ConnACKRC
-val [Property]
+  where connACKd :: ConnACKFlags -> IO ()
+connACKd connr :: ConnACKFlags
+connr@(ConnACKFlags SessionReuse
+_ ConnACKRC
+val [Property]
 _) = case ConnACKRC
-val of
+val of
                                                   ConnACKRC
 ConnAccepted -> forall a. STM a -> IO a
 atomically forall a b. (a -> b) -> a -> b
 $ do
                                                     forall a. TVar a -> a -> STM ()
 writeTVar TVar ConnACKFlags
-_connACKFlags ConnACKFlags
-connr
+_connACKFlags ConnACKFlags
+connr
                                                     forall a. TVar a -> a -> STM ()
 writeTVar TVar ConnState
-_st ConnState
+_st ConnState
 Connected
                                                   ConnACKRC
 _ -> do
-                                                    Maybe (Async ())
-t <- forall a. TVar a -> IO a
+                                                    Maybe (Async ())
+t <- forall a. TVar a -> IO a
 readTVarIO TVar (Maybe (Async ()))
-_ct
+_ct
                                                     forall a. STM a -> IO a
 atomically forall a b. (a -> b) -> a -> b
 $ forall a. TVar a -> a -> STM ()
 writeTVar TVar ConnState
-_st (ConnACKFlags -> ConnState
+_st (ConnACKFlags -> ConnState
 ConnErr ConnACKFlags
-connr)
+connr)
                                                     forall e. Exception e => e -> Maybe (Async ()) -> IO ()
 maybeCancelWith (String -> MQTTException
 MQTTException forall a b. (a -> b) -> a -> b
 $ forall a. Show a => a -> String
 show ConnACKFlags
-connr) Maybe (Async ())
-t
+connr) Maybe (Async ())
+t
 
-        pub :: PublishRequest -> IO ()
-pub p :: PublishRequest
-p@PublishRequest{_pubQoS :: PublishRequest -> QoS
+        pub :: PublishRequest -> IO ()
+pub p :: PublishRequest
+p@PublishRequest{_pubQoS :: PublishRequest -> QoS
 _pubQoS=QoS
 QoS0} = forall a. STM a -> IO a
 atomically (PublishRequest -> STM PublishRequest
-resolve PublishRequest
-p) forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
+resolve PublishRequest
+p) forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
 >>= forall {t :: * -> *}.
 Foldable t =>
 t MQTTPkt -> PublishRequest -> IO ()
-notify forall a. Maybe a
+notify forall a. Maybe a
 Nothing
-        pub p :: PublishRequest
-p@PublishRequest{_pubQoS :: PublishRequest -> QoS
+        pub p :: PublishRequest
+p@PublishRequest{_pubQoS :: PublishRequest -> QoS
 _pubQoS=QoS
-QoS1, Word16
+QoS1, Word16
 _pubPktID :: PublishRequest -> Word16
 _pubPktID :: Word16
 _pubPktID} =
           forall {t :: * -> *}.
 Foldable t =>
 t MQTTPkt -> PublishRequest -> IO ()
-notify (forall a. a -> Maybe a
+notify (forall a. a -> Maybe a
 Just (PubACK -> MQTTPkt
 PubACKPkt (Word16 -> Word8 -> [Property] -> PubACK
 PubACK Word16
-_pubPktID Word8
+_pubPktID Word8
 0 forall a. Monoid a => a
 mempty))) forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
 =<< forall a. STM a -> IO a
 atomically (PublishRequest -> STM PublishRequest
-resolve PublishRequest
-p)
-        pub p :: PublishRequest
-p@PublishRequest{_pubQoS :: PublishRequest -> QoS
+resolve PublishRequest
+p)
+        pub p :: PublishRequest
+p@PublishRequest{_pubQoS :: PublishRequest -> QoS
 _pubQoS=QoS
 QoS2} = forall a. STM a -> IO a
 atomically forall a b. (a -> b) -> a -> b
 $ do
-          p' :: PublishRequest
-p'@PublishRequest{Bool
+          p' :: PublishRequest
+p'@PublishRequest{Bool
 [Property]
 Word16
 ByteString
@@ -2003,25 +2003,25 @@
 _pubPktID :: PublishRequest -> Word16
 _pubQoS :: PublishRequest -> QoS
 ..} <- PublishRequest -> STM PublishRequest
-resolve PublishRequest
-p
+resolve PublishRequest
+p
           forall k v. Ord k => k -> v -> Map k v -> STM ()
 Decaying.insert Word16
-_pubPktID PublishRequest
-p' Map Word16 PublishRequest
-_inflight
+_pubPktID PublishRequest
+p' Map Word16 PublishRequest
+_inflight
           MQTTClient -> MQTTPkt -> STM ()
 sendPacket MQTTClient
-c (PubREC -> MQTTPkt
+c (PubREC -> MQTTPkt
 PubRECPkt (Word16 -> Word8 -> [Property] -> PubREC
 PubREC Word16
-_pubPktID Word8
+_pubPktID Word8
 0 forall a. Monoid a => a
 mempty))
 
-        pubd :: Word16 -> IO ()
-pubd Word16
-i = forall a. STM a -> IO a
+        pubd :: Word16 -> IO ()
+pubd Word16
+i = forall a. STM a -> IO a
 atomically (forall k a.
 Ord k =>
 (k -> a -> Maybe a) -> k -> Map k a -> STM (Maybe a)
@@ -2029,35 +2029,35 @@
 _ PublishRequest
 _ -> forall a. Maybe a
 Nothing) Word16
-i Map Word16 PublishRequest
-_inflight) forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
+i Map Word16 PublishRequest
+_inflight) forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
 >>= \case
             Maybe PublishRequest
 Nothing -> MQTTClient -> MQTTPkt -> IO ()
 sendPacketIO MQTTClient
-c (PubCOMP -> MQTTPkt
+c (PubCOMP -> MQTTPkt
 PubCOMPPkt (Word16 -> Word8 -> [Property] -> PubCOMP
 PubCOMP Word16
-i Word8
+i Word8
 0x92 forall a. Monoid a => a
 mempty))
-            Just PublishRequest
-p  -> forall {t :: * -> *}.
+            Just PublishRequest
+p  -> forall {t :: * -> *}.
 Foldable t =>
 t MQTTPkt -> PublishRequest -> IO ()
-notify (forall a. a -> Maybe a
+notify (forall a. a -> Maybe a
 Just (PubCOMP -> MQTTPkt
 PubCOMPPkt (Word16 -> Word8 -> [Property] -> PubCOMP
 PubCOMP Word16
-i Word8
+i Word8
 0 forall a. Monoid a => a
 mempty))) PublishRequest
-p
+p
 
-        notify :: t MQTTPkt -> PublishRequest -> IO ()
-notify t MQTTPkt
-rpkt p :: PublishRequest
-p@PublishRequest{Bool
+        notify :: t MQTTPkt -> PublishRequest -> IO ()
+notify t MQTTPkt
+rpkt p :: PublishRequest
+p@PublishRequest{Bool
 [Property]
 Word16
 ByteString
@@ -2076,115 +2076,115 @@
 _pubDup :: PublishRequest -> Bool
 _pubPktID :: PublishRequest -> Word16
 _pubQoS :: PublishRequest -> QoS
-..} = do
+..} = do
           forall a. STM a -> IO a
 atomically forall a b. (a -> b) -> a -> b
 $ forall k v. Ord k => k -> Map k v -> STM ()
 Decaying.delete Word16
-_pubPktID Map Word16 PublishRequest
-_inflight
-          MessageCallback
-cb <- forall b a. b -> (a -> b) -> Maybe a -> b
+_pubPktID Map Word16 PublishRequest
+_inflight
+          MessageCallback
+cb <- forall b a. b -> (a -> b) -> Maybe a -> b
 maybe (forall (f :: * -> *) a. Applicative f => a -> f a
 pure MessageCallback
-_cb) (\ByteString
-cd -> forall a. STM a -> IO a
+_cb) (\ByteString
+cd -> forall a. STM a -> IO a
 atomically (forall k v. Ord k => v -> k -> Map k v -> STM v
 Decaying.findWithDefault MessageCallback
-_cb ByteString
-cd Map ByteString MessageCallback
-_corr)) Maybe ByteString
-cdata
+_cb ByteString
+cd Map ByteString MessageCallback
+_corr)) Maybe ByteString
+cdata
           forall a. a -> IO a
 E.evaluate forall b c a. (b -> c) -> (a -> b) -> a -> c
 . forall a. NFData a => a -> a
 force forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
 =<< case MessageCallback
-cb of
+cb of
                                    MessageCallback
 NoCallback                -> forall (f :: * -> *) a. Applicative f => a -> f a
 pure ()
-                                   SimpleCallback MQTTClient -> Topic -> ByteString -> [Property] -> IO ()
-f          -> forall {a}. IO a -> IO ()
-call (MQTTClient -> Topic -> ByteString -> [Property] -> IO ()
-f MQTTClient
-c (ByteString -> Topic
+                                   SimpleCallback MQTTClient -> Topic -> ByteString -> [Property] -> IO ()
+f          -> forall {a}. IO a -> IO ()
+call (MQTTClient -> Topic -> ByteString -> [Property] -> IO ()
+f MQTTClient
+c (ByteString -> Topic
 blToTopic ByteString
-_pubTopic) ByteString
-_pubBody [Property]
-_pubProps)
-                                   OrderedCallback MQTTClient -> Topic -> ByteString -> [Property] -> IO ()
-f         -> forall {a}. IO a -> IO ()
-callOrd (MQTTClient -> Topic -> ByteString -> [Property] -> IO ()
-f MQTTClient
-c (ByteString -> Topic
+_pubTopic) ByteString
+_pubBody [Property]
+_pubProps)
+                                   OrderedCallback MQTTClient -> Topic -> ByteString -> [Property] -> IO ()
+f         -> forall {a}. IO a -> IO ()
+callOrd (MQTTClient -> Topic -> ByteString -> [Property] -> IO ()
+f MQTTClient
+c (ByteString -> Topic
 blToTopic ByteString
-_pubTopic) ByteString
-_pubBody [Property]
-_pubProps)
-                                   LowLevelCallback MQTTClient -> PublishRequest -> IO ()
-f        -> forall {a}. IO a -> IO ()
-call (MQTTClient -> PublishRequest -> IO ()
-f MQTTClient
-c PublishRequest
-p)
-                                   OrderedLowLevelCallback MQTTClient -> PublishRequest -> IO ()
-f -> forall {a}. IO a -> IO ()
-callOrd (MQTTClient -> PublishRequest -> IO ()
-f MQTTClient
-c PublishRequest
-p)
+_pubTopic) ByteString
+_pubBody [Property]
+_pubProps)
+                                   LowLevelCallback MQTTClient -> PublishRequest -> IO ()
+f        -> forall {a}. IO a -> IO ()
+call (MQTTClient -> PublishRequest -> IO ()
+f MQTTClient
+c PublishRequest
+p)
+                                   OrderedLowLevelCallback MQTTClient -> PublishRequest -> IO ()
+f -> forall {a}. IO a -> IO ()
+callOrd (MQTTClient -> PublishRequest -> IO ()
+f MQTTClient
+c PublishRequest
+p)
 
             where
-              call :: IO a -> IO ()
-call IO a
-a = forall a. Async a -> IO ()
+              call :: IO a -> IO ()
+call IO a
+a = forall a. Async a -> IO ()
 link forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
 =<< forall a. String -> IO a -> IO (Async a)
 namedAsync String
 "notifier" (IO a
-a forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
+a forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
 >> IO ()
-respond)
-              callOrd :: IO a -> IO ()
-callOrd IO a
-a = forall a. MVar a -> a -> IO ()
+respond)
+              callOrd :: IO a -> IO ()
+callOrd IO a
+a = forall a. MVar a -> a -> IO ()
 putMVar MVar (IO ())
-_cbM forall a b. (a -> b) -> a -> b
+_cbM forall a b. (a -> b) -> a -> b
 $ IO a
-a forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
+a forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
 >> IO ()
-respond
-              respond :: IO ()
-respond = forall (t :: * -> *) (f :: * -> *) a b.
+respond
+              respond :: IO ()
+respond = forall (t :: * -> *) (f :: * -> *) a b.
 (Foldable t, Applicative f) =>
 (a -> f b) -> t a -> f ()
 traverse_ (MQTTClient -> MQTTPkt -> IO ()
 sendPacketIO MQTTClient
-c) t MQTTPkt
-rpkt
-              cdata :: Maybe ByteString
-cdata = forall (t :: * -> *) a b.
+c) t MQTTPkt
+rpkt
+              cdata :: Maybe ByteString
+cdata = forall (t :: * -> *) a b.
 Foldable t =>
 (a -> b -> b) -> b -> t a -> b
 foldr Property -> Maybe ByteString -> Maybe ByteString
-f forall a. Maybe a
+f forall a. Maybe a
 Nothing [Property]
-_pubProps
-                where f :: Property -> Maybe ByteString -> Maybe ByteString
-f (PropCorrelationData ByteString
-x) Maybe ByteString
+_pubProps
+                where f :: Property -> Maybe ByteString -> Maybe ByteString
+f (PropCorrelationData ByteString
+x) Maybe ByteString
 _ = forall a. a -> Maybe a
 Just ByteString
-x
-                      f Property
-_ Maybe ByteString
-o                       = Maybe ByteString
-o
+x
+                      f Property
+_ Maybe ByteString
+o                       = Maybe ByteString
+o
 
-        resolve :: PublishRequest -> STM PublishRequest
-resolve p :: PublishRequest
-p@PublishRequest{Bool
+        resolve :: PublishRequest -> STM PublishRequest
+resolve p :: PublishRequest
+p@PublishRequest{Bool
 [Property]
 Word16
 ByteString
@@ -2203,179 +2203,179 @@
 _pubDup :: PublishRequest -> Bool
 _pubPktID :: PublishRequest -> Word16
 _pubQoS :: PublishRequest -> QoS
-..} = do
-          Topic
-topic <- Maybe Word16 -> STM Topic
-resolveTopic (forall (t :: * -> *) a b.
+..} = do
+          Topic
+topic <- Maybe Word16 -> STM Topic
+resolveTopic (forall (t :: * -> *) a b.
 Foldable t =>
 (a -> b -> b) -> b -> t a -> b
 foldr Property -> Maybe Word16 -> Maybe Word16
-aliasID forall a. Maybe a
+aliasID forall a. Maybe a
 Nothing [Property]
-_pubProps)
+_pubProps)
           forall (f :: * -> *) a. Applicative f => a -> f a
 pure PublishRequest
-p{_pubTopic :: ByteString
+p{_pubTopic :: ByteString
 _pubTopic=Topic -> ByteString
 topicToBL Topic
-topic}
+topic}
 
           where
-            aliasID :: Property -> Maybe Word16 -> Maybe Word16
-aliasID (PropTopicAlias Word16
-x) Maybe Word16
+            aliasID :: Property -> Maybe Word16 -> Maybe Word16
+aliasID (PropTopicAlias Word16
+x) Maybe Word16
 _ = forall a. a -> Maybe a
 Just Word16
-x
-            aliasID Property
-_ Maybe Word16
-o                  = Maybe Word16
-o
+x
+            aliasID Property
+_ Maybe Word16
+o                  = Maybe Word16
+o
 
-            resolveTopic :: Maybe Word16 -> STM Topic
-resolveTopic Maybe Word16
+            resolveTopic :: Maybe Word16 -> STM Topic
+resolveTopic Maybe Word16
 Nothing = forall (f :: * -> *) a. Applicative f => a -> f a
 pure (ByteString -> Topic
 blToTopic ByteString
-_pubTopic)
-            resolveTopic (Just Word16
-x) = do
+_pubTopic)
+            resolveTopic (Just Word16
+x) = do
               forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
 when (ByteString
-_pubTopic forall a. Eq a => a -> a -> Bool
+_pubTopic forall a. Eq a => a -> a -> Bool
 /= ByteString
 "") forall a b. (a -> b) -> a -> b
 $ forall a. TVar a -> (a -> a) -> STM ()
 modifyTVar' TVar (Map Word16 Topic)
-_inA (forall k a. Ord k => k -> a -> Map k a -> Map k a
+_inA (forall k a. Ord k => k -> a -> Map k a -> Map k a
 Map.insert Word16
-x (ByteString -> Topic
+x (ByteString -> Topic
 blToTopic ByteString
-_pubTopic))
+_pubTopic))
               forall b a. b -> (a -> b) -> Maybe a -> b
 maybe (forall a. String -> a
 mqttFail (String
 "failed to lookup topic alias " forall a. Semigroup a => a -> a -> a
 <> forall a. Show a => a -> String
 show Word16
-x)) forall (f :: * -> *) a. Applicative f => a -> f a
+x)) forall (f :: * -> *) a. Applicative f => a -> f a
 pure forall b c a. (b -> c) -> (a -> b) -> a -> c
 . forall k a. Ord k => k -> Map k a -> Maybe a
 Map.lookup Word16
-x forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
+x forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
 =<< forall a. TVar a -> STM a
 readTVar TVar (Map Word16 Topic)
-_inA
+_inA
 
-        delegate :: DispatchType -> Word16 -> IO ()
-delegate DispatchType
-dt Word16
-pid = forall a. STM a -> IO a
+        delegate :: DispatchType -> Word16 -> IO ()
+delegate DispatchType
+dt Word16
+pid = forall a. STM a -> IO a
 atomically forall a b. (a -> b) -> a -> b
 $
           forall b a. b -> (a -> b) -> Maybe a -> b
 maybe (DispatchType -> STM ()
-nak DispatchType
-dt) (forall a. TChan a -> a -> STM ()
+nak DispatchType
+dt) (forall a. TChan a -> a -> STM ()
 `writeTChan` MQTTPkt
-pkt) forall b c a. (b -> c) -> (a -> b) -> a -> c
+pkt) forall b c a. (b -> c) -> (a -> b) -> a -> c
 . forall k a. Ord k => k -> Map k a -> Maybe a
 Map.lookup (DispatchType
-dt, Word16
-pid) forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
+dt, Word16
+pid) forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
 =<< forall a. TVar a -> STM a
 readTVar TVar (Map (DispatchType, Word16) (TChan MQTTPkt))
-_acks
+_acks
 
             where
-              nak :: DispatchType -> STM ()
-nak DispatchType
+              nak :: DispatchType -> STM ()
+nak DispatchType
 DPubREC = MQTTClient -> MQTTPkt -> STM ()
 sendPacket MQTTClient
-c (PubREL -> MQTTPkt
+c (PubREL -> MQTTPkt
 PubRELPkt  (Word16 -> Word8 -> [Property] -> PubREL
 PubREL  Word16
-pid Word8
+pid Word8
 0x92 forall a. Monoid a => a
 mempty))
-              nak DispatchType
+              nak DispatchType
 _       = forall (f :: * -> *) a. Applicative f => a -> f a
 pure ()
 
 
-        disco :: DisconnectRequest -> IO ()
-disco DisconnectRequest
-req = do
+        disco :: DisconnectRequest -> IO ()
+disco DisconnectRequest
+req = do
           forall a. STM a -> IO a
 atomically forall a b. (a -> b) -> a -> b
 $ forall a. TVar a -> a -> STM ()
 writeTVar TVar ConnState
-_st (DisconnectRequest -> ConnState
+_st (DisconnectRequest -> ConnState
 DiscoErr DisconnectRequest
-req)
+req)
           forall e. Exception e => e -> Maybe (Async ()) -> IO ()
 maybeCancelWith (DisconnectRequest -> MQTTException
 Discod DisconnectRequest
-req) forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
+req) forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
 =<< forall a. TVar a -> IO a
 readTVarIO TVar (Maybe (Async ()))
-_ct
+_ct
 
 -- Run OrderedCallbacks in a background thread. Does nothing for other callback types.
 -- We keep the async handle in a TVar and make sure only one of these threads is running.
 runCallbackThread :: MQTTClient -> IO ()
 runCallbackThread :: MQTTClient -> IO ()
-runCallbackThread MQTTClient{MessageCallback
+runCallbackThread MQTTClient{MessageCallback
 _cb :: MessageCallback
 _cb :: MQTTClient -> MessageCallback
-_cb, MVar (IO ())
+_cb, MVar (IO ())
 _cbM :: MVar (IO ())
 _cbM :: MQTTClient -> MVar (IO ())
-_cbM, TVar (Maybe (Async ()))
+_cbM, TVar (Maybe (Async ()))
 _cbHandle :: TVar (Maybe (Async ()))
 _cbHandle :: MQTTClient -> TVar (Maybe (Async ()))
-_cbHandle}
+_cbHandle}
   | MessageCallback -> Bool
-isOrdered MessageCallback
-_cb = do
+isOrdered MessageCallback
+_cb = do
       -- We always spawn a thread, but may kill it if we already have
       -- one.  The new thread won't start until we atomically confirm
       -- it's the only one.
-      TVar Bool
-latch <- forall a. a -> IO (TVar a)
+      TVar Bool
+latch <- forall a. a -> IO (TVar a)
 newTVarIO Bool
 False
-      Async ()
-handle <- forall a. String -> IO a -> IO (Async a)
+      Async ()
+handle <- forall a. String -> IO a -> IO (Async a)
 namedAsync String
 "ordered callbacks" (TVar Bool -> IO ()
-waitFor TVar Bool
-latch forall (f :: * -> *) a b. Applicative f => f a -> f b -> f b
+waitFor TVar Bool
+latch forall (f :: * -> *) a b. Applicative f => f a -> f b -> f b
 *> forall {b}. IO b
-runOrderedCallbacks)
+runOrderedCallbacks)
       forall (m :: * -> *) a. Monad m => m (m a) -> m a
 join forall b c a. (b -> c) -> (a -> b) -> a -> c
 . forall a. STM a -> IO a
 atomically forall a b. (a -> b) -> a -> b
 $ do
-        Maybe (Async ())
-cbThread <- forall a. TVar a -> STM a
+        Maybe (Async ())
+cbThread <- forall a. TVar a -> STM a
 readTVar TVar (Maybe (Async ()))
-_cbHandle
+_cbHandle
         case Maybe (Async ())
-cbThread of
+cbThread of
           Maybe (Async ())
 Nothing -> do
             -- This is the first thread.  Flip the latch and put it in place.
             forall a. TVar a -> a -> STM ()
 writeTVar TVar Bool
-latch Bool
+latch Bool
 True
             forall a. TVar a -> a -> STM ()
 writeTVar TVar (Maybe (Async ()))
-_cbHandle (forall a. a -> Maybe a
+_cbHandle (forall a. a -> Maybe a
 Just Async ()
-handle)
+handle)
             forall (f :: * -> *) a. Applicative f => a -> f a
 pure (forall (f :: * -> *) a. Applicative f => a -> f a
 pure ())
@@ -2383,68 +2383,68 @@
 _ -> forall (f :: * -> *) a. Applicative f => a -> f a
 pure (forall a. Async a -> IO ()
 cancel Async ()
-handle) -- otherwise, cancel the temporary thread.
+handle) -- otherwise, cancel the temporary thread.
   | Bool
 otherwise = forall (f :: * -> *) a. Applicative f => a -> f a
 pure ()
-    where isOrdered :: MessageCallback -> Bool
-isOrdered (OrderedCallback MQTTClient -> Topic -> ByteString -> [Property] -> IO ()
+    where isOrdered :: MessageCallback -> Bool
+isOrdered (OrderedCallback MQTTClient -> Topic -> ByteString -> [Property] -> IO ()
 _)         = Bool
 True
-          isOrdered (OrderedLowLevelCallback MQTTClient -> PublishRequest -> IO ()
+          isOrdered (OrderedLowLevelCallback MQTTClient -> PublishRequest -> IO ()
 _) = Bool
 True
-          isOrdered MessageCallback
+          isOrdered MessageCallback
 _                           = Bool
 False
-          waitFor :: TVar Bool -> IO ()
-waitFor TVar Bool
-latch = forall a. STM a -> IO a
+          waitFor :: TVar Bool -> IO ()
+waitFor TVar Bool
+latch = forall a. STM a -> IO a
 atomically (Bool -> STM ()
 check forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
 =<< forall a. TVar a -> STM a
 readTVar TVar Bool
-latch)
+latch)
           -- Keep running callbacks from the MVar
-          runOrderedCallbacks :: IO b
-runOrderedCallbacks = forall (f :: * -> *) a b. Applicative f => f a -> f b
+          runOrderedCallbacks :: IO b
+runOrderedCallbacks = forall (f :: * -> *) a b. Applicative f => f a -> f b
 forever forall b c a. (b -> c) -> (a -> b) -> a -> c
 . forall (m :: * -> *) a. Monad m => m (m a) -> m a
 join forall b c a. (b -> c) -> (a -> b) -> a -> c
 . forall a. MVar a -> IO a
 takeMVar forall a b. (a -> b) -> a -> b
 $ MVar (IO ())
-_cbM
+_cbM
 
 -- Stop the background thread for OrderedCallbacks. Does nothing for other callback types.
 stopCallbackThread :: MQTTClient -> IO ()
 stopCallbackThread :: MQTTClient -> IO ()
-stopCallbackThread MQTTClient{TVar (Maybe (Async ()))
+stopCallbackThread MQTTClient{TVar (Maybe (Async ()))
 _cbHandle :: TVar (Maybe (Async ()))
 _cbHandle :: MQTTClient -> TVar (Maybe (Async ()))
-_cbHandle} = forall b a. b -> (a -> b) -> Maybe a -> b
+_cbHandle} = forall b a. b -> (a -> b) -> Maybe a -> b
 maybe (forall (f :: * -> *) a. Applicative f => a -> f a
 pure ()) forall a. Async a -> IO ()
 cancel forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
 =<< forall a. TVar a -> IO a
 readTVarIO TVar (Maybe (Async ()))
-_cbHandle
+_cbHandle
 
-maybeCancelWith :: E.Exception e => e -> Maybe (Async ()) -> IO ()
+maybeCancelWith :: E.Exception e => e -> Maybe (Async ()) -> IO ()
 maybeCancelWith :: forall e. Exception e => e -> Maybe (Async ()) -> IO ()
-maybeCancelWith e
-e = forall (f :: * -> *) a. Functor f => f a -> f ()
+maybeCancelWith e
+e = forall (f :: * -> *) a. Functor f => f a -> f ()
 void forall b c a. (b -> c) -> (a -> b) -> a -> c
 . forall (t :: * -> *) (f :: * -> *) a b.
 (Traversable t, Applicative f) =>
 (a -> f b) -> t a -> f (t b)
 traverse (forall e a. Exception e => Async a -> e -> IO ()
 `cancelWith` e
-e)
+e)
 
-killConn :: E.Exception e => MQTTClient -> e -> IO ()
+killConn :: E.Exception e => MQTTClient -> e -> IO ()
 killConn :: forall e. Exception e => MQTTClient -> e -> IO ()
-killConn MQTTClient{TVar (Maybe (Async ()))
+killConn MQTTClient{TVar (Maybe (Async ()))
 TVar Word16
 TVar (Map Word16 Topic)
 TVar (Map (DispatchType, Word16) (TChan MQTTPkt))
@@ -2482,24 +2482,24 @@
 _cb :: MQTTClient -> MessageCallback
 _pktID :: MQTTClient -> TVar Word16
 _ch :: MQTTClient -> TChan MQTTPkt
-..} e
-e = forall a. TVar a -> IO a
+..} e
+e = forall a. TVar a -> IO a
 readTVarIO TVar (Maybe (Async ()))
-_ct forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
+_ct forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
 >>= forall e. Exception e => e -> Maybe (Async ()) -> IO ()
 maybeCancelWith e
-e
+e
 
 checkConnected :: MQTTClient -> STM ()
 checkConnected :: MQTTClient -> STM ()
-checkConnected MQTTClient
-mc = forall b a. b -> (a -> b) -> Maybe a -> b
+checkConnected MQTTClient
+mc = forall b a. b -> (a -> b) -> Maybe a -> b
 maybe (forall (f :: * -> *) a. Applicative f => a -> f a
 pure ()) forall a e. Exception e => e -> a
 E.throw forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
 =<< MQTTClient -> ConnState -> STM (Maybe SomeException)
 stateX MQTTClient
-mc ConnState
+mc ConnState
 Connected
 
 -- | True if we're currently in a normally connected state (in the IO monad).
@@ -2513,7 +2513,7 @@
 -- | True if we're currently in a normally connected state (in the STM monad).
 isConnectedSTM :: MQTTClient -> STM Bool
 isConnectedSTM :: MQTTClient -> STM Bool
-isConnectedSTM MQTTClient{TVar (Maybe (Async ()))
+isConnectedSTM MQTTClient{TVar (Maybe (Async ()))
 TVar Word16
 TVar (Map Word16 Topic)
 TVar (Map (DispatchType, Word16) (TChan MQTTPkt))
@@ -2551,17 +2551,17 @@
 _cb :: MQTTClient -> MessageCallback
 _pktID :: MQTTClient -> TVar Word16
 _ch :: MQTTClient -> TChan MQTTPkt
-..} = (ConnState
+..} = (ConnState
 Connected forall a. Eq a => a -> a -> Bool
 ==) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
 <$> forall a. TVar a -> STM a
 readTVar TVar ConnState
-_st
+_st
 
 sendPacket :: MQTTClient -> MQTTPkt -> STM ()
 sendPacket :: MQTTClient -> MQTTPkt -> STM ()
-sendPacket c :: MQTTClient
-c@MQTTClient{TVar (Maybe (Async ()))
+sendPacket c :: MQTTClient
+c@MQTTClient{TVar (Maybe (Async ()))
 TVar Word16
 TVar (Map Word16 Topic)
 TVar (Map (DispatchType, Word16) (TChan MQTTPkt))
@@ -2599,23 +2599,23 @@
 _cb :: MQTTClient -> MessageCallback
 _pktID :: MQTTClient -> TVar Word16
 _ch :: MQTTClient -> TChan MQTTPkt
-..} MQTTPkt
-p = MQTTClient -> STM ()
+..} MQTTPkt
+p = MQTTClient -> STM ()
 checkConnected MQTTClient
-c forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
+c forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
 >> forall a. TChan a -> a -> STM ()
 writeTChan TChan MQTTPkt
-_ch MQTTPkt
-p
+_ch MQTTPkt
+p
 
 sendPacketIO :: MQTTClient -> MQTTPkt -> IO ()
 sendPacketIO :: MQTTClient -> MQTTPkt -> IO ()
-sendPacketIO MQTTClient
-c = forall a. STM a -> IO a
+sendPacketIO MQTTClient
+c = forall a. STM a -> IO a
 atomically forall b c a. (b -> c) -> (a -> b) -> a -> c
 . MQTTClient -> MQTTPkt -> STM ()
 sendPacket MQTTClient
-c
+c
 
 textToBL :: Text -> BL.ByteString
 textToBL :: Text -> ByteString
@@ -2656,8 +2656,8 @@
 
 reservePktID :: MQTTClient -> [DispatchType] -> STM (TChan MQTTPkt, Word16)
 reservePktID :: MQTTClient -> [DispatchType] -> STM (TChan MQTTPkt, Word16)
-reservePktID c :: MQTTClient
-c@MQTTClient{TVar (Maybe (Async ()))
+reservePktID c :: MQTTClient
+c@MQTTClient{TVar (Maybe (Async ()))
 TVar Word16
 TVar (Map Word16 Topic)
 TVar (Map (DispatchType, Word16) (TChan MQTTPkt))
@@ -2695,23 +2695,23 @@
 _cb :: MQTTClient -> MessageCallback
 _pktID :: MQTTClient -> TVar Word16
 _ch :: MQTTClient -> TChan MQTTPkt
-..} [DispatchType]
-dts = do
+..} [DispatchType]
+dts = do
   MQTTClient -> STM ()
 checkConnected MQTTClient
-c
-  TChan MQTTPkt
-ch <- forall a. STM (TChan a)
+c
+  TChan MQTTPkt
+ch <- forall a. STM (TChan a)
 newTChan
-  Word16
-pid <- forall a. TVar a -> STM a
+  Word16
+pid <- forall a. TVar a -> STM a
 readTVar TVar Word16
-_pktID
+_pktID
   forall a. TVar a -> (a -> a) -> STM ()
 modifyTVar' TVar Word16
-_pktID forall a b. (a -> b) -> a -> b
+_pktID forall a b. (a -> b) -> a -> b
 $ if Word16
-pid forall a. Eq a => a -> a -> Bool
+pid forall a. Eq a => a -> a -> Bool
 == forall a. Bounded a => a
 maxBound then forall a b. a -> b -> a
 const Word16
@@ -2719,23 +2719,23 @@
 succ
   forall a. TVar a -> (a -> a) -> STM ()
 modifyTVar' TVar (Map (DispatchType, Word16) (TChan MQTTPkt))
-_acks (forall k a. Ord k => Map k a -> Map k a -> Map k a
+_acks (forall k a. Ord k => Map k a -> Map k a -> Map k a
 Map.union (forall k a. Ord k => [(k, a)] -> Map k a
 Map.fromList [((DispatchType
-t, Word16
-pid), TChan MQTTPkt
-ch) | DispatchType
-t <- [DispatchType]
-dts]))
+t, Word16
+pid), TChan MQTTPkt
+ch) | DispatchType
+t <- [DispatchType]
+dts]))
   forall (f :: * -> *) a. Applicative f => a -> f a
 pure (TChan MQTTPkt
-ch,Word16
-pid)
+ch,Word16
+pid)
 
 releasePktID :: MQTTClient -> (DispatchType,Word16) -> STM ()
 releasePktID :: MQTTClient -> (DispatchType, Word16) -> STM ()
-releasePktID c :: MQTTClient
-c@MQTTClient{TVar (Maybe (Async ()))
+releasePktID c :: MQTTClient
+c@MQTTClient{TVar (Maybe (Async ()))
 TVar Word16
 TVar (Map Word16 Topic)
 TVar (Map (DispatchType, Word16) (TChan MQTTPkt))
@@ -2773,20 +2773,20 @@
 _cb :: MQTTClient -> MessageCallback
 _pktID :: MQTTClient -> TVar Word16
 _ch :: MQTTClient -> TChan MQTTPkt
-..} (DispatchType, Word16)
-k = MQTTClient -> STM ()
+..} (DispatchType, Word16)
+k = MQTTClient -> STM ()
 checkConnected MQTTClient
-c forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
+c forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
 >> forall a. TVar a -> (a -> a) -> STM ()
 modifyTVar' TVar (Map (DispatchType, Word16) (TChan MQTTPkt))
-_acks (forall k a. Ord k => k -> Map k a -> Map k a
+_acks (forall k a. Ord k => k -> Map k a -> Map k a
 Map.delete (DispatchType, Word16)
-k)
+k)
 
 releasePktIDs :: MQTTClient -> [(DispatchType,Word16)] -> STM ()
 releasePktIDs :: MQTTClient -> [(DispatchType, Word16)] -> STM ()
-releasePktIDs c :: MQTTClient
-c@MQTTClient{TVar (Maybe (Async ()))
+releasePktIDs c :: MQTTClient
+c@MQTTClient{TVar (Maybe (Async ()))
 TVar Word16
 TVar (Map Word16 Topic)
 TVar (Map (DispatchType, Word16) (TChan MQTTPkt))
@@ -2824,27 +2824,27 @@
 _cb :: MQTTClient -> MessageCallback
 _pktID :: MQTTClient -> TVar Word16
 _ch :: MQTTClient -> TChan MQTTPkt
-..} [(DispatchType, Word16)]
-ks = MQTTClient -> STM ()
+..} [(DispatchType, Word16)]
+ks = MQTTClient -> STM ()
 checkConnected MQTTClient
-c forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
+c forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
 >> forall a. TVar a -> (a -> a) -> STM ()
 modifyTVar' TVar (Map (DispatchType, Word16) (TChan MQTTPkt))
-_acks forall {a}.
+_acks forall {a}.
 Map (DispatchType, Word16) a -> Map (DispatchType, Word16) a
-deleteMany
-  where deleteMany :: Map (DispatchType, Word16) a -> Map (DispatchType, Word16) a
-deleteMany Map (DispatchType, Word16) a
-m = forall k a. Ord k => Map k a -> Set k -> Map k a
+deleteMany
+  where deleteMany :: Map (DispatchType, Word16) a -> Map (DispatchType, Word16) a
+deleteMany Map (DispatchType, Word16) a
+m = forall k a. Ord k => Map k a -> Set k -> Map k a
 Map.withoutKeys Map (DispatchType, Word16) a
-m (forall a. Ord a => [a] -> Set a
+m (forall a. Ord a => [a] -> Set a
 Set.fromList [(DispatchType, Word16)]
-ks)
+ks)
 
 sendAndWait :: MQTTClient -> DispatchType -> (Word16 -> MQTTPkt) -> IO MQTTPkt
 sendAndWait :: MQTTClient -> DispatchType -> (Word16 -> MQTTPkt) -> IO MQTTPkt
-sendAndWait c :: MQTTClient
-c@MQTTClient{TVar (Maybe (Async ()))
+sendAndWait c :: MQTTClient
+c@MQTTClient{TVar (Maybe (Async ()))
 TVar Word16
 TVar (Map Word16 Topic)
 TVar (Map (DispatchType, Word16) (TChan MQTTPkt))
@@ -2882,41 +2882,41 @@
 _cb :: MQTTClient -> MessageCallback
 _pktID :: MQTTClient -> TVar Word16
 _ch :: MQTTClient -> TChan MQTTPkt
-..} DispatchType
-dt Word16 -> MQTTPkt
-f = do
-  (TChan MQTTPkt
-ch,Word16
-pid) <- forall a. STM a -> IO a
+..} DispatchType
+dt Word16 -> MQTTPkt
+f = do
+  (TChan MQTTPkt
+ch,Word16
+pid) <- forall a. STM a -> IO a
 atomically forall a b. (a -> b) -> a -> b
 $ do
-    (TChan MQTTPkt
-ch,Word16
-pid) <- MQTTClient -> [DispatchType] -> STM (TChan MQTTPkt, Word16)
+    (TChan MQTTPkt
+ch,Word16
+pid) <- MQTTClient -> [DispatchType] -> STM (TChan MQTTPkt, Word16)
 reservePktID MQTTClient
-c [DispatchType
-dt]
+c [DispatchType
+dt]
     MQTTClient -> MQTTPkt -> STM ()
 sendPacket MQTTClient
-c (Word16 -> MQTTPkt
-f Word16
-pid)
+c (Word16 -> MQTTPkt
+f Word16
+pid)
     forall (f :: * -> *) a. Applicative f => a -> f a
 pure (TChan MQTTPkt
-ch,Word16
-pid)
+ch,Word16
+pid)
 
   -- Wait for the response in a separate transaction.
   forall a. STM a -> IO a
 atomically forall a b. (a -> b) -> a -> b
 $ do
-    ConnState
-st <- forall a. TVar a -> STM a
+    ConnState
+st <- forall a. TVar a -> STM a
 readTVar TVar ConnState
-_st
+_st
     forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
 when (ConnState
-st forall a. Eq a => a -> a -> Bool
+st forall a. Eq a => a -> a -> Bool
 /= ConnState
 Connected) forall a b. (a -> b) -> a -> b
 $ forall a. String -> a
@@ -2924,12 +2924,12 @@
 "disconnected waiting for response"
     MQTTClient -> (DispatchType, Word16) -> STM ()
 releasePktID MQTTClient
-c (DispatchType
-dt,Word16
-pid)
+c (DispatchType
+dt,Word16
+pid)
     forall a. TChan a -> STM a
 readTChan TChan MQTTPkt
-ch
+ch
 
 -- | Subscribe to a list of topic filters with their respective 'QoS'es.
 -- The accepted 'QoS'es are returned in the same order as requested.
@@ -2938,50 +2938,50 @@
 -> [(Filter, SubOptions)]
 -> [Property]
 -> IO ([Either SubErr QoS], [Property])
-subscribe MQTTClient
-c [(Filter, SubOptions)]
-ls [Property]
-props = do
+subscribe MQTTClient
+c [(Filter, SubOptions)]
+ls [Property]
+props = do
   MQTTClient -> IO ()
 runCallbackThread MQTTClient
-c
+c
   MQTTClient -> DispatchType -> (Word16 -> MQTTPkt) -> IO MQTTPkt
 sendAndWait MQTTClient
-c DispatchType
-DSubACK (\Word16
-pid -> SubscribeRequest -> MQTTPkt
+c DispatchType
+DSubACK (\Word16
+pid -> SubscribeRequest -> MQTTPkt
 SubscribePkt forall a b. (a -> b) -> a -> b
 $ Word16
 -> [(ByteString, SubOptions)] -> [Property] -> SubscribeRequest
 SubscribeRequest Word16
-pid [(ByteString, SubOptions)]
-ls' [Property]
-props) forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
+pid [(ByteString, SubOptions)]
+ls' [Property]
+props) forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
 >>= \case
     SubACKPkt (SubscribeResponse Word16
-_ [Either SubErr QoS]
-rs [Property]
-aprops) -> forall (f :: * -> *) a. Applicative f => a -> f a
+_ [Either SubErr QoS]
+rs [Property]
+aprops) -> forall (f :: * -> *) a. Applicative f => a -> f a
 pure ([Either SubErr QoS]
-rs, [Property]
-aprops)
-    MQTTPkt
-pkt                                       -> forall a. String -> a
+rs, [Property]
+aprops)
+    MQTTPkt
+pkt                                       -> forall a. String -> a
 mqttFail forall a b. (a -> b) -> a -> b
 $ String
 "unexpected response to subscribe: " forall a. Semigroup a => a -> a -> a
 <> forall a. Show a => a -> String
 show MQTTPkt
-pkt
+pkt
 
-  where ls' :: [(ByteString, SubOptions)]
-ls' = forall a b. (a -> b) -> [a] -> [b]
+  where ls' :: [(ByteString, SubOptions)]
+ls' = forall a b. (a -> b) -> [a] -> [b]
 map (forall (p :: * -> * -> *) a b c.
 Bifunctor p =>
 (a -> b) -> p a c -> p b c
 first Filter -> ByteString
 filterToBL) [(Filter, SubOptions)]
-ls
+ls
 
 -- | Unsubscribe from a list of topic filters.
 --
@@ -2993,30 +2993,30 @@
 unsubscribe :: MQTTClient -> [Filter] -> [Property] -> IO ([UnsubStatus], [Property])
 unsubscribe :: MQTTClient
 -> [Filter] -> [Property] -> IO ([UnsubStatus], [Property])
-unsubscribe MQTTClient
-c [Filter]
-ls [Property]
-props = do
+unsubscribe MQTTClient
+c [Filter]
+ls [Property]
+props = do
   (UnsubACKPkt (UnsubscribeResponse Word16
-_ [Property]
-rsn [UnsubStatus]
-rprop)) <- MQTTClient -> DispatchType -> (Word16 -> MQTTPkt) -> IO MQTTPkt
+_ [Property]
+rsn [UnsubStatus]
+rprop)) <- MQTTClient -> DispatchType -> (Word16 -> MQTTPkt) -> IO MQTTPkt
 sendAndWait MQTTClient
-c DispatchType
-DUnsubACK (\Word16
-pid -> UnsubscribeRequest -> MQTTPkt
+c DispatchType
+DUnsubACK (\Word16
+pid -> UnsubscribeRequest -> MQTTPkt
 UnsubscribePkt forall a b. (a -> b) -> a -> b
 $ Word16 -> [ByteString] -> [Property] -> UnsubscribeRequest
 UnsubscribeRequest Word16
-pid (forall a b. (a -> b) -> [a] -> [b]
+pid (forall a b. (a -> b) -> [a] -> [b]
 map Filter -> ByteString
 filterToBL [Filter]
-ls) [Property]
-props)
+ls) [Property]
+props)
   forall (f :: * -> *) a. Applicative f => a -> f a
 pure ([UnsubStatus]
-rprop, [Property]
-rsn)
+rprop, [Property]
+rsn)
 
 -- | Publish a message (QoS 0).
 publish :: MQTTClient
@@ -3025,19 +3025,19 @@
         -> Bool          -- ^ Retain flag
         -> IO ()
 publish :: MQTTClient -> Topic -> ByteString -> Bool -> IO ()
-publish MQTTClient
-c Topic
-t ByteString
-m Bool
-r = forall (f :: * -> *) a. Functor f => f a -> f ()
+publish MQTTClient
+c Topic
+t ByteString
+m Bool
+r = forall (f :: * -> *) a. Functor f => f a -> f ()
 void forall a b. (a -> b) -> a -> b
 $ MQTTClient
 -> Topic -> ByteString -> Bool -> QoS -> [Property] -> IO ()
 publishq MQTTClient
-c Topic
-t ByteString
-m Bool
-r QoS
+c Topic
+t ByteString
+m Bool
+r QoS
 QoS0 forall a. Monoid a => a
 mempty
 
@@ -3051,194 +3051,194 @@
          -> IO ()
 publishq :: MQTTClient
 -> Topic -> ByteString -> Bool -> QoS -> [Property] -> IO ()
-publishq MQTTClient
-c Topic
-t ByteString
-m Bool
-r QoS
-q [Property]
-props = do
-  (TChan MQTTPkt
-ch,Word16
-pid) <- forall a. STM a -> IO a
+publishq MQTTClient
+c Topic
+t ByteString
+m Bool
+r QoS
+q [Property]
+props = do
+  (TChan MQTTPkt
+ch,Word16
+pid) <- forall a. STM a -> IO a
 atomically forall a b. (a -> b) -> a -> b
 $ MQTTClient -> [DispatchType] -> STM (TChan MQTTPkt, Word16)
 reservePktID MQTTClient
-c [DispatchType]
-types
+c [DispatchType]
+types
   forall a b. IO a -> IO b -> IO a
 E.finally (TChan MQTTPkt -> Word16 -> IO ()
-publishAndWait TChan MQTTPkt
-ch Word16
-pid) (forall a. STM a -> IO a
+publishAndWait TChan MQTTPkt
+ch Word16
+pid) (forall a. STM a -> IO a
 atomically forall a b. (a -> b) -> a -> b
 $ MQTTClient -> [(DispatchType, Word16)] -> STM ()
 releasePktIDs MQTTClient
-c [(DispatchType
-t',Word16
-pid) | DispatchType
-t' <- [DispatchType]
-types])
+c [(DispatchType
+t',Word16
+pid) | DispatchType
+t' <- [DispatchType]
+types])
 
     where
-      types :: [DispatchType]
-types = [DispatchType
+      types :: [DispatchType]
+types = [DispatchType
 DPubACK, DispatchType
 DPubREC, DispatchType
 DPubCOMP]
-      publishAndWait :: TChan MQTTPkt -> Word16 -> IO ()
-publishAndWait TChan MQTTPkt
-ch Word16
-pid = do
+      publishAndWait :: TChan MQTTPkt -> Word16 -> IO ()
+publishAndWait TChan MQTTPkt
+ch Word16
+pid = do
         MQTTClient -> MQTTPkt -> IO ()
 sendPacketIO MQTTClient
-c (Word16 -> MQTTPkt
-pkt Word16
-pid)
+c (Word16 -> MQTTPkt
+pkt Word16
+pid)
         forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
 when (QoS
-q forall a. Ord a => a -> a -> Bool
+q forall a. Ord a => a -> a -> Bool
 > QoS
 QoS0) forall a b. (a -> b) -> a -> b
 $ TChan MQTTPkt -> Word16 -> IO ()
-satisfyQoS TChan MQTTPkt
-ch Word16
-pid
+satisfyQoS TChan MQTTPkt
+ch Word16
+pid
 
-      pkt :: Word16 -> MQTTPkt
-pkt Word16
-pid = PublishRequest -> MQTTPkt
+      pkt :: Word16 -> MQTTPkt
+pkt Word16
+pid = PublishRequest -> MQTTPkt
 PublishPkt forall a b. (a -> b) -> a -> b
 $ PublishRequest {_pubDup :: Bool
 _pubDup = Bool
 False,
                                              _pubQoS :: QoS
 _pubQoS = QoS
-q,
+q,
                                              _pubPktID :: Word16
 _pubPktID = Word16
-pid,
+pid,
                                              _pubRetain :: Bool
 _pubRetain = Bool
-r,
+r,
                                              _pubTopic :: ByteString
 _pubTopic = Topic -> ByteString
 topicToBL Topic
-t,
+t,
                                              _pubBody :: ByteString
 _pubBody = ByteString
-m,
+m,
                                              _pubProps :: [Property]
 _pubProps = [Property]
-props}
+props}
 
-      satisfyQoS :: TChan MQTTPkt -> Word16 -> IO ()
-satisfyQoS TChan MQTTPkt
-ch Word16
-pid
+      satisfyQoS :: TChan MQTTPkt -> Word16 -> IO ()
+satisfyQoS TChan MQTTPkt
+ch Word16
+pid
         | QoS
-q forall a. Eq a => a -> a -> Bool
+q forall a. Eq a => a -> a -> Bool
 == QoS
 QoS0 = forall (f :: * -> *) a. Applicative f => a -> f a
 pure ()
         | QoS
-q forall a. Eq a => a -> a -> Bool
+q forall a. Eq a => a -> a -> Bool
 == QoS
 QoS1 = forall (f :: * -> *) a. Functor f => f a -> f ()
 void forall a b. (a -> b) -> a -> b
 $ do
             (PubACKPkt (PubACK Word16
-_ Word8
-st [Property]
-pprops)) <- forall a. STM a -> IO a
+_ Word8
+st [Property]
+pprops)) <- forall a. STM a -> IO a
 atomically forall a b. (a -> b) -> a -> b
 $ MQTTClient -> STM ()
 checkConnected MQTTClient
-c forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
+c forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
 >> forall a. TChan a -> STM a
 readTChan TChan MQTTPkt
-ch
+ch
             forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
 unless (forall {a}. (Eq a, Num a) => a -> Bool
-isOK Word8
-st) forall a b. (a -> b) -> a -> b
+isOK Word8
+st) forall a b. (a -> b) -> a -> b
 $ forall a. String -> a
 mqttFail (String
 "qos 1 publish error: " forall a. Semigroup a => a -> a -> a
 <> forall a. Show a => a -> String
 show Word8
-st forall a. Semigroup a => a -> a -> a
+st forall a. Semigroup a => a -> a -> a
 <> String
 " " forall a. Semigroup a => a -> a -> a
 <> forall a. Show a => a -> String
 show [Property]
-pprops)
+pprops)
         | QoS
-q forall a. Eq a => a -> a -> Bool
+q forall a. Eq a => a -> a -> Bool
 == QoS
 QoS2 = IO ()
-waitRec
+waitRec
         | Bool
 otherwise = forall a. HasCallStack => String -> a
 error String
 "invalid QoS"
 
         where
-          isOK :: a -> Bool
-isOK a
+          isOK :: a -> Bool
+isOK a
 0  = Bool
 True -- success
-          isOK a
+          isOK a
 16 = Bool
 True -- It worked, but nobody cares (no matching subscribers)
-          isOK a
+          isOK a
 _  = Bool
 False
 
-          waitRec :: IO ()
-waitRec = forall a. STM a -> IO a
+          waitRec :: IO ()
+waitRec = forall a. STM a -> IO a
 atomically (MQTTClient -> STM ()
 checkConnected MQTTClient
-c forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
+c forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
 >> forall a. TChan a -> STM a
 readTChan TChan MQTTPkt
-ch) forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
+ch) forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
 >>= \case
               PubRECPkt (PubREC Word16
-_ Word8
-st [Property]
-recprops) -> do
+_ Word8
+st [Property]
+recprops) -> do
                 forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
 unless (forall {a}. (Eq a, Num a) => a -> Bool
-isOK Word8
-st) forall a b. (a -> b) -> a -> b
+isOK Word8
+st) forall a b. (a -> b) -> a -> b
 $ forall a. String -> a
 mqttFail (String
 "qos 2 REC publish error: " forall a. Semigroup a => a -> a -> a
 <> forall a. Show a => a -> String
 show Word8
-st forall a. Semigroup a => a -> a -> a
+st forall a. Semigroup a => a -> a -> a
 <> String
 " " forall a. Semigroup a => a -> a -> a
 <> forall a. Show a => a -> String
 show [Property]
-recprops)
+recprops)
                 MQTTClient -> MQTTPkt -> IO ()
 sendPacketIO MQTTClient
-c (PubREL -> MQTTPkt
+c (PubREL -> MQTTPkt
 PubRELPkt forall a b. (a -> b) -> a -> b
 $ Word16 -> Word8 -> [Property] -> PubREL
 PubREL Word16
-pid Word8
+pid Word8
 0 forall a. Monoid a => a
 mempty)
               PubCOMPPkt (PubCOMP Word16
-_ Word8
-st' [Property]
-compprops) ->
+_ Word8
+st' [Property]
+compprops) ->
                 forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
 when (Word8
-st' forall a. Eq a => a -> a -> Bool
+st' forall a. Eq a => a -> a -> Bool
 /= Word8
 0) forall a b. (a -> b) -> a -> b
 $ forall a. String -> a
@@ -3246,25 +3246,25 @@
 "qos 2 COMP publish error: " forall a. Semigroup a => a -> a -> a
 <> forall a. Show a => a -> String
 show Word8
-st' forall a. Semigroup a => a -> a -> a
+st' forall a. Semigroup a => a -> a -> a
 <> String
 " " forall a. Semigroup a => a -> a -> a
 <> forall a. Show a => a -> String
 show [Property]
-compprops)
-              MQTTPkt
-wtf -> forall a. String -> a
+compprops)
+              MQTTPkt
+wtf -> forall a. String -> a
 mqttFail (String
 "unexpected packet received in QoS2 publish: " forall a. Semigroup a => a -> a -> a
 <> forall a. Show a => a -> String
 show MQTTPkt
-wtf)
+wtf)
 
 -- | Disconnect from the MQTT server.
 disconnect :: MQTTClient -> DiscoReason -> [Property] -> IO ()
 disconnect :: MQTTClient -> DiscoReason -> [Property] -> IO ()
-disconnect c :: MQTTClient
-c@MQTTClient{TVar (Maybe (Async ()))
+disconnect c :: MQTTClient
+c@MQTTClient{TVar (Maybe (Async ()))
 TVar Word16
 TVar (Map Word16 Topic)
 TVar (Map (DispatchType, Word16) (TChan MQTTPkt))
@@ -3302,23 +3302,23 @@
 _cb :: MQTTClient -> MessageCallback
 _pktID :: MQTTClient -> TVar Word16
 _ch :: MQTTClient -> TChan MQTTPkt
-..} DiscoReason
-reason [Property]
-props = forall a b. IO a -> IO b -> IO ()
+..} DiscoReason
+reason [Property]
+props = forall a b. IO a -> IO b -> IO ()
 race_ IO ()
-getDisconnected IO ()
-orDieTrying
+getDisconnected IO ()
+orDieTrying
   where
-    getDisconnected :: IO ()
-getDisconnected = do
+    getDisconnected :: IO ()
+getDisconnected = do
       MQTTClient -> MQTTPkt -> IO ()
 sendPacketIO MQTTClient
-c (DisconnectRequest -> MQTTPkt
+c (DisconnectRequest -> MQTTPkt
 DisconnectPkt forall a b. (a -> b) -> a -> b
 $ DiscoReason -> [Property] -> DisconnectRequest
 DisconnectRequest DiscoReason
-reason [Property]
-props)
+reason [Property]
+props)
       forall (f :: * -> *) a. Functor f => f a -> f ()
 void forall b c a. (b -> c) -> (a -> b) -> a -> c
 . forall (t :: * -> *) (f :: * -> *) a b.
@@ -3328,52 +3328,52 @@
 wait forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
 =<< forall a. TVar a -> IO a
 readTVarIO TVar (Maybe (Async ()))
-_ct
+_ct
       forall a. STM a -> IO a
 atomically forall a b. (a -> b) -> a -> b
 $ forall a. TVar a -> a -> STM ()
 writeTVar TVar ConnState
-_st ConnState
+_st ConnState
 Stopped
-    orDieTrying :: IO ()
-orDieTrying = Int -> IO ()
+    orDieTrying :: IO ()
+orDieTrying = Int -> IO ()
 threadDelay Int
 10000000 forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
 >> forall e. Exception e => MQTTClient -> e -> IO ()
 killConn MQTTClient
-c MQTTException
+c MQTTException
 Timeout
 
 -- | Disconnect with 'DiscoNormalDisconnection' and no properties.
 normalDisconnect :: MQTTClient -> IO ()
 normalDisconnect :: MQTTClient -> IO ()
-normalDisconnect MQTTClient
-c = MQTTClient -> DiscoReason -> [Property] -> IO ()
+normalDisconnect MQTTClient
+c = MQTTClient -> DiscoReason -> [Property] -> IO ()
 disconnect MQTTClient
-c DiscoReason
+c DiscoReason
 DiscoNormalDisconnection forall a. Monoid a => a
 mempty
 
 -- | A convenience method for creating a 'LastWill'.
 mkLWT :: Topic -> BL.ByteString -> Bool -> T.LastWill
 mkLWT :: Topic -> ByteString -> Bool -> LastWill
-mkLWT Topic
-t ByteString
-m Bool
-r = T.LastWill{
+mkLWT Topic
+t ByteString
+m Bool
+r = T.LastWill{
   _willRetain :: Bool
 T._willRetain=Bool
-r,
+r,
   _willQoS :: QoS
 T._willQoS=QoS
 QoS0,
   _willTopic :: ByteString
 T._willTopic = Topic -> ByteString
 topicToBL Topic
-t,
+t,
   _willMsg :: ByteString
 T._willMsg=ByteString
-m,
+m,
   _willProps :: [Property]
 T._willProps=forall a. Monoid a => a
 mempty
@@ -3384,27 +3384,27 @@
 svrProps :: MQTTClient -> IO [Property]
 svrProps = forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
 fmap ConnACKFlags -> [Property]
-p forall b c a. (b -> c) -> (a -> b) -> a -> c
+p forall b c a. (b -> c) -> (a -> b) -> a -> c
 . forall a. STM a -> IO a
 atomically forall b c a. (b -> c) -> (a -> b) -> a -> c
 . MQTTClient -> STM ConnACKFlags
 connACKSTM
-  where p :: ConnACKFlags -> [Property]
-p (ConnACKFlags SessionReuse
+  where p :: ConnACKFlags -> [Property]
+p (ConnACKFlags SessionReuse
 _ ConnACKRC
-_ [Property]
-props) = [Property]
-props
+_ [Property]
+props) = [Property]
+props
 
 -- | Get the complete connection ACK packet from the beginning of this session.
 connACKSTM :: MQTTClient -> STM ConnACKFlags
 connACKSTM :: MQTTClient -> STM ConnACKFlags
-connACKSTM MQTTClient{TVar ConnACKFlags
+connACKSTM MQTTClient{TVar ConnACKFlags
 _connACKFlags :: TVar ConnACKFlags
 _connACKFlags :: MQTTClient -> TVar ConnACKFlags
-_connACKFlags} = forall a. TVar a -> STM a
+_connACKFlags} = forall a. TVar a -> STM a
 readTVar TVar ConnACKFlags
-_connACKFlags
+_connACKFlags
 
 -- | Get the complete connection aCK packet from the beginning of this session.
 connACK :: MQTTClient -> IO ConnACKFlags
@@ -3421,20 +3421,20 @@
 Foldable t =>
 (a -> b -> b) -> b -> t a -> b
 foldr Property -> Word16 -> Word16
-f Word16
+f Word16
 0) forall b c a. (b -> c) -> (a -> b) -> a -> c
 . MQTTClient -> IO [Property]
 svrProps
   where
-    f :: Property -> Word16 -> Word16
-f (PropTopicAliasMaximum Word16
-n) Word16
+    f :: Property -> Word16 -> Word16
+f (PropTopicAliasMaximum Word16
+n) Word16
 _ = Word16
-n
-    f Property
-_ Word16
-o                         = Word16
-o
+n
+    f Property
+_ Word16
+o                         = Word16
+o
 
 -- | Publish a message with the specified 'QoS' and 'Property' list.  If
 -- possible, use an alias to shorten the message length.  The alias
@@ -3455,8 +3455,8 @@
          -> IO ()
 pubAliased :: MQTTClient
 -> Topic -> ByteString -> Bool -> QoS -> [Property] -> IO ()
-pubAliased c :: MQTTClient
-c@MQTTClient{TVar (Maybe (Async ()))
+pubAliased c :: MQTTClient
+c@MQTTClient{TVar (Maybe (Async ()))
 TVar Word16
 TVar (Map Word16 Topic)
 TVar (Map (DispatchType, Word16) (TChan MQTTPkt))
@@ -3494,120 +3494,120 @@
 _cb :: MQTTClient -> MessageCallback
 _pktID :: MQTTClient -> TVar Word16
 _ch :: MQTTClient -> TChan MQTTPkt
-..} Topic
-t ByteString
-m Bool
-r QoS
-q [Property]
-props = do
-  Word16
-x <- MQTTClient -> IO Word16
+..} Topic
+t ByteString
+m Bool
+r QoS
+q [Property]
+props = do
+  Word16
+x <- MQTTClient -> IO Word16
 maxAliases MQTTClient
-c
-  (Topic
-t', Word16
-n) <- Word16 -> IO (Topic, Word16)
-alias Word16
-x
-  let np :: [Property]
-np = [Property]
-props forall a. Semigroup a => a -> a -> a
+c
+  (Topic
+t', Word16
+n) <- Word16 -> IO (Topic, Word16)
+alias Word16
+x
+  let np :: [Property]
+np = [Property]
+props forall a. Semigroup a => a -> a -> a
 <> case Word16
-n of
+n of
                       Word16
 0 -> forall a. Monoid a => a
 mempty
                       Word16
 _ -> [Word16 -> Property
 PropTopicAlias Word16
-n]
+n]
   MQTTClient
 -> Topic -> ByteString -> Bool -> QoS -> [Property] -> IO ()
 publishq MQTTClient
-c Topic
-t' ByteString
-m Bool
-r QoS
-q [Property]
-np
+c Topic
+t' ByteString
+m Bool
+r QoS
+q [Property]
+np
 
   where
-    alias :: Word16 -> IO (Topic, Word16)
-alias Word16
-mv = forall a. STM a -> IO a
+    alias :: Word16 -> IO (Topic, Word16)
+alias Word16
+mv = forall a. STM a -> IO a
 atomically forall a b. (a -> b) -> a -> b
 $ do
-      Map Topic Word16
-as <- forall a. TVar a -> STM a
+      Map Topic Word16
+as <- forall a. TVar a -> STM a
 readTVar TVar (Map Topic Word16)
-_outA
-      let n :: Word16
-n = forall a. Enum a => Int -> a
+_outA
+      let n :: Word16
+n = forall a. Enum a => Int -> a
 toEnum (forall (t :: * -> *) a. Foldable t => t a -> Int
 length Map Topic Word16
-as forall a. Num a => a -> a -> a
+as forall a. Num a => a -> a -> a
 + Int
 1)
-          cur :: Maybe Word16
-cur = forall k a. Ord k => k -> Map k a -> Maybe a
+          cur :: Maybe Word16
+cur = forall k a. Ord k => k -> Map k a -> Maybe a
 Map.lookup Topic
-t Map Topic Word16
-as
-          v :: Word16
-v = forall a. a -> Maybe a -> a
+t Map Topic Word16
+as
+          v :: Word16
+v = forall a. a -> Maybe a -> a
 fromMaybe (if Word16
-n forall a. Ord a => a -> a -> Bool
+n forall a. Ord a => a -> a -> Bool
 > Word16
-mv then Word16
+mv then Word16
 0 else Word16
-n) Maybe Word16
-cur
+n) Maybe Word16
+cur
       forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
 when (Word16
-v forall a. Ord a => a -> a -> Bool
+v forall a. Ord a => a -> a -> Bool
 > Word16
 0) forall a b. (a -> b) -> a -> b
 $ forall a. TVar a -> a -> STM ()
 writeTVar TVar (Map Topic Word16)
-_outA (forall k a. Ord k => k -> a -> Map k a -> Map k a
+_outA (forall k a. Ord k => k -> a -> Map k a -> Map k a
 Map.insert Topic
-t Word16
-v Map Topic Word16
-as)
+t Word16
+v Map Topic Word16
+as)
       forall (f :: * -> *) a. Applicative f => a -> f a
 pure (forall b a. b -> (a -> b) -> Maybe a -> b
 maybe Topic
-t (forall a b. a -> b -> a
+t (forall a b. a -> b -> a
 const Topic
 "") Maybe Word16
-cur, Word16
-v)
+cur, Word16
+v)
 
 -- | Register a callback handler for a message with the given correlated data identifier.
 --
 -- This registration will remain in place until unregisterCorrelated is called to remove it.
 registerCorrelated :: MQTTClient -> BL.ByteString -> MessageCallback -> STM ()
 registerCorrelated :: MQTTClient -> ByteString -> MessageCallback -> STM ()
-registerCorrelated MQTTClient{Map ByteString MessageCallback
+registerCorrelated MQTTClient{Map ByteString MessageCallback
 _corr :: Map ByteString MessageCallback
 _corr :: MQTTClient -> Map ByteString MessageCallback
-_corr} ByteString
-bs MessageCallback
-cb = forall k v. Ord k => k -> v -> Map k v -> STM ()
+_corr} ByteString
+bs MessageCallback
+cb = forall k v. Ord k => k -> v -> Map k v -> STM ()
 Decaying.insert ByteString
-bs MessageCallback
-cb Map ByteString MessageCallback
-_corr
+bs MessageCallback
+cb Map ByteString MessageCallback
+_corr
 
 -- | Unregister a callback handler for the given correlated data identifier.
 unregisterCorrelated :: MQTTClient -> BL.ByteString -> STM ()
 unregisterCorrelated :: MQTTClient -> ByteString -> STM ()
-unregisterCorrelated MQTTClient{Map ByteString MessageCallback
+unregisterCorrelated MQTTClient{Map ByteString MessageCallback
 _corr :: Map ByteString MessageCallback
 _corr :: MQTTClient -> Map ByteString MessageCallback
-_corr} ByteString
-bs = forall k v. Ord k => k -> Map k v -> STM ()
+_corr} ByteString
+bs = forall k v. Ord k => k -> Map k v -> STM ()
 Decaying.delete ByteString
-bs Map ByteString MessageCallback
-_corr
+bs Map ByteString MessageCallback
+_corr
 
\ No newline at end of file diff --git a/src/Network.MQTT.Topic.html b/src/Network.MQTT.Topic.html index ecfab17..12101da 100644 --- a/src/Network.MQTT.Topic.html +++ b/src/Network.MQTT.Topic.html @@ -20,13 +20,13 @@
import Data.String (IsString (..)) import Data.Text (Text, isPrefixOf, splitOn) -class Splittable a where +class Splittable a where -- | split separates a `Filter` or `Topic` into its `/`-separated components. - split :: a -> [a] + split :: a -> [a] -- | An MQTT topic. newtype Topic = Topic { Topic -> Text -unTopic :: Text } deriving (Int -> Topic -> ShowS +unTopic :: Text } deriving (Int -> Topic -> ShowS [Topic] -> ShowS Topic -> String forall a. @@ -37,7 +37,7 @@ $cshow :: Topic -> String showsPrec :: Int -> Topic -> ShowS $cshowsPrec :: Int -> Topic -> ShowS -Show, Eq Topic +Show, Eq Topic Topic -> Topic -> Bool Topic -> Topic -> Ordering Topic -> Topic -> Topic @@ -65,39 +65,39 @@ $c< :: Topic -> Topic -> Bool compare :: Topic -> Topic -> Ordering $ccompare :: Topic -> Topic -> Ordering -Ord, Topic -> Topic -> Bool +Ord, Topic -> Topic -> Bool forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a /= :: Topic -> Topic -> Bool $c/= :: Topic -> Topic -> Bool == :: Topic -> Topic -> Bool $c== :: Topic -> Topic -> Bool -Eq, String -> Topic +Eq, String -> Topic forall a. (String -> a) -> IsString a fromString :: String -> Topic $cfromString :: String -> Topic IsString) instance Splittable Topic where - split :: Topic -> [Topic] -split (Topic Text -t) = Text -> Topic + split :: Topic -> [Topic] +split (Topic Text +t) = Text -> Topic Topic forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> Text -> Text -> [Text] splitOn Text "/" Text -t +t -instance Semigroup Topic where - (Topic Text -a) <> :: Topic -> Topic -> Topic -<> (Topic Text -b) = Text -> Topic +instance Semigroup Topic where + (Topic Text +a) <> :: Topic -> Topic -> Topic +<> (Topic Text +b) = Text -> Topic Topic (Text -a forall a. Semigroup a => a -> a -> a +a forall a. Semigroup a => a -> a -> a <> Text "/" forall a. Semigroup a => a -> a -> a <> Text -b) +b) -- | mkTopic creates a topic from a text representation of a valid filter. mkTopic :: Text -> Maybe Topic @@ -105,36 +105,36 @@ mkTopic Text "" = forall a. Maybe a Nothing -mkTopic Text -t = Text -> Topic +mkTopic Text +t = Text -> Topic Topic forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> forall {a}. (Eq a, IsString a) => [a] -> Maybe Text -validate (Text -> Text -> [Text] +validate (Text -> Text -> [Text] splitOn Text "/" Text -t) +t) where - validate :: [a] -> Maybe Text -validate (a + validate :: [a] -> Maybe Text +validate (a "#":[a] _) = forall a. Maybe a Nothing - validate (a + validate (a "+":[a] _) = forall a. Maybe a Nothing - validate [] = forall a. a -> Maybe a + validate [] = forall a. a -> Maybe a Just Text -t - validate (a -_:[a] -xs) = [a] -> Maybe Text -validate [a] -xs +t + validate (a +_:[a] +xs) = [a] -> Maybe Text +validate [a] +xs -- | An MQTT topic filter. newtype Filter = Filter { Filter -> Text -unFilter :: Text } deriving (Int -> Filter -> ShowS +unFilter :: Text } deriving (Int -> Filter -> ShowS [Filter] -> ShowS Filter -> String forall a. @@ -145,7 +145,7 @@ $cshow :: Filter -> String showsPrec :: Int -> Filter -> ShowS $cshowsPrec :: Int -> Filter -> ShowS -Show, Eq Filter +Show, Eq Filter Filter -> Filter -> Bool Filter -> Filter -> Ordering Filter -> Filter -> Filter @@ -173,39 +173,39 @@ $c< :: Filter -> Filter -> Bool compare :: Filter -> Filter -> Ordering $ccompare :: Filter -> Filter -> Ordering -Ord, Filter -> Filter -> Bool +Ord, Filter -> Filter -> Bool forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a /= :: Filter -> Filter -> Bool $c/= :: Filter -> Filter -> Bool == :: Filter -> Filter -> Bool $c== :: Filter -> Filter -> Bool -Eq, String -> Filter +Eq, String -> Filter forall a. (String -> a) -> IsString a fromString :: String -> Filter $cfromString :: String -> Filter IsString) instance Splittable Filter where - split :: Filter -> [Filter] -split (Filter Text -f) = Text -> Filter + split :: Filter -> [Filter] +split (Filter Text +f) = Text -> Filter Filter forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> Text -> Text -> [Text] splitOn Text "/" Text -f +f -instance Semigroup Filter where - (Filter Text -a) <> :: Filter -> Filter -> Filter -<> (Filter Text -b) = Text -> Filter +instance Semigroup Filter where + (Filter Text +a) <> :: Filter -> Filter -> Filter +<> (Filter Text +b) = Text -> Filter Filter (Text -a forall a. Semigroup a => a -> a -> a +a forall a. Semigroup a => a -> a -> a <> Text "/" forall a. Semigroup a => a -> a -> a <> Text -b) +b) -- | mkFilter creates a filter from a text representation of a valid filter. mkFilter :: Text -> Maybe Filter @@ -213,95 +213,95 @@ mkFilter Text "" = forall a. Maybe a Nothing -mkFilter Text -t = Text -> Filter +mkFilter Text +t = Text -> Filter Filter forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> forall {a}. (Eq a, IsString a) => [a] -> Maybe Text -validate (Text -> Text -> [Text] +validate (Text -> Text -> [Text] splitOn Text "/" Text -t) +t) where - validate :: [a] -> Maybe Text -validate [a + validate :: [a] -> Maybe Text +validate [a "#"] = forall a. a -> Maybe a Just Text -t - validate (a +t + validate (a "#":[a] _) = forall a. Maybe a Nothing - validate [] = forall a. a -> Maybe a + validate [] = forall a. a -> Maybe a Just Text -t - validate (a -_:[a] -xs) = [a] -> Maybe Text -validate [a] -xs +t + validate (a +_:[a] +xs) = [a] -> Maybe Text +validate [a] +xs -- | match returns true iff the given pattern can be matched by the -- specified Topic as defined in the -- <http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718107 MQTT 3.1.1 specification>. match :: Filter -> Topic -> Bool match :: Filter -> Topic -> Bool -match (Filter Text -pat) (Topic Text -top) = [Text] -> [Text] -> Bool -cmp (Text -> Text -> [Text] +match (Filter Text +pat) (Topic Text +top) = [Text] -> [Text] -> Bool +cmp (Text -> Text -> [Text] splitOn Text "/" Text -pat) (Text -> Text -> [Text] +pat) (Text -> Text -> [Text] splitOn Text "/" Text -top) +top) where - cmp :: [Text] -> [Text] -> Bool -cmp [] [] = Bool + cmp :: [Text] -> [Text] -> Bool +cmp [] [] = Bool True - cmp [] [Text] + cmp [] [Text] _ = Bool False - cmp [Text + cmp [Text "#"] [] = Bool True - cmp [Text] + cmp [Text] _ [] = Bool False - cmp [Text -"#"] (Text -t:[Text] + cmp [Text +"#"] (Text +t:[Text] _) = Bool -> Bool not forall a b. (a -> b) -> a -> b $ Text "$" Text -> Text -> Bool `isPrefixOf` Text -t - cmp (Text -p:[Text] -ps) (Text -t:[Text] -ts) +t + cmp (Text +p:[Text] +ps) (Text +t:[Text] +ts) | Text -p forall a. Eq a => a -> a -> Bool +p forall a. Eq a => a -> a -> Bool == Text -t = [Text] -> [Text] -> Bool -cmp [Text] -ps [Text] -ts +t = [Text] -> [Text] -> Bool +cmp [Text] +ps [Text] +ts | Text -p forall a. Eq a => a -> a -> Bool +p forall a. Eq a => a -> a -> Bool == Text "+" Bool -> Bool -> Bool && Bool -> Bool not (Text "$" Text -> Text -> Bool `isPrefixOf` Text -t) = [Text] -> [Text] -> Bool -cmp [Text] -ps [Text] -ts +t) = [Text] -> [Text] -> Bool +cmp [Text] +ps [Text] +ts | Bool otherwise = Bool False diff --git a/src/Network.MQTT.Types.html b/src/Network.MQTT.Types.html index 07c442a..bc274da 100644 --- a/src/Network.MQTT.Types.html +++ b/src/Network.MQTT.Types.html @@ -1,4 +1,4 @@ -
{-|
+
{-|
 Module      : Network.MQTT.Types
 Description : Parsers and serializers for MQTT.
 Copyright   : (c) Dustin Sallings, 2019
@@ -41,13 +41,13 @@
 import           Data.Word                       (Word16, Word32, Word8)
 
 -- | QoS values for publishing and subscribing.
-data QoS = QoS0 | QoS1 | QoS2 deriving (QoS
+data QoS = QoS0 | QoS1 | QoS2 deriving (QoS
 forall a. a -> a -> Bounded a
 maxBound :: QoS
 $cmaxBound :: QoS
 minBound :: QoS
 $cminBound :: QoS
-Bounded, Int -> QoS
+Bounded, Int -> QoS
 QoS -> Int
 QoS -> [QoS]
 QoS -> QoS
@@ -79,13 +79,13 @@
 $cpred :: QoS -> QoS
 succ :: QoS -> QoS
 $csucc :: QoS -> QoS
-Enum, QoS -> QoS -> Bool
+Enum, QoS -> QoS -> Bool
 forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
 /= :: QoS -> QoS -> Bool
 $c/= :: QoS -> QoS -> Bool
 == :: QoS -> QoS -> Bool
 $c== :: QoS -> QoS -> Bool
-Eq, Int -> QoS -> ShowS
+Eq, Int -> QoS -> ShowS
 [QoS] -> ShowS
 QoS -> [Char]
 forall a.
@@ -96,7 +96,7 @@
 $cshow :: QoS -> [Char]
 showsPrec :: Int -> QoS -> ShowS
 $cshowsPrec :: Int -> QoS -> ShowS
-Show, Eq QoS
+Show, Eq QoS
 QoS -> QoS -> Bool
 QoS -> QoS -> Ordering
 QoS -> QoS -> QoS
@@ -159,36 +159,36 @@
 _ = forall a. Maybe a
 Nothing
 
-(≫) :: Bits a => a -> Int -> a
+(≫) :: Bits a => a -> Int -> a
 ≫ :: forall a. Bits a => a -> Int -> a
 (≫) = forall a. Bits a => a -> Int -> a
 shiftR
 
-(≪) :: Bits a => a -> Int -> a
+(≪) :: Bits a => a -> Int -> a
 ≪ :: forall a. Bits a => a -> Int -> a
 (≪) = forall a. Bits a => a -> Int -> a
 shiftL
 
-class ByteMe a where
-  toBytes :: ProtocolLevel -> a -> [Word8]
-  toBytes ProtocolLevel
-p = ByteString -> [Word8]
+class ByteMe a where
+  toBytes :: ProtocolLevel -> a -> [Word8]
+  toBytes ProtocolLevel
+p = ByteString -> [Word8]
 BL.unpack forall b c a. (b -> c) -> (a -> b) -> a -> c
 . forall a. ByteMe a => ProtocolLevel -> a -> ByteString
 toByteString ProtocolLevel
-p
+p
 
-  toByteString :: ProtocolLevel -> a -> BL.ByteString
-  toByteString ProtocolLevel
-p = [Word8] -> ByteString
+  toByteString :: ProtocolLevel -> a -> BL.ByteString
+  toByteString ProtocolLevel
+p = [Word8] -> ByteString
 BL.pack forall b c a. (b -> c) -> (a -> b) -> a -> c
 . forall a. ByteMe a => ProtocolLevel -> a -> [Word8]
 toBytes ProtocolLevel
-p
+p
 
-class ByteSize a where
-  toByte :: a -> Word8
-  fromByte :: Word8 -> a
+class ByteSize a where
+  toByte :: a -> Word8
+  fromByte :: Word8 -> a
 
 boolBit :: Bool -> Word8
 boolBit :: Bool -> Word8
@@ -207,43 +207,43 @@
 decodeVarInt :: A.Parser Int
 decodeVarInt :: Parser Int
 decodeVarInt = Int -> Int -> Parser Int
-go Int
+go Int
 0 Int
 1
   where
-    go :: Int -> Int -> A.Parser Int
-    go :: Int -> Int -> Parser Int
-go Int
-v Int
-m = do
-      Word8
-x <- Parser Word8
+    go :: Int -> Int -> A.Parser Int
+    go :: Int -> Int -> Parser Int
+go Int
+v Int
+m = do
+      Word8
+x <- Parser Word8
 A.anyWord8
-      let a :: Int
-a = forall a b. (Integral a, Num b) => a -> b
+      let a :: Int
+a = forall a b. (Integral a, Num b) => a -> b
 fromIntegral (Word8
-x forall a. Bits a => a -> a -> a
+x forall a. Bits a => a -> a -> a
 .&. Word8
 127) forall a. Num a => a -> a -> a
 * Int
-m forall a. Num a => a -> a -> a
+m forall a. Num a => a -> a -> a
 + Int
-v
+v
       if Word8
-x forall a. Bits a => a -> a -> a
+x forall a. Bits a => a -> a -> a
 .&. Word8
 128 forall a. Eq a => a -> a -> Bool
 /= Word8
 0
         then Int -> Int -> Parser Int
-go Int
-a (Int
-mforall a. Num a => a -> a -> a
+go Int
+a (Int
+mforall a. Num a => a -> a -> a
 *Int
 128)
         else forall (f :: * -> *) a. Applicative f => a -> f a
 pure Int
-a
+a
 
 encodeLength :: Int -> [Word8]
 encodeLength :: Int -> [Word8]
@@ -252,38 +252,38 @@
 
 encodeVarInt :: Int -> [Word8]
 encodeVarInt :: Int -> [Word8]
-encodeVarInt Int
-n = (Int, Int) -> [Word8]
-go (Int
-n forall a. Integral a => a -> a -> (a, a)
+encodeVarInt Int
+n = (Int, Int) -> [Word8]
+go (Int
+n forall a. Integral a => a -> a -> (a, a)
 `quotRem` Int
 128)
   where
-    go :: (Int, Int) -> [Word8]
-go (Int
-x,Int
-e)
+    go :: (Int, Int) -> [Word8]
+go (Int
+x,Int
+e)
       | Int
-x forall a. Ord a => a -> a -> Bool
+x forall a. Ord a => a -> a -> Bool
 > Int
 0 = Int -> Word8
-en (Int
-e forall a. Bits a => a -> a -> a
+en (Int
+e forall a. Bits a => a -> a -> a
 .|. Int
 128) forall a. a -> [a] -> [a]
 : (Int, Int) -> [Word8]
-go (Int
-x forall a. Integral a => a -> a -> (a, a)
+go (Int
+x forall a. Integral a => a -> a -> (a, a)
 `quotRem` Int
 128)
       | Bool
 otherwise = [Int -> Word8
-en Int
-e]
+en Int
+e]
 
-    en :: Int -> Word8
-    en :: Int -> Word8
-en = forall a. Enum a => Int -> a
+    en :: Int -> Word8
+    en :: Int -> Word8
+en = forall a. Enum a => Int -> a
 toEnum
 
 encodeWord8 :: Word8 -> BL.ByteString
@@ -293,20 +293,20 @@
 
 encodeWord16 :: Word16 -> BL.ByteString
 encodeWord16 :: Word16 -> ByteString
-encodeWord16 Word16
-a = let (Word16
-h,Word16
-l) = Word16
-a forall a. Integral a => a -> a -> (a, a)
+encodeWord16 Word16
+a = let (Word16
+h,Word16
+l) = Word16
+a forall a. Integral a => a -> a -> (a, a)
 `quotRem` Word16
 256 in [Word8] -> ByteString
 BL.pack [Word16 -> Word8
-w Word16
-h, Word16 -> Word8
-w Word16
-l]
-    where w :: Word16 -> Word8
-w = forall a. Enum a => Int -> a
+w Word16
+h, Word16 -> Word8
+w Word16
+l]
+    where w :: Word16 -> Word8
+w = forall a. Enum a => Int -> a
 toEnum forall b c a. (b -> c) -> (a -> b) -> a -> c
 . forall a b. (Integral a, Num b) => a -> b
 fromIntegral
@@ -320,12 +320,12 @@
 
 encodeBytes :: BL.ByteString -> BL.ByteString
 encodeBytes :: ByteString -> ByteString
-encodeBytes ByteString
-x = ByteString -> ByteString
+encodeBytes ByteString
+x = ByteString -> ByteString
 twoByteLen ByteString
-x forall a. Semigroup a => a -> a -> a
+x forall a. Semigroup a => a -> a -> a
 <> ByteString
-x
+x
 
 encodeUTF8 :: BL.ByteString -> BL.ByteString
 encodeUTF8 :: ByteString -> ByteString
@@ -334,14 +334,14 @@
 
 encodeUTF8Pair :: BL.ByteString -> BL.ByteString -> BL.ByteString
 encodeUTF8Pair :: ByteString -> ByteString -> ByteString
-encodeUTF8Pair ByteString
-x ByteString
-y = ByteString -> ByteString
+encodeUTF8Pair ByteString
+x ByteString
+y = ByteString -> ByteString
 encodeUTF8 ByteString
-x forall a. Semigroup a => a -> a -> a
+x forall a. Semigroup a => a -> a -> a
 <> ByteString -> ByteString
 encodeUTF8 ByteString
-y
+y
 
 twoByteLen :: BL.ByteString -> BL.ByteString
 twoByteLen :: ByteString -> ByteString
@@ -365,26 +365,26 @@
 
 withLength :: BL.ByteString -> BL.ByteString
 withLength :: ByteString -> ByteString
-withLength ByteString
-a = ByteString -> ByteString
+withLength ByteString
+a = ByteString -> ByteString
 blLength ByteString
-a forall a. Semigroup a => a -> a -> a
+a forall a. Semigroup a => a -> a -> a
 <> ByteString
-a
+a
 
-instance ByteMe BL.ByteString where
-  toByteString :: ProtocolLevel -> ByteString -> ByteString
-toByteString ProtocolLevel
-_ ByteString
-a = (Word16 -> ByteString
+instance ByteMe BL.ByteString where
+  toByteString :: ProtocolLevel -> ByteString -> ByteString
+toByteString ProtocolLevel
+_ ByteString
+a = (Word16 -> ByteString
 encodeWord16 forall b c a. (b -> c) -> (a -> b) -> a -> c
 . forall a b. (Integral a, Num b) => a -> b
 fromIntegral forall b c a. (b -> c) -> (a -> b) -> a -> c
 . ByteString -> Int64
 BL.length) ByteString
-a forall a. Semigroup a => a -> a -> a
+a forall a. Semigroup a => a -> a -> a
 <> ByteString
-a
+a
 
 -- | Property represents the various MQTT Properties that may sent or
 -- received along with packets in MQTT 5.  For detailed use on when
@@ -416,7 +416,7 @@
               | PropWildcardSubscriptionAvailable Word8
               | PropSubscriptionIdentifierAvailable Word8
               | PropSharedSubscriptionAvailable Word8
-              deriving (Int -> Property -> ShowS
+              deriving (Int -> Property -> ShowS
 [Property] -> ShowS
 Property -> [Char]
 forall a.
@@ -427,7 +427,7 @@
 $cshow :: Property -> [Char]
 showsPrec :: Int -> Property -> ShowS
 $cshowsPrec :: Int -> Property -> ShowS
-Show, Property -> Property -> Bool
+Show, Property -> Property -> Bool
 forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
 /= :: Property -> Property -> Bool
 $c/= :: Property -> Property -> Bool
@@ -437,296 +437,296 @@
 
 peW8 :: Word8 -> Word8 -> BL.ByteString
 peW8 :: Word8 -> Word8 -> ByteString
-peW8 Word8
-i Word8
-x = Word8 -> ByteString
+peW8 Word8
+i Word8
+x = Word8 -> ByteString
 BL.singleton Word8
-i forall a. Semigroup a => a -> a -> a
+i forall a. Semigroup a => a -> a -> a
 <> Word8 -> ByteString
 encodeWord8 Word8
-x
+x
 
 peW16 :: Word8 -> Word16 -> BL.ByteString
 peW16 :: Word8 -> Word16 -> ByteString
-peW16 Word8
-i Word16
-x = Word8 -> ByteString
+peW16 Word8
+i Word16
+x = Word8 -> ByteString
 BL.singleton Word8
-i forall a. Semigroup a => a -> a -> a
+i forall a. Semigroup a => a -> a -> a
 <> Word16 -> ByteString
 encodeWord16 Word16
-x
+x
 
 peW32 :: Word8 -> Word32 -> BL.ByteString
 peW32 :: Word8 -> Word32 -> ByteString
-peW32 Word8
-i Word32
-x = Word8 -> ByteString
+peW32 Word8
+i Word32
+x = Word8 -> ByteString
 BL.singleton Word8
-i forall a. Semigroup a => a -> a -> a
+i forall a. Semigroup a => a -> a -> a
 <> Word32 -> ByteString
 encodeWord32 Word32
-x
+x
 
 peUTF8 :: Word8 -> BL.ByteString -> BL.ByteString
 peUTF8 :: Word8 -> ByteString -> ByteString
-peUTF8 Word8
-i ByteString
-x = Word8 -> ByteString
+peUTF8 Word8
+i ByteString
+x = Word8 -> ByteString
 BL.singleton Word8
-i forall a. Semigroup a => a -> a -> a
+i forall a. Semigroup a => a -> a -> a
 <> ByteString -> ByteString
 encodeUTF8 ByteString
-x
+x
 
 peBin :: Word8 -> BL.ByteString -> BL.ByteString
 peBin :: Word8 -> ByteString -> ByteString
-peBin Word8
-i ByteString
-x = Word8 -> ByteString
+peBin Word8
+i ByteString
+x = Word8 -> ByteString
 BL.singleton Word8
-i forall a. Semigroup a => a -> a -> a
+i forall a. Semigroup a => a -> a -> a
 <> ByteString -> ByteString
 encodeBytes ByteString
-x
+x
 
 peVarInt :: Word8 -> Int -> BL.ByteString
 peVarInt :: Word8 -> Int -> ByteString
-peVarInt Word8
-i Int
-x = Word8 -> ByteString
+peVarInt Word8
+i Int
+x = Word8 -> ByteString
 BL.singleton Word8
-i forall a. Semigroup a => a -> a -> a
+i forall a. Semigroup a => a -> a -> a
 <> ([Word8] -> ByteString
 BL.pack forall b c a. (b -> c) -> (a -> b) -> a -> c
 . Int -> [Word8]
 encodeVarInt) Int
-x
+x
 
-instance ByteMe Property where
-  toByteString :: ProtocolLevel -> Property -> ByteString
-toByteString ProtocolLevel
-_ (PropPayloadFormatIndicator Word8
-x)          = Word8 -> Word8 -> ByteString
+instance ByteMe Property where
+  toByteString :: ProtocolLevel -> Property -> ByteString
+toByteString ProtocolLevel
+_ (PropPayloadFormatIndicator Word8
+x)          = Word8 -> Word8 -> ByteString
 peW8 Word8
 0x01 Word8
-x
+x
 
   toByteString ProtocolLevel
-_ (PropMessageExpiryInterval Word32
-x)           = Word8 -> Word32 -> ByteString
+_ (PropMessageExpiryInterval Word32
+x)           = Word8 -> Word32 -> ByteString
 peW32 Word8
 0x02 Word32
-x
+x
 
   toByteString ProtocolLevel
-_ (PropContentType ByteString
-x)                     = Word8 -> ByteString -> ByteString
+_ (PropContentType ByteString
+x)                     = Word8 -> ByteString -> ByteString
 peUTF8 Word8
 0x03 ByteString
-x
+x
 
   toByteString ProtocolLevel
-_ (PropResponseTopic ByteString
-x)                   = Word8 -> ByteString -> ByteString
+_ (PropResponseTopic ByteString
+x)                   = Word8 -> ByteString -> ByteString
 peUTF8 Word8
 0x08 ByteString
-x
+x
 
   toByteString ProtocolLevel
-_ (PropCorrelationData ByteString
-x)                 = Word8 -> ByteString -> ByteString
+_ (PropCorrelationData ByteString
+x)                 = Word8 -> ByteString -> ByteString
 peBin Word8
 0x09 ByteString
-x
+x
 
   toByteString ProtocolLevel
-_ (PropSubscriptionIdentifier Int
-x)          = Word8 -> Int -> ByteString
+_ (PropSubscriptionIdentifier Int
+x)          = Word8 -> Int -> ByteString
 peVarInt Word8
 0x0b Int
-x
+x
 
   toByteString ProtocolLevel
-_ (PropSessionExpiryInterval Word32
-x)           = Word8 -> Word32 -> ByteString
+_ (PropSessionExpiryInterval Word32
+x)           = Word8 -> Word32 -> ByteString
 peW32 Word8
 0x11 Word32
-x
+x
 
   toByteString ProtocolLevel
-_ (PropAssignedClientIdentifier ByteString
-x)        = Word8 -> ByteString -> ByteString
+_ (PropAssignedClientIdentifier ByteString
+x)        = Word8 -> ByteString -> ByteString
 peUTF8 Word8
 0x12 ByteString
-x
+x
 
   toByteString ProtocolLevel
-_ (PropServerKeepAlive Word16
-x)                 = Word8 -> Word16 -> ByteString
+_ (PropServerKeepAlive Word16
+x)                 = Word8 -> Word16 -> ByteString
 peW16 Word8
 0x13 Word16
-x
+x
 
   toByteString ProtocolLevel
-_ (PropAuthenticationMethod ByteString
-x)            = Word8 -> ByteString -> ByteString
+_ (PropAuthenticationMethod ByteString
+x)            = Word8 -> ByteString -> ByteString
 peUTF8 Word8
 0x15 ByteString
-x
+x
 
   toByteString ProtocolLevel
-_ (PropAuthenticationData ByteString
-x)              = Word8 -> ByteString -> ByteString
+_ (PropAuthenticationData ByteString
+x)              = Word8 -> ByteString -> ByteString
 peBin Word8
 0x16 ByteString
-x
+x
 
   toByteString ProtocolLevel
-_ (PropRequestProblemInformation Word8
-x)       = Word8 -> Word8 -> ByteString
+_ (PropRequestProblemInformation Word8
+x)       = Word8 -> Word8 -> ByteString
 peW8 Word8
 0x17 Word8
-x
+x
 
   toByteString ProtocolLevel
-_ (PropWillDelayInterval Word32
-x)               = Word8 -> Word32 -> ByteString
+_ (PropWillDelayInterval Word32
+x)               = Word8 -> Word32 -> ByteString
 peW32 Word8
 0x18 Word32
-x
+x
 
   toByteString ProtocolLevel
-_ (PropRequestResponseInformation Word8
-x)      = Word8 -> Word8 -> ByteString
+_ (PropRequestResponseInformation Word8
+x)      = Word8 -> Word8 -> ByteString
 peW8 Word8
 0x19 Word8
-x
+x
 
   toByteString ProtocolLevel
-_ (PropResponseInformation ByteString
-x)             = Word8 -> ByteString -> ByteString
+_ (PropResponseInformation ByteString
+x)             = Word8 -> ByteString -> ByteString
 peUTF8 Word8
 0x1a ByteString
-x
+x
 
   toByteString ProtocolLevel
-_ (PropServerReference ByteString
-x)                 = Word8 -> ByteString -> ByteString
+_ (PropServerReference ByteString
+x)                 = Word8 -> ByteString -> ByteString
 peUTF8 Word8
 0x1c ByteString
-x
+x
 
   toByteString ProtocolLevel
-_ (PropReasonString ByteString
-x)                    = Word8 -> ByteString -> ByteString
+_ (PropReasonString ByteString
+x)                    = Word8 -> ByteString -> ByteString
 peUTF8 Word8
 0x1f ByteString
-x
+x
 
   toByteString ProtocolLevel
-_ (PropReceiveMaximum Word16
-x)                  = Word8 -> Word16 -> ByteString
+_ (PropReceiveMaximum Word16
+x)                  = Word8 -> Word16 -> ByteString
 peW16 Word8
 0x21 Word16
-x
+x
 
   toByteString ProtocolLevel
-_ (PropTopicAliasMaximum Word16
-x)               = Word8 -> Word16 -> ByteString
+_ (PropTopicAliasMaximum Word16
+x)               = Word8 -> Word16 -> ByteString
 peW16 Word8
 0x22 Word16
-x
+x
 
   toByteString ProtocolLevel
-_ (PropTopicAlias Word16
-x)                      = Word8 -> Word16 -> ByteString
+_ (PropTopicAlias Word16
+x)                      = Word8 -> Word16 -> ByteString
 peW16 Word8
 0x23 Word16
-x
+x
 
   toByteString ProtocolLevel
-_ (PropMaximumQoS Word8
-x)                      = Word8 -> Word8 -> ByteString
+_ (PropMaximumQoS Word8
+x)                      = Word8 -> Word8 -> ByteString
 peW8 Word8
 0x24 Word8
-x
+x
 
   toByteString ProtocolLevel
-_ (PropRetainAvailable Word8
-x)                 = Word8 -> Word8 -> ByteString
+_ (PropRetainAvailable Word8
+x)                 = Word8 -> Word8 -> ByteString
 peW8 Word8
 0x25 Word8
-x
+x
 
   toByteString ProtocolLevel
-_ (PropUserProperty ByteString
-k ByteString
-v)                  = Word8 -> ByteString
+_ (PropUserProperty ByteString
+k ByteString
+v)                  = Word8 -> ByteString
 BL.singleton Word8
 0x26 forall a. Semigroup a => a -> a -> a
 <> ByteString -> ByteString -> ByteString
 encodeUTF8Pair ByteString
-k ByteString
-v
+k ByteString
+v
 
   toByteString ProtocolLevel
-_ (PropMaximumPacketSize Word32
-x)               = Word8 -> Word32 -> ByteString
+_ (PropMaximumPacketSize Word32
+x)               = Word8 -> Word32 -> ByteString
 peW32 Word8
 0x27 Word32
-x
+x
 
   toByteString ProtocolLevel
-_ (PropWildcardSubscriptionAvailable Word8
-x)   = Word8 -> Word8 -> ByteString
+_ (PropWildcardSubscriptionAvailable Word8
+x)   = Word8 -> Word8 -> ByteString
 peW8 Word8
 0x28 Word8
-x
+x
 
   toByteString ProtocolLevel
-_ (PropSubscriptionIdentifierAvailable Word8
-x) = Word8 -> Word8 -> ByteString
+_ (PropSubscriptionIdentifierAvailable Word8
+x) = Word8 -> Word8 -> ByteString
 peW8 Word8
 0x29 Word8
-x
+x
 
   toByteString ProtocolLevel
-_ (PropSharedSubscriptionAvailable Word8
-x)     = Word8 -> Word8 -> ByteString
+_ (PropSharedSubscriptionAvailable Word8
+x)     = Word8 -> Word8 -> ByteString
 peW8 Word8
 0x2a Word8
-x
+x
 
-oneOf :: [(Word8, p)] -> A.Parser p
+oneOf :: [(Word8, p)] -> A.Parser p
 oneOf :: forall p. [(Word8, p)] -> Parser p
 oneOf = forall (t :: * -> *) (f :: * -> *) a.
 (Foldable t, Alternative f) =>
 t (f a) -> f a
 asum forall b c a. (b -> c) -> (a -> b) -> a -> c
 . forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-fmap (\(Word8
-w, p
-p) -> Word8 -> Parser Word8
+fmap (\(Word8
+w, p
+p) -> Word8 -> Parser Word8
 A.word8 Word8
-w forall (f :: * -> *) a b. Functor f => f a -> b -> f b
+w forall (f :: * -> *) a b. Functor f => f a -> b -> f b
 $> p
-p)
+p)
 
-oneOfp :: [(Word8, A.Parser p)] -> A.Parser p
+oneOfp :: [(Word8, A.Parser p)] -> A.Parser p
 oneOfp :: forall p. [(Word8, Parser p)] -> Parser p
 oneOfp = forall (t :: * -> *) (f :: * -> *) a.
 (Foldable t, Alternative f) =>
 t (f a) -> f a
 asum forall b c a. (b -> c) -> (a -> b) -> a -> c
 . forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-fmap (\(Word8
-b,Parser p
-p) -> Word8 -> Parser Word8
+fmap (\(Word8
+b,Parser p
+p) -> Word8 -> Parser Word8
 A.word8 Word8
-b forall (f :: * -> *) a b. Applicative f => f a -> f b -> f b
+b forall (f :: * -> *) a b. Applicative f => f a -> f b -> f b
 *> Parser p
-p)
+p)
 
 parseProperty :: A.Parser Property
 parseProperty :: Parser Property
@@ -876,15 +876,15 @@
 Protocol311 = forall a b. a -> b -> a
 const forall a. Monoid a => a
 mempty
-bsProps ProtocolLevel
-p = ByteString -> ByteString
+bsProps ProtocolLevel
+p = ByteString -> ByteString
 withLength forall b c a. (b -> c) -> (a -> b) -> a -> c
 . forall (t :: * -> *) m a.
 (Foldable t, Monoid m) =>
 (a -> m) -> t a -> m
 foldMap (forall a. ByteMe a => ProtocolLevel -> a -> ByteString
 toByteString ProtocolLevel
-p)
+p)
 
 
 parseProperties :: ProtocolLevel -> A.Parser [Property]
@@ -910,13 +910,13 @@
 -- | MQTT Protocol Levels
 data ProtocolLevel = Protocol311 -- ^ MQTT 3.1.1
                    | Protocol50  -- ^ MQTT 5.0
-                   deriving(ProtocolLevel
+                   deriving(ProtocolLevel
 forall a. a -> a -> Bounded a
 maxBound :: ProtocolLevel
 $cmaxBound :: ProtocolLevel
 minBound :: ProtocolLevel
 $cminBound :: ProtocolLevel
-Bounded, Int -> ProtocolLevel
+Bounded, Int -> ProtocolLevel
 ProtocolLevel -> Int
 ProtocolLevel -> [ProtocolLevel]
 ProtocolLevel -> ProtocolLevel
@@ -948,13 +948,13 @@
 $cpred :: ProtocolLevel -> ProtocolLevel
 succ :: ProtocolLevel -> ProtocolLevel
 $csucc :: ProtocolLevel -> ProtocolLevel
-Enum, ProtocolLevel -> ProtocolLevel -> Bool
+Enum, ProtocolLevel -> ProtocolLevel -> Bool
 forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
 /= :: ProtocolLevel -> ProtocolLevel -> Bool
 $c/= :: ProtocolLevel -> ProtocolLevel -> Bool
 == :: ProtocolLevel -> ProtocolLevel -> Bool
 $c== :: ProtocolLevel -> ProtocolLevel -> Bool
-Eq, Int -> ProtocolLevel -> ShowS
+Eq, Int -> ProtocolLevel -> ShowS
 [ProtocolLevel] -> ShowS
 ProtocolLevel -> [Char]
 forall a.
@@ -967,9 +967,9 @@
 $cshowsPrec :: Int -> ProtocolLevel -> ShowS
 Show)
 
-instance ByteMe ProtocolLevel where
-  toByteString :: ProtocolLevel -> ProtocolLevel -> ByteString
-toByteString ProtocolLevel
+instance ByteMe ProtocolLevel where
+  toByteString :: ProtocolLevel -> ProtocolLevel -> ByteString
+toByteString ProtocolLevel
 _ ProtocolLevel
 Protocol311 = Word8 -> ByteString
 BL.singleton Word8
@@ -992,13 +992,13 @@
 _willMsg   :: BL.ByteString
   , LastWill -> [Property]
 _willProps :: [Property]
-  } deriving(LastWill -> LastWill -> Bool
+  } deriving(LastWill -> LastWill -> Bool
 forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
 /= :: LastWill -> LastWill -> Bool
 $c/= :: LastWill -> LastWill -> Bool
 == :: LastWill -> LastWill -> Bool
 $c== :: LastWill -> LastWill -> Bool
-Eq, Int -> LastWill -> ShowS
+Eq, Int -> LastWill -> ShowS
 [LastWill] -> ShowS
 LastWill -> [Char]
 forall a.
@@ -1026,13 +1026,13 @@
 _connID         :: BL.ByteString
   , ConnectRequest -> [Property]
 _connProperties :: [Property]
-  } deriving (ConnectRequest -> ConnectRequest -> Bool
+  } deriving (ConnectRequest -> ConnectRequest -> Bool
 forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
 /= :: ConnectRequest -> ConnectRequest -> Bool
 $c/= :: ConnectRequest -> ConnectRequest -> Bool
 == :: ConnectRequest -> ConnectRequest -> Bool
 $c== :: ConnectRequest -> ConnectRequest -> Bool
-Eq, Int -> ConnectRequest -> ShowS
+Eq, Int -> ConnectRequest -> ShowS
 [ConnectRequest] -> ShowS
 ConnectRequest -> [Char]
 forall a.
@@ -1065,10 +1065,10 @@
 _connProperties=forall a. Monoid a => a
 mempty}
 
-instance ByteMe ConnectRequest where
-  toByteString :: ProtocolLevel -> ConnectRequest -> ByteString
-toByteString ProtocolLevel
-prot ConnectRequest{Bool
+instance ByteMe ConnectRequest where
+  toByteString :: ProtocolLevel -> ConnectRequest -> ByteString
+toByteString ProtocolLevel
+prot ConnectRequest{Bool
 [Property]
 Maybe ByteString
 Maybe LastWill
@@ -1088,126 +1088,126 @@
 _lastWill :: ConnectRequest -> Maybe LastWill
 _password :: ConnectRequest -> Maybe ByteString
 _username :: ConnectRequest -> Maybe ByteString
-..} = Word8 -> ByteString
+..} = Word8 -> ByteString
 BL.singleton Word8
 0x10 forall a. Semigroup a => a -> a -> a
 <> ByteString -> ByteString
 withLength (ProtocolLevel -> ByteString
-val ProtocolLevel
-prot)
+val ProtocolLevel
+prot)
     where
-      val :: ProtocolLevel -> BL.ByteString
-      val :: ProtocolLevel -> ByteString
-val ProtocolLevel
+      val :: ProtocolLevel -> BL.ByteString
+      val :: ProtocolLevel -> ByteString
+val ProtocolLevel
 Protocol311 = ByteString
 "\NUL\EOTMQTT\EOT" -- MQTT + Protocol311
                         forall a. Semigroup a => a -> a -> a
 <> Word8 -> ByteString
 BL.singleton Word8
-connBits
+connBits
                         forall a. Semigroup a => a -> a -> a
 <> Word16 -> ByteString
 encodeWord16 Word16
-_keepAlive
+_keepAlive
                         forall a. Semigroup a => a -> a -> a
 <> forall a. ByteMe a => ProtocolLevel -> a -> ByteString
 toByteString ProtocolLevel
-prot ByteString
-_connID
+prot ByteString
+_connID
                         forall a. Semigroup a => a -> a -> a
 <> Maybe LastWill -> ByteString
-lwt Maybe LastWill
-_lastWill
+lwt Maybe LastWill
+_lastWill
                         forall a. Semigroup a => a -> a -> a
 <> Maybe ByteString -> ByteString
-perhaps Maybe ByteString
-_username
+perhaps Maybe ByteString
+_username
                         forall a. Semigroup a => a -> a -> a
 <> if forall a. Maybe a -> Bool
 isJust Maybe ByteString
-_username then Maybe ByteString -> ByteString
-perhaps Maybe ByteString
-_password else ByteString
+_username then Maybe ByteString -> ByteString
+perhaps Maybe ByteString
+_password else ByteString
 ""
 
-      val ProtocolLevel
+      val ProtocolLevel
 Protocol50 = ByteString
 "\NUL\EOTMQTT\ENQ" -- MQTT + Protocol50
                        forall a. Semigroup a => a -> a -> a
 <> Word8 -> ByteString
 BL.singleton Word8
-connBits
+connBits
                        forall a. Semigroup a => a -> a -> a
 <> Word16 -> ByteString
 encodeWord16 Word16
-_keepAlive
+_keepAlive
                        forall a. Semigroup a => a -> a -> a
 <> ProtocolLevel -> [Property] -> ByteString
 bsProps ProtocolLevel
-prot [Property]
-_connProperties
+prot [Property]
+_connProperties
                        forall a. Semigroup a => a -> a -> a
 <> forall a. ByteMe a => ProtocolLevel -> a -> ByteString
 toByteString ProtocolLevel
-prot ByteString
-_connID
+prot ByteString
+_connID
                        forall a. Semigroup a => a -> a -> a
 <> Maybe LastWill -> ByteString
-lwt Maybe LastWill
-_lastWill
+lwt Maybe LastWill
+_lastWill
                        forall a. Semigroup a => a -> a -> a
 <> Maybe ByteString -> ByteString
-perhaps Maybe ByteString
-_username
+perhaps Maybe ByteString
+_username
                        forall a. Semigroup a => a -> a -> a
 <> Maybe ByteString -> ByteString
-perhaps Maybe ByteString
-_password
+perhaps Maybe ByteString
+_password
 
-      connBits :: Word8
-connBits = Word8
-hasu forall a. Bits a => a -> a -> a
+      connBits :: Word8
+connBits = Word8
+hasu forall a. Bits a => a -> a -> a
 .|. Word8
-hasp forall a. Bits a => a -> a -> a
+hasp forall a. Bits a => a -> a -> a
 .|. Word8
-willBits forall a. Bits a => a -> a -> a
+willBits forall a. Bits a => a -> a -> a
 .|. Word8
-clean
+clean
         where
-          hasu :: Word8
-hasu = Bool -> Word8
+          hasu :: Word8
+hasu = Bool -> Word8
 boolBit (forall a. Maybe a -> Bool
 isJust Maybe ByteString
-_username) forall a. Bits a => a -> Int -> a
+_username) forall a. Bits a => a -> Int -> a
  Int
 7
-          hasp :: Word8
-hasp = Bool -> Word8
+          hasp :: Word8
+hasp = Bool -> Word8
 boolBit ((ProtocolLevel
-prot forall a. Eq a => a -> a -> Bool
+prot forall a. Eq a => a -> a -> Bool
 == ProtocolLevel
 Protocol50 Bool -> Bool -> Bool
 || forall a. Maybe a -> Bool
 isJust Maybe ByteString
-_username) Bool -> Bool -> Bool
+_username) Bool -> Bool -> Bool
 && forall a. Maybe a -> Bool
 isJust Maybe ByteString
-_password) forall a. Bits a => a -> Int -> a
+_password) forall a. Bits a => a -> Int -> a
  Int
 6
-          clean :: Word8
-clean = Bool -> Word8
+          clean :: Word8
+clean = Bool -> Word8
 boolBit Bool
-_cleanSession forall a. Bits a => a -> Int -> a
+_cleanSession forall a. Bits a => a -> Int -> a
  Int
 1
-          willBits :: Word8
-willBits = case Maybe LastWill
-_lastWill of
+          willBits :: Word8
+willBits = case Maybe LastWill
+_lastWill of
                        Maybe LastWill
 Nothing           -> Word8
 0
-                       Just LastWill{Bool
+                       Just LastWill{Bool
 [Property]
 ByteString
 QoS
@@ -1221,27 +1221,27 @@
 _willTopic :: LastWill -> ByteString
 _willQoS :: LastWill -> QoS
 _willRetain :: LastWill -> Bool
-..} -> Word8
+..} -> Word8
 4 forall a. Bits a => a -> a -> a
 .|. ((QoS -> Word8
 qosW QoS
-_willQoS forall a. Bits a => a -> a -> a
+_willQoS forall a. Bits a => a -> a -> a
 .&. Word8
 0x3) forall a. Bits a => a -> Int -> a
  Int
 3) forall a. Bits a => a -> a -> a
 .|. (Bool -> Word8
 boolBit Bool
-_willRetain forall a. Bits a => a -> Int -> a
+_willRetain forall a. Bits a => a -> Int -> a
  Int
 5)
 
-      lwt :: Maybe LastWill -> BL.ByteString
-      lwt :: Maybe LastWill -> ByteString
-lwt Maybe LastWill
+      lwt :: Maybe LastWill -> BL.ByteString
+      lwt :: Maybe LastWill -> ByteString
+lwt Maybe LastWill
 Nothing = forall a. Monoid a => a
 mempty
-      lwt (Just LastWill{Bool
+      lwt (Just LastWill{Bool
 [Property]
 ByteString
 QoS
@@ -1255,28 +1255,28 @@
 _willTopic :: LastWill -> ByteString
 _willQoS :: LastWill -> QoS
 _willRetain :: LastWill -> Bool
-..}) = ProtocolLevel -> [Property] -> ByteString
+..}) = ProtocolLevel -> [Property] -> ByteString
 bsProps ProtocolLevel
-prot [Property]
-_willProps
+prot [Property]
+_willProps
                                 forall a. Semigroup a => a -> a -> a
 <> forall a. ByteMe a => ProtocolLevel -> a -> ByteString
 toByteString ProtocolLevel
-prot ByteString
-_willTopic
+prot ByteString
+_willTopic
                                 forall a. Semigroup a => a -> a -> a
 <> forall a. ByteMe a => ProtocolLevel -> a -> ByteString
 toByteString ProtocolLevel
-prot ByteString
-_willMsg
+prot ByteString
+_willMsg
 
-      perhaps :: Maybe BL.ByteString -> BL.ByteString
-      perhaps :: Maybe ByteString -> ByteString
-perhaps = forall b a. b -> (a -> b) -> Maybe a -> b
+      perhaps :: Maybe BL.ByteString -> BL.ByteString
+      perhaps :: Maybe ByteString -> ByteString
+perhaps = forall b a. b -> (a -> b) -> Maybe a -> b
 maybe ByteString
 "" (forall a. ByteMe a => ProtocolLevel -> a -> ByteString
 toByteString ProtocolLevel
-prot)
+prot)
 
 data MQTTPkt = ConnPkt ConnectRequest ProtocolLevel
              | ConnACKPkt ConnACKFlags
@@ -1293,13 +1293,13 @@
              | PongPkt
              | DisconnectPkt DisconnectRequest
              | AuthPkt AuthRequest
-  deriving (MQTTPkt -> MQTTPkt -> Bool
+  deriving (MQTTPkt -> MQTTPkt -> Bool
 forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
 /= :: MQTTPkt -> MQTTPkt -> Bool
 $c/= :: MQTTPkt -> MQTTPkt -> Bool
 == :: MQTTPkt -> MQTTPkt -> Bool
 $c== :: MQTTPkt -> MQTTPkt -> Bool
-Eq, Int -> MQTTPkt -> ShowS
+Eq, Int -> MQTTPkt -> ShowS
 [MQTTPkt] -> ShowS
 MQTTPkt -> [Char]
 forall a.
@@ -1312,75 +1312,75 @@
 $cshowsPrec :: Int -> MQTTPkt -> ShowS
 Show)
 
-instance ByteMe MQTTPkt where
-  toByteString :: ProtocolLevel -> MQTTPkt -> ByteString
-toByteString ProtocolLevel
-p (ConnPkt ConnectRequest
-x ProtocolLevel
+instance ByteMe MQTTPkt where
+  toByteString :: ProtocolLevel -> MQTTPkt -> ByteString
+toByteString ProtocolLevel
+p (ConnPkt ConnectRequest
+x ProtocolLevel
 _)      = forall a. ByteMe a => ProtocolLevel -> a -> ByteString
 toByteString ProtocolLevel
-p ConnectRequest
-x
-  toByteString ProtocolLevel
-p (ConnACKPkt ConnACKFlags
-x)     = forall a. ByteMe a => ProtocolLevel -> a -> ByteString
+p ConnectRequest
+x
+  toByteString ProtocolLevel
+p (ConnACKPkt ConnACKFlags
+x)     = forall a. ByteMe a => ProtocolLevel -> a -> ByteString
 toByteString ProtocolLevel
-p ConnACKFlags
-x
-  toByteString ProtocolLevel
-p (PublishPkt PublishRequest
-x)     = forall a. ByteMe a => ProtocolLevel -> a -> ByteString
+p ConnACKFlags
+x
+  toByteString ProtocolLevel
+p (PublishPkt PublishRequest
+x)     = forall a. ByteMe a => ProtocolLevel -> a -> ByteString
 toByteString ProtocolLevel
-p PublishRequest
-x
-  toByteString ProtocolLevel
-p (PubACKPkt PubACK
-x)      = forall a. ByteMe a => ProtocolLevel -> a -> ByteString
+p PublishRequest
+x
+  toByteString ProtocolLevel
+p (PubACKPkt PubACK
+x)      = forall a. ByteMe a => ProtocolLevel -> a -> ByteString
 toByteString ProtocolLevel
-p PubACK
-x
-  toByteString ProtocolLevel
-p (PubRELPkt PubREL
-x)      = forall a. ByteMe a => ProtocolLevel -> a -> ByteString
+p PubACK
+x
+  toByteString ProtocolLevel
+p (PubRELPkt PubREL
+x)      = forall a. ByteMe a => ProtocolLevel -> a -> ByteString
 toByteString ProtocolLevel
-p PubREL
-x
-  toByteString ProtocolLevel
-p (PubRECPkt PubREC
-x)      = forall a. ByteMe a => ProtocolLevel -> a -> ByteString
+p PubREL
+x
+  toByteString ProtocolLevel
+p (PubRECPkt PubREC
+x)      = forall a. ByteMe a => ProtocolLevel -> a -> ByteString
 toByteString ProtocolLevel
-p PubREC
-x
-  toByteString ProtocolLevel
-p (PubCOMPPkt PubCOMP
-x)     = forall a. ByteMe a => ProtocolLevel -> a -> ByteString
+p PubREC
+x
+  toByteString ProtocolLevel
+p (PubCOMPPkt PubCOMP
+x)     = forall a. ByteMe a => ProtocolLevel -> a -> ByteString
 toByteString ProtocolLevel
-p PubCOMP
-x
-  toByteString ProtocolLevel
-p (SubscribePkt SubscribeRequest
-x)   = forall a. ByteMe a => ProtocolLevel -> a -> ByteString
+p PubCOMP
+x
+  toByteString ProtocolLevel
+p (SubscribePkt SubscribeRequest
+x)   = forall a. ByteMe a => ProtocolLevel -> a -> ByteString
 toByteString ProtocolLevel
-p SubscribeRequest
-x
-  toByteString ProtocolLevel
-p (SubACKPkt SubscribeResponse
-x)      = forall a. ByteMe a => ProtocolLevel -> a -> ByteString
+p SubscribeRequest
+x
+  toByteString ProtocolLevel
+p (SubACKPkt SubscribeResponse
+x)      = forall a. ByteMe a => ProtocolLevel -> a -> ByteString
 toByteString ProtocolLevel
-p SubscribeResponse
-x
-  toByteString ProtocolLevel
-p (UnsubscribePkt UnsubscribeRequest
-x) = forall a. ByteMe a => ProtocolLevel -> a -> ByteString
+p SubscribeResponse
+x
+  toByteString ProtocolLevel
+p (UnsubscribePkt UnsubscribeRequest
+x) = forall a. ByteMe a => ProtocolLevel -> a -> ByteString
 toByteString ProtocolLevel
-p UnsubscribeRequest
-x
-  toByteString ProtocolLevel
-p (UnsubACKPkt UnsubscribeResponse
-x)    = forall a. ByteMe a => ProtocolLevel -> a -> ByteString
+p UnsubscribeRequest
+x
+  toByteString ProtocolLevel
+p (UnsubACKPkt UnsubscribeResponse
+x)    = forall a. ByteMe a => ProtocolLevel -> a -> ByteString
 toByteString ProtocolLevel
-p UnsubscribeResponse
-x
+p UnsubscribeResponse
+x
   toByteString ProtocolLevel
 _ MQTTPkt
 PingPkt            = ByteString
@@ -1389,23 +1389,23 @@
 _ MQTTPkt
 PongPkt            = ByteString
 "\208\NUL"
-  toByteString ProtocolLevel
-p (DisconnectPkt DisconnectRequest
-x)  = forall a. ByteMe a => ProtocolLevel -> a -> ByteString
+  toByteString ProtocolLevel
+p (DisconnectPkt DisconnectRequest
+x)  = forall a. ByteMe a => ProtocolLevel -> a -> ByteString
 toByteString ProtocolLevel
-p DisconnectRequest
-x
-  toByteString ProtocolLevel
-p (AuthPkt AuthRequest
-x)        = forall a. ByteMe a => ProtocolLevel -> a -> ByteString
+p DisconnectRequest
+x
+  toByteString ProtocolLevel
+p (AuthPkt AuthRequest
+x)        = forall a. ByteMe a => ProtocolLevel -> a -> ByteString
 toByteString ProtocolLevel
-p AuthRequest
-x
+p AuthRequest
+x
 
 parsePacket :: ProtocolLevel -> A.Parser MQTTPkt
 parsePacket :: ProtocolLevel -> Parser MQTTPkt
-parsePacket ProtocolLevel
-p = forall (t :: * -> *) (f :: * -> *) a.
+parsePacket ProtocolLevel
+p = forall (t :: * -> *) (f :: * -> *) a.
 (Foldable t, Alternative f) =>
 t (f a) -> f a
 asum [Parser MQTTPkt
@@ -1413,7 +1413,7 @@
 parseConnectACK,
                       ProtocolLevel -> Parser MQTTPkt
 parsePublish ProtocolLevel
-p, Parser MQTTPkt
+p, Parser MQTTPkt
 parsePubACK,
                       Parser MQTTPkt
 parsePubREC, Parser MQTTPkt
@@ -1421,14 +1421,14 @@
 parsePubCOMP,
                       ProtocolLevel -> Parser MQTTPkt
 parseSubscribe ProtocolLevel
-p, ProtocolLevel -> Parser MQTTPkt
+p, ProtocolLevel -> Parser MQTTPkt
 parseSubACK ProtocolLevel
-p,
+p,
                       ProtocolLevel -> Parser MQTTPkt
 parseUnsubscribe ProtocolLevel
-p, ProtocolLevel -> Parser MQTTPkt
+p, ProtocolLevel -> Parser MQTTPkt
 parseUnsubACK ProtocolLevel
-p,
+p,
                       MQTTPkt
 PingPkt forall (f :: * -> *) a b. Functor f => a -> f b -> f a
 <$ ByteString -> Parser ByteString ByteString
@@ -1440,7 +1440,7 @@
 "\208\NUL",
                       ProtocolLevel -> Parser MQTTPkt
 parseDisconnect ProtocolLevel
-p,
+p,
                       Parser MQTTPkt
 parseAuth]
 
@@ -1483,39 +1483,39 @@
 _ <- ByteString -> Parser ByteString ByteString
 A.string ByteString
 "\NUL\EOTMQTT" -- "MQTT"
-  ProtocolLevel
-pl <- Parser ByteString ProtocolLevel
-parseLevel
+  ProtocolLevel
+pl <- Parser ByteString ProtocolLevel
+parseLevel
 
-  Word8
-connFlagBits <- Parser Word8
+  Word8
+connFlagBits <- Parser Word8
 A.anyWord8
-  Word16
-keepAlive <- Parser Word16
+  Word16
+keepAlive <- Parser Word16
 aWord16
-  [Property]
-props <- ProtocolLevel -> Parser [Property]
+  [Property]
+props <- ProtocolLevel -> Parser [Property]
 parseProperties ProtocolLevel
-pl
-  ByteString
-cid <- Parser ByteString
+pl
+  ByteString
+cid <- Parser ByteString
 aString
-  Maybe LastWill
-lwt <- ProtocolLevel -> Word8 -> Parser ByteString (Maybe LastWill)
-parseLwt ProtocolLevel
-pl Word8
-connFlagBits
-  Maybe ByteString
-u <- Bool -> Parser (Maybe ByteString)
-mstr (forall a. Bits a => a -> Int -> Bool
+  Maybe LastWill
+lwt <- ProtocolLevel -> Word8 -> Parser ByteString (Maybe LastWill)
+parseLwt ProtocolLevel
+pl Word8
+connFlagBits
+  Maybe ByteString
+u <- Bool -> Parser (Maybe ByteString)
+mstr (forall a. Bits a => a -> Int -> Bool
 testBit Word8
-connFlagBits Int
+connFlagBits Int
 7)
-  Maybe ByteString
-p <- Bool -> Parser (Maybe ByteString)
-mstr (forall a. Bits a => a -> Int -> Bool
+  Maybe ByteString
+p <- Bool -> Parser (Maybe ByteString)
+mstr (forall a. Bits a => a -> Int -> Bool
 testBit Word8
-connFlagBits Int
+connFlagBits Int
 6)
 
   forall (f :: * -> *) a. Applicative f => a -> f a
@@ -1523,41 +1523,41 @@
 $ ConnectRequest -> ProtocolLevel -> MQTTPkt
 ConnPkt ConnectRequest{_connID :: ByteString
 _connID=ByteString
-cid, _username :: Maybe ByteString
+cid, _username :: Maybe ByteString
 _username=Maybe ByteString
-u, _password :: Maybe ByteString
+u, _password :: Maybe ByteString
 _password=Maybe ByteString
-p,
+p,
                                 _lastWill :: Maybe LastWill
 _lastWill=Maybe LastWill
-lwt, _keepAlive :: Word16
+lwt, _keepAlive :: Word16
 _keepAlive=Word16
-keepAlive,
+keepAlive,
                                 _cleanSession :: Bool
 _cleanSession=forall a. Bits a => a -> Int -> Bool
 testBit Word8
-connFlagBits Int
+connFlagBits Int
 1,
                                 _connProperties :: [Property]
 _connProperties=[Property]
-props} ProtocolLevel
-pl
+props} ProtocolLevel
+pl
 
   where
-    mstr :: Bool -> A.Parser (Maybe BL.ByteString)
-    mstr :: Bool -> Parser (Maybe ByteString)
-mstr Bool
+    mstr :: Bool -> A.Parser (Maybe BL.ByteString)
+    mstr :: Bool -> Parser (Maybe ByteString)
+mstr Bool
 False = forall (f :: * -> *) a. Applicative f => a -> f a
 pure forall a. Maybe a
 Nothing
-    mstr Bool
+    mstr Bool
 True  = forall a. a -> Maybe a
 Just forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
 <$> Parser ByteString
 aString
 
-    parseLevel :: Parser ByteString ProtocolLevel
-parseLevel = ByteString -> Parser ByteString ByteString
+    parseLevel :: Parser ByteString ProtocolLevel
+parseLevel = ByteString -> Parser ByteString ByteString
 A.string ByteString
 "\EOT" forall (f :: * -> *) a b. Functor f => f a -> b -> f b
 $> ProtocolLevel
@@ -1569,49 +1569,49 @@
 $> ProtocolLevel
 Protocol50
 
-    parseLwt :: ProtocolLevel -> Word8 -> Parser ByteString (Maybe LastWill)
-parseLwt ProtocolLevel
-pl Word8
-bits
+    parseLwt :: ProtocolLevel -> Word8 -> Parser ByteString (Maybe LastWill)
+parseLwt ProtocolLevel
+pl Word8
+bits
       | forall a. Bits a => a -> Int -> Bool
 testBit Word8
-bits Int
+bits Int
 2 = do
-          [Property]
-props <- ProtocolLevel -> Parser [Property]
+          [Property]
+props <- ProtocolLevel -> Parser [Property]
 parseProperties ProtocolLevel
-pl
-          ByteString
-top <- Parser ByteString
+pl
+          ByteString
+top <- Parser ByteString
 aString
-          ByteString
-msg <- Parser ByteString
+          ByteString
+msg <- Parser ByteString
 aString
           forall (f :: * -> *) a. Applicative f => a -> f a
 pure forall a b. (a -> b) -> a -> b
 $ forall a. a -> Maybe a
 Just LastWill{_willTopic :: ByteString
 _willTopic=ByteString
-top, _willMsg :: ByteString
+top, _willMsg :: ByteString
 _willMsg=ByteString
-msg,
+msg,
                                _willRetain :: Bool
 _willRetain=forall a. Bits a => a -> Int -> Bool
 testBit Word8
-bits Int
+bits Int
 5,
                                _willQoS :: QoS
 _willQoS=Word8 -> QoS
 wQos forall a b. (a -> b) -> a -> b
 $ (Word8
-bits forall a. Bits a => a -> Int -> a
+bits forall a. Bits a => a -> Int -> a
  Int
 3) forall a. Bits a => a -> a -> a
 .&. Word8
 0x3,
                                _willProps :: [Property]
 _willProps = [Property]
-props}
+props}
       | Bool
 otherwise = forall (f :: * -> *) a. Applicative f => a -> f a
 pure forall a. Maybe a
@@ -1646,13 +1646,13 @@
   | ConnUseAnotherServer
   | ConnServerMoved
   | ConnConnectionRateExceeded
-  deriving(ConnACKRC -> ConnACKRC -> Bool
+  deriving(ConnACKRC -> ConnACKRC -> Bool
 forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
 /= :: ConnACKRC -> ConnACKRC -> Bool
 $c/= :: ConnACKRC -> ConnACKRC -> Bool
 == :: ConnACKRC -> ConnACKRC -> Bool
 $c== :: ConnACKRC -> ConnACKRC -> Bool
-Eq, Int -> ConnACKRC -> ShowS
+Eq, Int -> ConnACKRC -> ShowS
 [ConnACKRC] -> ShowS
 ConnACKRC -> [Char]
 forall a.
@@ -1663,13 +1663,13 @@
 $cshow :: ConnACKRC -> [Char]
 showsPrec :: Int -> ConnACKRC -> ShowS
 $cshowsPrec :: Int -> ConnACKRC -> ShowS
-Show, ConnACKRC
+Show, ConnACKRC
 forall a. a -> a -> Bounded a
 maxBound :: ConnACKRC
 $cmaxBound :: ConnACKRC
 minBound :: ConnACKRC
 $cminBound :: ConnACKRC
-Bounded, Int -> ConnACKRC
+Bounded, Int -> ConnACKRC
 ConnACKRC -> Int
 ConnACKRC -> [ConnACKRC]
 ConnACKRC -> ConnACKRC
@@ -1705,8 +1705,8 @@
 
 instance ByteSize ConnACKRC where
 
-  toByte :: ConnACKRC -> Word8
-toByte ConnACKRC
+  toByte :: ConnACKRC -> Word8
+toByte ConnACKRC
 ConnAccepted                    = Word8
 0
   toByte ConnACKRC
@@ -1788,27 +1788,27 @@
 ConnConnectionRateExceeded      = Word8
 0x9f
 
-  fromByte :: Word8 -> ConnACKRC
-fromByte Word8
-b = forall a. a -> Maybe a -> a
+  fromByte :: Word8 -> ConnACKRC
+fromByte Word8
+b = forall a. a -> Maybe a -> a
 fromMaybe ConnACKRC
 ConnUnspecifiedError forall a b. (a -> b) -> a -> b
 $ forall a b. Eq a => a -> [(a, b)] -> Maybe b
 lookup Word8
-b [(Word8, ConnACKRC)]
+b [(Word8, ConnACKRC)]
 connACKRev
 
 connACKRev :: [(Word8, ConnACKRC)]
 connACKRev :: [(Word8, ConnACKRC)]
 connACKRev = forall a b. (a -> b) -> [a] -> [b]
-map (\ConnACKRC
-w -> (forall a. ByteSize a => a -> Word8
+map (\ConnACKRC
+w -> (forall a. ByteSize a => a -> Word8
 toByte ConnACKRC
-w, ConnACKRC
-w)) [forall a. Bounded a => a
+w, ConnACKRC
+w)) [forall a. Bounded a => a
 minBound..]
 
-data SessionReuse = NewSession | ExistingSession deriving (Int -> SessionReuse -> ShowS
+data SessionReuse = NewSession | ExistingSession deriving (Int -> SessionReuse -> ShowS
 [SessionReuse] -> ShowS
 SessionReuse -> [Char]
 forall a.
@@ -1819,19 +1819,19 @@
 $cshow :: SessionReuse -> [Char]
 showsPrec :: Int -> SessionReuse -> ShowS
 $cshowsPrec :: Int -> SessionReuse -> ShowS
-Show, SessionReuse -> SessionReuse -> Bool
+Show, SessionReuse -> SessionReuse -> Bool
 forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
 /= :: SessionReuse -> SessionReuse -> Bool
 $c/= :: SessionReuse -> SessionReuse -> Bool
 == :: SessionReuse -> SessionReuse -> Bool
 $c== :: SessionReuse -> SessionReuse -> Bool
-Eq, SessionReuse
+Eq, SessionReuse
 forall a. a -> a -> Bounded a
 maxBound :: SessionReuse
 $cmaxBound :: SessionReuse
 minBound :: SessionReuse
 $cminBound :: SessionReuse
-Bounded, Int -> SessionReuse
+Bounded, Int -> SessionReuse
 SessionReuse -> Int
 SessionReuse -> [SessionReuse]
 SessionReuse -> SessionReuse
@@ -1866,13 +1866,13 @@
 Enum)
 
 -- | Connection acknowledgment details.
-data ConnACKFlags = ConnACKFlags SessionReuse ConnACKRC [Property] deriving (ConnACKFlags -> ConnACKFlags -> Bool
+data ConnACKFlags = ConnACKFlags SessionReuse ConnACKRC [Property] deriving (ConnACKFlags -> ConnACKFlags -> Bool
 forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
 /= :: ConnACKFlags -> ConnACKFlags -> Bool
 $c/= :: ConnACKFlags -> ConnACKFlags -> Bool
 == :: ConnACKFlags -> ConnACKFlags -> Bool
 $c== :: ConnACKFlags -> ConnACKFlags -> Bool
-Eq, Int -> ConnACKFlags -> ShowS
+Eq, Int -> ConnACKFlags -> ShowS
 [ConnACKFlags] -> ShowS
 ConnACKFlags -> [Char]
 forall a.
@@ -1885,20 +1885,20 @@
 $cshowsPrec :: Int -> ConnACKFlags -> ShowS
 Show)
 
-instance ByteMe ConnACKFlags where
-  toBytes :: ProtocolLevel -> ConnACKFlags -> [Word8]
-toBytes ProtocolLevel
-prot (ConnACKFlags SessionReuse
-sp ConnACKRC
-rc [Property]
-props) =
-    let pbytes :: [Word8]
-pbytes = ByteString -> [Word8]
+instance ByteMe ConnACKFlags where
+  toBytes :: ProtocolLevel -> ConnACKFlags -> [Word8]
+toBytes ProtocolLevel
+prot (ConnACKFlags SessionReuse
+sp ConnACKRC
+rc [Property]
+props) =
+    let pbytes :: [Word8]
+pbytes = ByteString -> [Word8]
 BL.unpack forall a b. (a -> b) -> a -> b
 $ ProtocolLevel -> [Property] -> ByteString
 bsProps ProtocolLevel
-prot [Property]
-props in
+prot [Property]
+props in
       [Word8
 0x20]
       forall a. Semigroup a => a -> a -> a
@@ -1907,17 +1907,17 @@
 2 forall a. Num a => a -> a -> a
 + forall (t :: * -> *) a. Foldable t => t a -> Int
 length [Word8]
-pbytes)
+pbytes)
       forall a. Semigroup a => a -> a -> a
 <> [Bool -> Word8
 boolBit (SessionReuse
-sp forall a. Eq a => a -> a -> Bool
+sp forall a. Eq a => a -> a -> Bool
 /= SessionReuse
 NewSession), forall a. ByteSize a => a -> Word8
 toByte ConnACKRC
-rc] forall a. Semigroup a => a -> a -> a
+rc] forall a. Semigroup a => a -> a -> a
 <> [Word8]
-pbytes
+pbytes
 
 parseConnectACK :: A.Parser MQTTPkt
 parseConnectACK :: Parser MQTTPkt
@@ -1926,27 +1926,27 @@
 _ <- Word8 -> Parser Word8
 A.word8 Word8
 0x20
-  Int
-rl <- Parser Int
+  Int
+rl <- Parser Int
 decodeVarInt -- remaining length
   forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
 when (Int
-rl forall a. Ord a => a -> a -> Bool
+rl forall a. Ord a => a -> a -> Bool
 < Int
 2) forall a b. (a -> b) -> a -> b
 $ forall (m :: * -> *) a. MonadFail m => [Char] -> m a
 fail [Char]
 "conn ack packet too short"
-  Word8
-ackFlags <- Parser Word8
+  Word8
+ackFlags <- Parser Word8
 A.anyWord8
-  Word8
-rc <- Parser Word8
+  Word8
+rc <- Parser Word8
 A.anyWord8
-  [Property]
-p <- ProtocolLevel -> Parser [Property]
+  [Property]
+p <- ProtocolLevel -> Parser [Property]
 parseProperties (if Int
-rl forall a. Eq a => a -> a -> Bool
+rl forall a. Eq a => a -> a -> Bool
 == Int
 2 then ProtocolLevel
 Protocol311 else ProtocolLevel
@@ -1957,20 +1957,20 @@
 ConnACKPkt forall a b. (a -> b) -> a -> b
 $ SessionReuse -> ConnACKRC -> [Property] -> ConnACKFlags
 ConnACKFlags (Bool -> SessionReuse
-sf forall a b. (a -> b) -> a -> b
+sf forall a b. (a -> b) -> a -> b
 $ forall a. Bits a => a -> Int -> Bool
 testBit Word8
-ackFlags Int
+ackFlags Int
 0) (forall a. ByteSize a => Word8 -> a
 fromByte Word8
-rc) [Property]
-p
+rc) [Property]
+p
 
-    where sf :: Bool -> SessionReuse
-sf Bool
+    where sf :: Bool -> SessionReuse
+sf Bool
 False = SessionReuse
 NewSession
-          sf Bool
+          sf Bool
 True  = SessionReuse
 ExistingSession
 
@@ -1991,13 +1991,13 @@
 _pubBody   :: BL.ByteString
   , PublishRequest -> [Property]
 _pubProps  :: [Property]
-  } deriving(PublishRequest -> PublishRequest -> Bool
+  } deriving(PublishRequest -> PublishRequest -> Bool
 forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
 /= :: PublishRequest -> PublishRequest -> Bool
 $c/= :: PublishRequest -> PublishRequest -> Bool
 == :: PublishRequest -> PublishRequest -> Bool
 $c== :: PublishRequest -> PublishRequest -> Bool
-Eq, Int -> PublishRequest -> ShowS
+Eq, Int -> PublishRequest -> ShowS
 [PublishRequest] -> ShowS
 PublishRequest -> [Char]
 forall a.
@@ -2010,10 +2010,10 @@
 $cshowsPrec :: Int -> PublishRequest -> ShowS
 Show)
 
-instance ByteMe PublishRequest where
-  toByteString :: ProtocolLevel -> PublishRequest -> ByteString
-toByteString ProtocolLevel
-prot PublishRequest{Bool
+instance ByteMe PublishRequest where
+  toByteString :: ProtocolLevel -> PublishRequest -> ByteString
+toByteString ProtocolLevel
+prot PublishRequest{Bool
 [Property]
 Word16
 ByteString
@@ -2032,140 +2032,140 @@
 _pubRetain :: PublishRequest -> Bool
 _pubQoS :: PublishRequest -> QoS
 _pubDup :: PublishRequest -> Bool
-..} =
+..} =
     Word8 -> ByteString
 BL.singleton (Word8
 0x30 forall a. Bits a => a -> a -> a
 .|. Word8
-f) forall a. Semigroup a => a -> a -> a
+f) forall a. Semigroup a => a -> a -> a
 <> ByteString -> ByteString
 withLength ByteString
-val
+val
 
-    where f :: Word8
-f = (Word8
-db forall a. Bits a => a -> Int -> a
+    where f :: Word8
+f = (Word8
+db forall a. Bits a => a -> Int -> a
  Int
 3) forall a. Bits a => a -> a -> a
 .|. (Word8
-qb forall a. Bits a => a -> Int -> a
+qb forall a. Bits a => a -> Int -> a
  Int
 1) forall a. Bits a => a -> a -> a
 .|. Word8
-rb
-          db :: Word8
-db = Bool -> Word8
+rb
+          db :: Word8
+db = Bool -> Word8
 boolBit Bool
-_pubDup
-          qb :: Word8
-qb = QoS -> Word8
+_pubDup
+          qb :: Word8
+qb = QoS -> Word8
 qosW QoS
-_pubQoS forall a. Bits a => a -> a -> a
+_pubQoS forall a. Bits a => a -> a -> a
 .&. Word8
 0x3
-          rb :: Word8
-rb = Bool -> Word8
+          rb :: Word8
+rb = Bool -> Word8
 boolBit Bool
-_pubRetain
-          pktid :: ByteString
-pktid
+_pubRetain
+          pktid :: ByteString
+pktid
             | QoS
-_pubQoS forall a. Eq a => a -> a -> Bool
+_pubQoS forall a. Eq a => a -> a -> Bool
 == QoS
 QoS0 = forall a. Monoid a => a
 mempty
             | Bool
 otherwise = Word16 -> ByteString
 encodeWord16 Word16
-_pubPktID
-          val :: ByteString
-val = forall a. ByteMe a => ProtocolLevel -> a -> ByteString
+_pubPktID
+          val :: ByteString
+val = forall a. ByteMe a => ProtocolLevel -> a -> ByteString
 toByteString ProtocolLevel
-prot ByteString
-_pubTopic forall a. Semigroup a => a -> a -> a
+prot ByteString
+_pubTopic forall a. Semigroup a => a -> a -> a
 <> ByteString
-pktid forall a. Semigroup a => a -> a -> a
+pktid forall a. Semigroup a => a -> a -> a
 <> ProtocolLevel -> [Property] -> ByteString
 bsProps ProtocolLevel
-prot [Property]
-_pubProps forall a. Semigroup a => a -> a -> a
+prot [Property]
+_pubProps forall a. Semigroup a => a -> a -> a
 <> ByteString
-_pubBody
+_pubBody
 
 parsePublish :: ProtocolLevel -> A.Parser MQTTPkt
 parsePublish :: ProtocolLevel -> Parser MQTTPkt
-parsePublish ProtocolLevel
-prot = do
-  Word8
-w <- (Word8 -> Bool) -> Parser Word8
-A.satisfy (\Word8
-x -> Word8
-x forall a. Bits a => a -> a -> a
+parsePublish ProtocolLevel
+prot = do
+  Word8
+w <- (Word8 -> Bool) -> Parser Word8
+A.satisfy (\Word8
+x -> Word8
+x forall a. Bits a => a -> a -> a
 .&. Word8
 0xf0 forall a. Eq a => a -> a -> Bool
 == Word8
 0x30)
-  Int
-plen <- Parser Int
+  Int
+plen <- Parser Int
 parseHdrLen
-  let _pubDup :: Bool
-_pubDup = Word8
-w forall a. Bits a => a -> a -> a
+  let _pubDup :: Bool
+_pubDup = Word8
+w forall a. Bits a => a -> a -> a
 .&. Word8
 0x8 forall a. Eq a => a -> a -> Bool
 == Word8
 0x8
-      _pubQoS :: QoS
-_pubQoS = Word8 -> QoS
+      _pubQoS :: QoS
+_pubQoS = Word8 -> QoS
 wQos forall a b. (a -> b) -> a -> b
 $ (Word8
-w forall a. Bits a => a -> Int -> a
+w forall a. Bits a => a -> Int -> a
  Int
 1) forall a. Bits a => a -> a -> a
 .&. Word8
 3
-      _pubRetain :: Bool
-_pubRetain = Word8
-w forall a. Bits a => a -> a -> a
+      _pubRetain :: Bool
+_pubRetain = Word8
+w forall a. Bits a => a -> a -> a
 .&. Word8
 1 forall a. Eq a => a -> a -> Bool
 == Word8
 1
-  ByteString
-_pubTopic <- Parser ByteString
+  ByteString
+_pubTopic <- Parser ByteString
 aString
-  Word16
-_pubPktID <- if QoS
-_pubQoS forall a. Eq a => a -> a -> Bool
+  Word16
+_pubPktID <- if QoS
+_pubQoS forall a. Eq a => a -> a -> Bool
 == QoS
 QoS0 then forall (f :: * -> *) a. Applicative f => a -> f a
 pure Word16
 0 else Parser Word16
 aWord16
-  [Property]
-_pubProps <- ProtocolLevel -> Parser [Property]
+  [Property]
+_pubProps <- ProtocolLevel -> Parser [Property]
 parseProperties ProtocolLevel
-prot
-  ByteString
-_pubBody <- ByteString -> ByteString
+prot
+  ByteString
+_pubBody <- ByteString -> ByteString
 BL.fromStrict forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
 <$> Int -> Parser ByteString ByteString
 A.take (Int
-plen forall a. Num a => a -> a -> a
+plen forall a. Num a => a -> a -> a
 - forall a b. (Integral a, Num b) => a -> b
 fromIntegral (ByteString -> Int64
 BL.length ByteString
-_pubTopic) forall a. Num a => a -> a -> a
+_pubTopic) forall a. Num a => a -> a -> a
 - Int
 2
                                         forall a. Num a => a -> a -> a
 - forall {a}. Num a => QoS -> a
-qlen QoS
-_pubQoS forall a. Num a => a -> a -> a
+qlen QoS
+_pubQoS forall a. Num a => a -> a -> a
 - ProtocolLevel -> [Property] -> Int
 propLen ProtocolLevel
-prot [Property]
-_pubProps )
+prot [Property]
+_pubProps )
   forall (f :: * -> *) a. Applicative f => a -> f a
 pure forall a b. (a -> b) -> a -> b
 $ PublishRequest -> MQTTPkt
@@ -2188,13 +2188,13 @@
 _pubRetain :: Bool
 _pubQoS :: QoS
 _pubDup :: Bool
-..}
+..}
 
-  where qlen :: QoS -> a
-qlen QoS
+  where qlen :: QoS -> a
+qlen QoS
 QoS0 = a
 0
-        qlen QoS
+        qlen QoS
 _    = a
 2
 
@@ -2202,13 +2202,13 @@
 data RetainHandling = SendOnSubscribe       -- ^ Send existing retained messages to a new client.
                     | SendOnSubscribeNew    -- ^ Send existing retained messages that have not yet been sent.
                     | DoNotSendOnSubscribe  -- ^ Don't send existing retained messages.
-  deriving (RetainHandling -> RetainHandling -> Bool
+  deriving (RetainHandling -> RetainHandling -> Bool
 forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
 /= :: RetainHandling -> RetainHandling -> Bool
 $c/= :: RetainHandling -> RetainHandling -> Bool
 == :: RetainHandling -> RetainHandling -> Bool
 $c== :: RetainHandling -> RetainHandling -> Bool
-Eq, Int -> RetainHandling -> ShowS
+Eq, Int -> RetainHandling -> ShowS
 [RetainHandling] -> ShowS
 RetainHandling -> [Char]
 forall a.
@@ -2219,13 +2219,13 @@
 $cshow :: RetainHandling -> [Char]
 showsPrec :: Int -> RetainHandling -> ShowS
 $cshowsPrec :: Int -> RetainHandling -> ShowS
-Show, RetainHandling
+Show, RetainHandling
 forall a. a -> a -> Bounded a
 maxBound :: RetainHandling
 $cmaxBound :: RetainHandling
 minBound :: RetainHandling
 $cminBound :: RetainHandling
-Bounded, Int -> RetainHandling
+Bounded, Int -> RetainHandling
 RetainHandling -> Int
 RetainHandling -> [RetainHandling]
 RetainHandling -> RetainHandling
@@ -2272,13 +2272,13 @@
 _noLocal           :: Bool            -- ^ If true, do not send messages initiated from this client back.
   , SubOptions -> QoS
 _subQoS            :: QoS             -- ^ Maximum QoS to use for this subscription.
-  } deriving(SubOptions -> SubOptions -> Bool
+  } deriving(SubOptions -> SubOptions -> Bool
 forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
 /= :: SubOptions -> SubOptions -> Bool
 $c/= :: SubOptions -> SubOptions -> Bool
 == :: SubOptions -> SubOptions -> Bool
 $c== :: SubOptions -> SubOptions -> Bool
-Eq, Int -> SubOptions -> ShowS
+Eq, Int -> SubOptions -> ShowS
 [SubOptions] -> ShowS
 SubOptions -> [Char]
 forall a.
@@ -2307,10 +2307,10 @@
 _subQoS=QoS
 QoS0}
 
-instance ByteMe SubOptions where
-  toByteString :: ProtocolLevel -> SubOptions -> ByteString
-toByteString ProtocolLevel
-_ SubOptions{Bool
+instance ByteMe SubOptions where
+  toByteString :: ProtocolLevel -> SubOptions -> ByteString
+toByteString ProtocolLevel
+_ SubOptions{Bool
 RetainHandling
 QoS
 _subQoS :: QoS
@@ -2321,20 +2321,20 @@
 _noLocal :: SubOptions -> Bool
 _retainAsPublished :: SubOptions -> Bool
 _retainHandling :: SubOptions -> RetainHandling
-..} = Word8 -> ByteString
+..} = Word8 -> ByteString
 BL.singleton (Word8
-rh forall a. Bits a => a -> a -> a
+rh forall a. Bits a => a -> a -> a
 .|. Word8
-rap forall a. Bits a => a -> a -> a
+rap forall a. Bits a => a -> a -> a
 .|. Word8
-nl forall a. Bits a => a -> a -> a
+nl forall a. Bits a => a -> a -> a
 .|. Word8
-q)
+q)
 
     where
-      rh :: Word8
-rh = case RetainHandling
-_retainHandling of
+      rh :: Word8
+rh = case RetainHandling
+_retainHandling of
              RetainHandling
 SendOnSubscribeNew   -> Word8
 0x10
@@ -2344,36 +2344,36 @@
              RetainHandling
 _                    -> Word8
 0
-      rap :: Word8
-rap
+      rap :: Word8
+rap
         | Bool
-_retainAsPublished = Word8
+_retainAsPublished = Word8
 0x08
         | Bool
 otherwise = Word8
 0
-      nl :: Word8
-nl
+      nl :: Word8
+nl
         | Bool
-_noLocal = Word8
+_noLocal = Word8
 0x04
         | Bool
 otherwise = Word8
 0
-      q :: Word8
-q = QoS -> Word8
+      q :: Word8
+q = QoS -> Word8
 qosW QoS
-_subQoS
+_subQoS
 
 parseSubOptions :: A.Parser SubOptions
 parseSubOptions :: Parser SubOptions
 parseSubOptions = do
-  Word8
-w <- Parser Word8
+  Word8
+w <- Parser Word8
 A.anyWord8
-  let rh :: RetainHandling
-rh = case Word8
-w forall a. Bits a => a -> Int -> a
+  let rh :: RetainHandling
+rh = case Word8
+w forall a. Bits a => a -> Int -> a
  Int
 4 of
              Word8
@@ -2391,49 +2391,49 @@
 $ SubOptions{
     _retainHandling :: RetainHandling
 _retainHandling=RetainHandling
-rh,
+rh,
     _retainAsPublished :: Bool
 _retainAsPublished=forall a. Bits a => a -> Int -> Bool
 testBit Word8
-w Int
+w Int
 3,
     _noLocal :: Bool
 _noLocal=forall a. Bits a => a -> Int -> Bool
 testBit Word8
-w Int
+w Int
 2,
     _subQoS :: QoS
 _subQoS=Word8 -> QoS
 wQos (Word8
-w forall a. Bits a => a -> a -> a
+w forall a. Bits a => a -> a -> a
 .&. Word8
 0x3)}
 
 subOptionsBytes :: ProtocolLevel -> [(BL.ByteString, SubOptions)] -> BL.ByteString
 subOptionsBytes :: ProtocolLevel -> [(ByteString, SubOptions)] -> ByteString
-subOptionsBytes ProtocolLevel
-prot = forall (t :: * -> *) m a.
+subOptionsBytes ProtocolLevel
+prot = forall (t :: * -> *) m a.
 (Foldable t, Monoid m) =>
 (a -> m) -> t a -> m
-foldMap (\(ByteString
-bs,SubOptions
-so) -> forall a. ByteMe a => ProtocolLevel -> a -> ByteString
+foldMap (\(ByteString
+bs,SubOptions
+so) -> forall a. ByteMe a => ProtocolLevel -> a -> ByteString
 toByteString ProtocolLevel
-prot ByteString
-bs forall a. Semigroup a => a -> a -> a
+prot ByteString
+bs forall a. Semigroup a => a -> a -> a
 <> forall a. ByteMe a => ProtocolLevel -> a -> ByteString
 toByteString ProtocolLevel
-prot SubOptions
-so)
+prot SubOptions
+so)
 
 data SubscribeRequest = SubscribeRequest PktID [(BL.ByteString, SubOptions)] [Property]
-                      deriving(SubscribeRequest -> SubscribeRequest -> Bool
+                      deriving(SubscribeRequest -> SubscribeRequest -> Bool
 forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
 /= :: SubscribeRequest -> SubscribeRequest -> Bool
 $c/= :: SubscribeRequest -> SubscribeRequest -> Bool
 == :: SubscribeRequest -> SubscribeRequest -> Bool
 $c== :: SubscribeRequest -> SubscribeRequest -> Bool
-Eq, Int -> SubscribeRequest -> ShowS
+Eq, Int -> SubscribeRequest -> ShowS
 [SubscribeRequest] -> ShowS
 SubscribeRequest -> [Char]
 forall a.
@@ -2446,36 +2446,36 @@
 $cshowsPrec :: Int -> SubscribeRequest -> ShowS
 Show)
 
-instance ByteMe SubscribeRequest where
-  toByteString :: ProtocolLevel -> SubscribeRequest -> ByteString
-toByteString ProtocolLevel
-prot (SubscribeRequest Word16
-pid [(ByteString, SubOptions)]
-sreq [Property]
-props) =
+instance ByteMe SubscribeRequest where
+  toByteString :: ProtocolLevel -> SubscribeRequest -> ByteString
+toByteString ProtocolLevel
+prot (SubscribeRequest Word16
+pid [(ByteString, SubOptions)]
+sreq [Property]
+props) =
     Word8 -> ByteString
 BL.singleton Word8
 0x82 forall a. Semigroup a => a -> a -> a
 <> ByteString -> ByteString
 withLength (Word16 -> ByteString
 encodeWord16 Word16
-pid forall a. Semigroup a => a -> a -> a
+pid forall a. Semigroup a => a -> a -> a
 <> ProtocolLevel -> [Property] -> ByteString
 bsProps ProtocolLevel
-prot [Property]
-props forall a. Semigroup a => a -> a -> a
+prot [Property]
+props forall a. Semigroup a => a -> a -> a
 <> ProtocolLevel -> [(ByteString, SubOptions)] -> ByteString
 subOptionsBytes ProtocolLevel
-prot [(ByteString, SubOptions)]
-sreq)
+prot [(ByteString, SubOptions)]
+sreq)
 
-data PubACK = PubACK PktID Word8 [Property] deriving(PubACK -> PubACK -> Bool
+data PubACK = PubACK PktID Word8 [Property] deriving(PubACK -> PubACK -> Bool
 forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
 /= :: PubACK -> PubACK -> Bool
 $c/= :: PubACK -> PubACK -> Bool
 == :: PubACK -> PubACK -> Bool
 $c== :: PubACK -> PubACK -> Bool
-Eq, Int -> PubACK -> ShowS
+Eq, Int -> PubACK -> ShowS
 [PubACK] -> ShowS
 PubACK -> [Char]
 forall a.
@@ -2492,95 +2492,95 @@
 bsPubSeg :: ProtocolLevel
 -> Word8 -> Word16 -> Word8 -> [Property] -> ByteString
 bsPubSeg ProtocolLevel
-Protocol311 Word8
-h Word16
-pid Word8
+Protocol311 Word8
+h Word16
+pid Word8
 _ [Property]
 _ = Word8 -> ByteString
 BL.singleton Word8
-h forall a. Semigroup a => a -> a -> a
+h forall a. Semigroup a => a -> a -> a
 <> ByteString -> ByteString
 withLength (Word16 -> ByteString
 encodeWord16 Word16
-pid)
+pid)
 bsPubSeg ProtocolLevel
-Protocol50 Word8
-h Word16
-pid Word8
-st [Property]
-props = Word8 -> ByteString
+Protocol50 Word8
+h Word16
+pid Word8
+st [Property]
+props = Word8 -> ByteString
 BL.singleton Word8
-h
+h
                                      forall a. Semigroup a => a -> a -> a
 <> ByteString -> ByteString
 withLength (Word16 -> ByteString
 encodeWord16 Word16
-pid
+pid
                                                     forall a. Semigroup a => a -> a -> a
 <> Word8 -> ByteString
 BL.singleton Word8
-st
+st
                                                     forall a. Semigroup a => a -> a -> a
 <> [Property] -> ByteString
-mprop [Property]
-props)
+mprop [Property]
+props)
     where
-      mprop :: [Property] -> ByteString
-mprop [] = forall a. Monoid a => a
+      mprop :: [Property] -> ByteString
+mprop [] = forall a. Monoid a => a
 mempty
-      mprop [Property]
-p  = ProtocolLevel -> [Property] -> ByteString
+      mprop [Property]
+p  = ProtocolLevel -> [Property] -> ByteString
 bsProps ProtocolLevel
 Protocol50 [Property]
-p
+p
 
-instance ByteMe PubACK where
-  toByteString :: ProtocolLevel -> PubACK -> ByteString
-toByteString ProtocolLevel
-prot (PubACK Word16
-pid Word8
-st [Property]
-props) = ProtocolLevel
+instance ByteMe PubACK where
+  toByteString :: ProtocolLevel -> PubACK -> ByteString
+toByteString ProtocolLevel
+prot (PubACK Word16
+pid Word8
+st [Property]
+props) = ProtocolLevel
 -> Word8 -> Word16 -> Word8 -> [Property] -> ByteString
 bsPubSeg ProtocolLevel
-prot Word8
+prot Word8
 0x40 Word16
-pid Word8
-st [Property]
-props
+pid Word8
+st [Property]
+props
 
 -- Common parser for all of the pub parts for q>0 handling:  (PubACK, PubREC, PubREL, PubCOMP)
-parsePubSeg :: Word8 -> (a -> MQTTPkt) -> (PktID -> Word8 -> [Property] -> a) -> A.Parser MQTTPkt
+parsePubSeg :: Word8 -> (a -> MQTTPkt) -> (PktID -> Word8 -> [Property] -> a) -> A.Parser MQTTPkt
 parsePubSeg :: forall a.
 Word8
 -> (a -> MQTTPkt)
 -> (Word16 -> Word8 -> [Property] -> a)
 -> Parser MQTTPkt
-parsePubSeg Word8
-i a -> MQTTPkt
-cona Word16 -> Word8 -> [Property] -> a
-conb = do
+parsePubSeg Word8
+i a -> MQTTPkt
+cona Word16 -> Word8 -> [Property] -> a
+conb = do
   Word8
 _ <- Word8 -> Parser Word8
 A.word8 Word8
-i
-  Int
-rl <- Parser Int
+i
+  Int
+rl <- Parser Int
 parseHdrLen
-  Word16
-mid <- Parser Word16
+  Word16
+mid <- Parser Word16
 aWord16
-  Word8
-st <- if Int
-rl forall a. Ord a => a -> a -> Bool
+  Word8
+st <- if Int
+rl forall a. Ord a => a -> a -> Bool
 > Int
 2 then Parser Word8
 A.anyWord8 else forall (f :: * -> *) a. Applicative f => a -> f a
 pure Word8
 0
-  [Property]
-props <- if Int
-rl forall a. Ord a => a -> a -> Bool
+  [Property]
+props <- if Int
+rl forall a. Ord a => a -> a -> Bool
 > Int
 3 then ProtocolLevel -> Parser [Property]
 parseProperties ProtocolLevel
@@ -2590,11 +2590,11 @@
   forall (f :: * -> *) a. Applicative f => a -> f a
 pure forall a b. (a -> b) -> a -> b
 $ a -> MQTTPkt
-cona (Word16 -> Word8 -> [Property] -> a
-conb Word16
-mid Word8
-st [Property]
-props)
+cona (Word16 -> Word8 -> [Property] -> a
+conb Word16
+mid Word8
+st [Property]
+props)
 
 parsePubACK :: A.Parser MQTTPkt
 parsePubACK :: Parser MQTTPkt
@@ -2608,13 +2608,13 @@
 PubACKPkt Word16 -> Word8 -> [Property] -> PubACK
 PubACK
 
-data PubREC = PubREC PktID Word8 [Property] deriving(PubREC -> PubREC -> Bool
+data PubREC = PubREC PktID Word8 [Property] deriving(PubREC -> PubREC -> Bool
 forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
 /= :: PubREC -> PubREC -> Bool
 $c/= :: PubREC -> PubREC -> Bool
 == :: PubREC -> PubREC -> Bool
 $c== :: PubREC -> PubREC -> Bool
-Eq, Int -> PubREC -> ShowS
+Eq, Int -> PubREC -> ShowS
 [PubREC] -> ShowS
 PubREC -> [Char]
 forall a.
@@ -2627,20 +2627,20 @@
 $cshowsPrec :: Int -> PubREC -> ShowS
 Show)
 
-instance ByteMe PubREC where
-  toByteString :: ProtocolLevel -> PubREC -> ByteString
-toByteString ProtocolLevel
-prot (PubREC Word16
-pid Word8
-st [Property]
-props) = ProtocolLevel
+instance ByteMe PubREC where
+  toByteString :: ProtocolLevel -> PubREC -> ByteString
+toByteString ProtocolLevel
+prot (PubREC Word16
+pid Word8
+st [Property]
+props) = ProtocolLevel
 -> Word8 -> Word16 -> Word8 -> [Property] -> ByteString
 bsPubSeg ProtocolLevel
-prot Word8
+prot Word8
 0x50 Word16
-pid Word8
-st [Property]
-props
+pid Word8
+st [Property]
+props
 
 parsePubREC :: A.Parser MQTTPkt
 parsePubREC :: Parser MQTTPkt
@@ -2654,13 +2654,13 @@
 PubRECPkt Word16 -> Word8 -> [Property] -> PubREC
 PubREC
 
-data PubREL = PubREL PktID Word8 [Property] deriving(PubREL -> PubREL -> Bool
+data PubREL = PubREL PktID Word8 [Property] deriving(PubREL -> PubREL -> Bool
 forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
 /= :: PubREL -> PubREL -> Bool
 $c/= :: PubREL -> PubREL -> Bool
 == :: PubREL -> PubREL -> Bool
 $c== :: PubREL -> PubREL -> Bool
-Eq, Int -> PubREL -> ShowS
+Eq, Int -> PubREL -> ShowS
 [PubREL] -> ShowS
 PubREL -> [Char]
 forall a.
@@ -2673,20 +2673,20 @@
 $cshowsPrec :: Int -> PubREL -> ShowS
 Show)
 
-instance ByteMe PubREL where
-  toByteString :: ProtocolLevel -> PubREL -> ByteString
-toByteString ProtocolLevel
-prot (PubREL Word16
-pid Word8
-st [Property]
-props) = ProtocolLevel
+instance ByteMe PubREL where
+  toByteString :: ProtocolLevel -> PubREL -> ByteString
+toByteString ProtocolLevel
+prot (PubREL Word16
+pid Word8
+st [Property]
+props) = ProtocolLevel
 -> Word8 -> Word16 -> Word8 -> [Property] -> ByteString
 bsPubSeg ProtocolLevel
-prot Word8
+prot Word8
 0x62 Word16
-pid Word8
-st [Property]
-props
+pid Word8
+st [Property]
+props
 
 parsePubREL :: A.Parser MQTTPkt
 parsePubREL :: Parser MQTTPkt
@@ -2700,13 +2700,13 @@
 PubRELPkt Word16 -> Word8 -> [Property] -> PubREL
 PubREL
 
-data PubCOMP = PubCOMP PktID Word8 [Property] deriving(PubCOMP -> PubCOMP -> Bool
+data PubCOMP = PubCOMP PktID Word8 [Property] deriving(PubCOMP -> PubCOMP -> Bool
 forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
 /= :: PubCOMP -> PubCOMP -> Bool
 $c/= :: PubCOMP -> PubCOMP -> Bool
 == :: PubCOMP -> PubCOMP -> Bool
 $c== :: PubCOMP -> PubCOMP -> Bool
-Eq, Int -> PubCOMP -> ShowS
+Eq, Int -> PubCOMP -> ShowS
 [PubCOMP] -> ShowS
 PubCOMP -> [Char]
 forall a.
@@ -2719,20 +2719,20 @@
 $cshowsPrec :: Int -> PubCOMP -> ShowS
 Show)
 
-instance ByteMe PubCOMP where
-  toByteString :: ProtocolLevel -> PubCOMP -> ByteString
-toByteString ProtocolLevel
-prot (PubCOMP Word16
-pid Word8
-st [Property]
-props) = ProtocolLevel
+instance ByteMe PubCOMP where
+  toByteString :: ProtocolLevel -> PubCOMP -> ByteString
+toByteString ProtocolLevel
+prot (PubCOMP Word16
+pid Word8
+st [Property]
+props) = ProtocolLevel
 -> Word8 -> Word16 -> Word8 -> [Property] -> ByteString
 bsPubSeg ProtocolLevel
-prot Word8
+prot Word8
 0x70 Word16
-pid Word8
-st [Property]
-props
+pid Word8
+st [Property]
+props
 
 parsePubCOMP :: A.Parser MQTTPkt
 parsePubCOMP :: Parser MQTTPkt
@@ -2747,71 +2747,71 @@
 PubCOMP
 
 -- Common header bits for subscribe, unsubscribe, and the sub acks.
-parseSubHdr :: Word8 -> ProtocolLevel -> A.Parser a -> A.Parser (PktID, [Property], a)
+parseSubHdr :: Word8 -> ProtocolLevel -> A.Parser a -> A.Parser (PktID, [Property], a)
 parseSubHdr :: forall a.
 Word8
 -> ProtocolLevel -> Parser a -> Parser (Word16, [Property], a)
-parseSubHdr Word8
-b ProtocolLevel
-prot Parser a
-p = do
+parseSubHdr Word8
+b ProtocolLevel
+prot Parser a
+p = do
   Word8
 _ <- Word8 -> Parser Word8
 A.word8 Word8
-b
-  Int
-hl <- Parser Int
+b
+  Int
+hl <- Parser Int
 parseHdrLen
-  Word16
-pid <- Parser Word16
+  Word16
+pid <- Parser Word16
 aWord16
-  [Property]
-props <- ProtocolLevel -> Parser [Property]
+  [Property]
+props <- ProtocolLevel -> Parser [Property]
 parseProperties ProtocolLevel
-prot
-  ByteString
-content <- Int -> Parser ByteString ByteString
+prot
+  ByteString
+content <- Int -> Parser ByteString ByteString
 A.take (forall a b. (Integral a, Num b) => a -> b
 fromIntegral Int
-hl forall a. Num a => a -> a -> a
+hl forall a. Num a => a -> a -> a
 - Int
 2 forall a. Num a => a -> a -> a
 - ProtocolLevel -> [Property] -> Int
 propLen ProtocolLevel
-prot [Property]
-props)
-  a
-a <- ByteString -> Parser a
-subp ByteString
-content
+prot [Property]
+props)
+  a
+a <- ByteString -> Parser a
+subp ByteString
+content
   forall (f :: * -> *) a. Applicative f => a -> f a
 pure (Word16
-pid, [Property]
-props, a
-a)
+pid, [Property]
+props, a
+a)
 
-    where subp :: ByteString -> Parser a
-subp = forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
+    where subp :: ByteString -> Parser a
+subp = forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
 either forall (m :: * -> *) a. MonadFail m => [Char] -> m a
 fail forall (f :: * -> *) a. Applicative f => a -> f a
 pure forall b c a. (b -> c) -> (a -> b) -> a -> c
 . forall a. Parser a -> ByteString -> Either [Char] a
 AS.parseOnly Parser a
-p
+p
 
 parseSubscribe :: ProtocolLevel -> A.Parser MQTTPkt
 parseSubscribe :: ProtocolLevel -> Parser MQTTPkt
-parseSubscribe ProtocolLevel
-prot = do
-  (Word16
-pid, [Property]
-props, [(ByteString, SubOptions)]
-subs) <- forall a.
+parseSubscribe ProtocolLevel
+prot = do
+  (Word16
+pid, [Property]
+props, [(ByteString, SubOptions)]
+subs) <- forall a.
 Word8
 -> ProtocolLevel -> Parser a -> Parser (Word16, [Property], a)
 parseSubHdr Word8
 0x82 ProtocolLevel
-prot forall a b. (a -> b) -> a -> b
+prot forall a b. (a -> b) -> a -> b
 $ forall (f :: * -> *) a. Alternative f => f a -> f [a]
 A.many1 (forall (f :: * -> *) a b c.
 Applicative f =>
@@ -2825,17 +2825,17 @@
 SubscribePkt (Word16
 -> [(ByteString, SubOptions)] -> [Property] -> SubscribeRequest
 SubscribeRequest Word16
-pid [(ByteString, SubOptions)]
-subs [Property]
-props)
+pid [(ByteString, SubOptions)]
+subs [Property]
+props)
 
-data SubscribeResponse = SubscribeResponse PktID [Either SubErr QoS] [Property] deriving (SubscribeResponse -> SubscribeResponse -> Bool
+data SubscribeResponse = SubscribeResponse PktID [Either SubErr QoS] [Property] deriving (SubscribeResponse -> SubscribeResponse -> Bool
 forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
 /= :: SubscribeResponse -> SubscribeResponse -> Bool
 $c/= :: SubscribeResponse -> SubscribeResponse -> Bool
 == :: SubscribeResponse -> SubscribeResponse -> Bool
 $c== :: SubscribeResponse -> SubscribeResponse -> Bool
-Eq, Int -> SubscribeResponse -> ShowS
+Eq, Int -> SubscribeResponse -> ShowS
 [SubscribeResponse] -> ShowS
 SubscribeResponse -> [Char]
 forall a.
@@ -2848,63 +2848,63 @@
 $cshowsPrec :: Int -> SubscribeResponse -> ShowS
 Show)
 
-instance ByteMe SubscribeResponse where
-  toByteString :: ProtocolLevel -> SubscribeResponse -> ByteString
-toByteString ProtocolLevel
-prot (SubscribeResponse Word16
-pid [Either SubErr QoS]
-sres [Property]
-props) =
+instance ByteMe SubscribeResponse where
+  toByteString :: ProtocolLevel -> SubscribeResponse -> ByteString
+toByteString ProtocolLevel
+prot (SubscribeResponse Word16
+pid [Either SubErr QoS]
+sres [Property]
+props) =
     Word8 -> ByteString
 BL.singleton Word8
 0x90 forall a. Semigroup a => a -> a -> a
 <> ByteString -> ByteString
 withLength (Word16 -> ByteString
 encodeWord16 Word16
-pid forall a. Semigroup a => a -> a -> a
+pid forall a. Semigroup a => a -> a -> a
 <> ProtocolLevel -> [Property] -> ByteString
 bsProps ProtocolLevel
-prot [Property]
-props forall a. Semigroup a => a -> a -> a
+prot [Property]
+props forall a. Semigroup a => a -> a -> a
 <> [Word8] -> ByteString
 BL.pack (Either SubErr QoS -> Word8
-b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
+b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
 <$> [Either SubErr QoS]
-sres))
+sres))
 
     where
-      b :: Either SubErr QoS -> Word8
-b (Left SubErr
+      b :: Either SubErr QoS -> Word8
+b (Left SubErr
 SubErrUnspecifiedError)                    =  Word8
 0x80
-      b (Left SubErr
+      b (Left SubErr
 SubErrImplementationSpecificError)         =  Word8
 0x83
-      b (Left SubErr
+      b (Left SubErr
 SubErrNotAuthorized)                       =  Word8
 0x87
-      b (Left SubErr
+      b (Left SubErr
 SubErrTopicFilterInvalid)                  =  Word8
 0x8F
-      b (Left SubErr
+      b (Left SubErr
 SubErrPacketIdentifierInUse)               =  Word8
 0x91
-      b (Left SubErr
+      b (Left SubErr
 SubErrQuotaExceeded)                       =  Word8
 0x97
-      b (Left SubErr
+      b (Left SubErr
 SubErrSharedSubscriptionsNotSupported)     =  Word8
 0x9E
-      b (Left SubErr
+      b (Left SubErr
 SubErrSubscriptionIdentifiersNotSupported) =  Word8
 0xA1
-      b (Left SubErr
+      b (Left SubErr
 SubErrWildcardSubscriptionsNotSupported)   =  Word8
 0xA2
-      b (Right QoS
-q)                                        = QoS -> Word8
+      b (Right QoS
+q)                                        = QoS -> Word8
 qosW QoS
-q
+q
 
 propLen :: ProtocolLevel -> [Property] -> Int
 propLen :: ProtocolLevel -> [Property] -> Int
@@ -2912,15 +2912,15 @@
 Protocol311 [Property]
 _ = Int
 0
-propLen ProtocolLevel
-prot [Property]
-props    = forall a b. (Integral a, Num b) => a -> b
+propLen ProtocolLevel
+prot [Property]
+props    = forall a b. (Integral a, Num b) => a -> b
 fromIntegral forall a b. (a -> b) -> a -> b
 $ ByteString -> Int64
 BL.length (ProtocolLevel -> [Property] -> ByteString
 bsProps ProtocolLevel
-prot [Property]
-props)
+prot [Property]
+props)
 
 data SubErr = SubErrUnspecifiedError
   | SubErrImplementationSpecificError
@@ -2931,13 +2931,13 @@
   | SubErrSharedSubscriptionsNotSupported
   | SubErrSubscriptionIdentifiersNotSupported
   | SubErrWildcardSubscriptionsNotSupported
-  deriving (SubErr -> SubErr -> Bool
+  deriving (SubErr -> SubErr -> Bool
 forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
 /= :: SubErr -> SubErr -> Bool
 $c/= :: SubErr -> SubErr -> Bool
 == :: SubErr -> SubErr -> Bool
 $c== :: SubErr -> SubErr -> Bool
-Eq, Int -> SubErr -> ShowS
+Eq, Int -> SubErr -> ShowS
 [SubErr] -> ShowS
 SubErr -> [Char]
 forall a.
@@ -2948,13 +2948,13 @@
 $cshow :: SubErr -> [Char]
 showsPrec :: Int -> SubErr -> ShowS
 $cshowsPrec :: Int -> SubErr -> ShowS
-Show, SubErr
+Show, SubErr
 forall a. a -> a -> Bounded a
 maxBound :: SubErr
 $cmaxBound :: SubErr
 minBound :: SubErr
 $cminBound :: SubErr
-Bounded, Int -> SubErr
+Bounded, Int -> SubErr
 SubErr -> Int
 SubErr -> [SubErr]
 SubErr -> SubErr
@@ -2990,20 +2990,20 @@
 
 parseSubACK :: ProtocolLevel -> A.Parser MQTTPkt
 parseSubACK :: ProtocolLevel -> Parser MQTTPkt
-parseSubACK ProtocolLevel
-prot = do
-  (Word16
-pid, [Property]
-props, [Either SubErr QoS]
-res) <- forall a.
+parseSubACK ProtocolLevel
+prot = do
+  (Word16
+pid, [Property]
+props, [Either SubErr QoS]
+res) <- forall a.
 Word8
 -> ProtocolLevel -> Parser a -> Parser (Word16, [Property], a)
 parseSubHdr Word8
 0x90 ProtocolLevel
-prot forall a b. (a -> b) -> a -> b
+prot forall a b. (a -> b) -> a -> b
 $ forall (f :: * -> *) a. Alternative f => f a -> f [a]
 A.many1 (Word8 -> Either SubErr QoS
-p forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
+p forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
 <$> Parser Word8
 A.anyWord8)
   forall (f :: * -> *) a. Applicative f => a -> f a
@@ -3011,62 +3011,62 @@
 $ SubscribeResponse -> MQTTPkt
 SubACKPkt (Word16 -> [Either SubErr QoS] -> [Property] -> SubscribeResponse
 SubscribeResponse Word16
-pid [Either SubErr QoS]
-res [Property]
-props)
+pid [Either SubErr QoS]
+res [Property]
+props)
 
   where
-    p :: Word8 -> Either SubErr QoS
-p Word8
+    p :: Word8 -> Either SubErr QoS
+p Word8
 0x80 = forall a b. a -> Either a b
 Left SubErr
 SubErrUnspecifiedError
-    p Word8
+    p Word8
 0x83 = forall a b. a -> Either a b
 Left SubErr
 SubErrImplementationSpecificError
-    p Word8
+    p Word8
 0x87 = forall a b. a -> Either a b
 Left SubErr
 SubErrNotAuthorized
-    p Word8
+    p Word8
 0x8F = forall a b. a -> Either a b
 Left SubErr
 SubErrTopicFilterInvalid
-    p Word8
+    p Word8
 0x91 = forall a b. a -> Either a b
 Left SubErr
 SubErrPacketIdentifierInUse
-    p Word8
+    p Word8
 0x97 = forall a b. a -> Either a b
 Left SubErr
 SubErrQuotaExceeded
-    p Word8
+    p Word8
 0x9E = forall a b. a -> Either a b
 Left SubErr
 SubErrSharedSubscriptionsNotSupported
-    p Word8
+    p Word8
 0xA1 = forall a b. a -> Either a b
 Left SubErr
 SubErrSubscriptionIdentifiersNotSupported
-    p Word8
+    p Word8
 0xA2 = forall a b. a -> Either a b
 Left SubErr
 SubErrWildcardSubscriptionsNotSupported
-    p Word8
-x    = forall a b. b -> Either a b
+    p Word8
+x    = forall a b. b -> Either a b
 Right (Word8 -> QoS
 wQos Word8
-x)
+x)
 
 data UnsubscribeRequest = UnsubscribeRequest PktID [BL.ByteString] [Property]
-                        deriving(UnsubscribeRequest -> UnsubscribeRequest -> Bool
+                        deriving(UnsubscribeRequest -> UnsubscribeRequest -> Bool
 forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
 /= :: UnsubscribeRequest -> UnsubscribeRequest -> Bool
 $c/= :: UnsubscribeRequest -> UnsubscribeRequest -> Bool
 == :: UnsubscribeRequest -> UnsubscribeRequest -> Bool
 $c== :: UnsubscribeRequest -> UnsubscribeRequest -> Bool
-Eq, Int -> UnsubscribeRequest -> ShowS
+Eq, Int -> UnsubscribeRequest -> ShowS
 [UnsubscribeRequest] -> ShowS
 UnsubscribeRequest -> [Char]
 forall a.
@@ -3079,13 +3079,13 @@
 $cshowsPrec :: Int -> UnsubscribeRequest -> ShowS
 Show)
 
-instance ByteMe UnsubscribeRequest where
-  toByteString :: ProtocolLevel -> UnsubscribeRequest -> ByteString
-toByteString ProtocolLevel
-prot (UnsubscribeRequest Word16
-pid [ByteString]
-sreq [Property]
-props) =
+instance ByteMe UnsubscribeRequest where
+  toByteString :: ProtocolLevel -> UnsubscribeRequest -> ByteString
+toByteString ProtocolLevel
+prot (UnsubscribeRequest Word16
+pid [ByteString]
+sreq [Property]
+props) =
     Word8 -> ByteString
 BL.singleton Word8
 0xa2
@@ -3093,31 +3093,31 @@
 <> ByteString -> ByteString
 withLength (Word16 -> ByteString
 encodeWord16 Word16
-pid forall a. Semigroup a => a -> a -> a
+pid forall a. Semigroup a => a -> a -> a
 <> ProtocolLevel -> [Property] -> ByteString
 bsProps ProtocolLevel
-prot [Property]
-props forall a. Semigroup a => a -> a -> a
+prot [Property]
+props forall a. Semigroup a => a -> a -> a
 <> forall a. Monoid a => [a] -> a
 mconcat (forall a. ByteMe a => ProtocolLevel -> a -> ByteString
 toByteString ProtocolLevel
-prot forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
+prot forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
 <$> [ByteString]
-sreq))
+sreq))
 
 parseUnsubscribe :: ProtocolLevel -> A.Parser MQTTPkt
 parseUnsubscribe :: ProtocolLevel -> Parser MQTTPkt
-parseUnsubscribe ProtocolLevel
-prot = do
-  (Word16
-pid, [Property]
-props, [ByteString]
-subs) <- forall a.
+parseUnsubscribe ProtocolLevel
+prot = do
+  (Word16
+pid, [Property]
+props, [ByteString]
+subs) <- forall a.
 Word8
 -> ProtocolLevel -> Parser a -> Parser (Word16, [Property], a)
 parseSubHdr Word8
 0xa2 ProtocolLevel
-prot forall a b. (a -> b) -> a -> b
+prot forall a b. (a -> b) -> a -> b
 $ forall (f :: * -> *) a. Alternative f => f a -> f [a]
 A.many1 Parser ByteString
 aString
@@ -3126,9 +3126,9 @@
 $ UnsubscribeRequest -> MQTTPkt
 UnsubscribePkt (Word16 -> [ByteString] -> [Property] -> UnsubscribeRequest
 UnsubscribeRequest Word16
-pid [ByteString]
-subs [Property]
-props)
+pid [ByteString]
+subs [Property]
+props)
 
 data UnsubStatus = UnsubSuccess
                  | UnsubNoSubscriptionExisted
@@ -3137,7 +3137,7 @@
                  | UnsubNotAuthorized
                  | UnsubTopicFilterInvalid
                  | UnsubPacketIdentifierInUse
-                 deriving(Int -> UnsubStatus -> ShowS
+                 deriving(Int -> UnsubStatus -> ShowS
 [UnsubStatus] -> ShowS
 UnsubStatus -> [Char]
 forall a.
@@ -3148,19 +3148,19 @@
 $cshow :: UnsubStatus -> [Char]
 showsPrec :: Int -> UnsubStatus -> ShowS
 $cshowsPrec :: Int -> UnsubStatus -> ShowS
-Show, UnsubStatus -> UnsubStatus -> Bool
+Show, UnsubStatus -> UnsubStatus -> Bool
 forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
 /= :: UnsubStatus -> UnsubStatus -> Bool
 $c/= :: UnsubStatus -> UnsubStatus -> Bool
 == :: UnsubStatus -> UnsubStatus -> Bool
 $c== :: UnsubStatus -> UnsubStatus -> Bool
-Eq, UnsubStatus
+Eq, UnsubStatus
 forall a. a -> a -> Bounded a
 maxBound :: UnsubStatus
 $cmaxBound :: UnsubStatus
 minBound :: UnsubStatus
 $cminBound :: UnsubStatus
-Bounded, Int -> UnsubStatus
+Bounded, Int -> UnsubStatus
 UnsubStatus -> Int
 UnsubStatus -> [UnsubStatus]
 UnsubStatus -> UnsubStatus
@@ -3194,9 +3194,9 @@
 $csucc :: UnsubStatus -> UnsubStatus
 Enum)
 
-instance ByteMe UnsubStatus where
-  toByteString :: ProtocolLevel -> UnsubStatus -> ByteString
-toByteString ProtocolLevel
+instance ByteMe UnsubStatus where
+  toByteString :: ProtocolLevel -> UnsubStatus -> ByteString
+toByteString ProtocolLevel
 _ UnsubStatus
 UnsubSuccess                     = Word8 -> ByteString
 BL.singleton Word8
@@ -3232,13 +3232,13 @@
 BL.singleton Word8
 0x91
 
-data UnsubscribeResponse = UnsubscribeResponse PktID [Property] [UnsubStatus] deriving(UnsubscribeResponse -> UnsubscribeResponse -> Bool
+data UnsubscribeResponse = UnsubscribeResponse PktID [Property] [UnsubStatus] deriving(UnsubscribeResponse -> UnsubscribeResponse -> Bool
 forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
 /= :: UnsubscribeResponse -> UnsubscribeResponse -> Bool
 $c/= :: UnsubscribeResponse -> UnsubscribeResponse -> Bool
 == :: UnsubscribeResponse -> UnsubscribeResponse -> Bool
 $c== :: UnsubscribeResponse -> UnsubscribeResponse -> Bool
-Eq, Int -> UnsubscribeResponse -> ShowS
+Eq, Int -> UnsubscribeResponse -> ShowS
 [UnsubscribeResponse] -> ShowS
 UnsubscribeResponse -> [Char]
 forall a.
@@ -3251,11 +3251,11 @@
 $cshowsPrec :: Int -> UnsubscribeResponse -> ShowS
 Show)
 
-instance ByteMe UnsubscribeResponse where
-  toByteString :: ProtocolLevel -> UnsubscribeResponse -> ByteString
-toByteString ProtocolLevel
-Protocol311 (UnsubscribeResponse Word16
-pid [Property]
+instance ByteMe UnsubscribeResponse where
+  toByteString :: ProtocolLevel -> UnsubscribeResponse -> ByteString
+toByteString ProtocolLevel
+Protocol311 (UnsubscribeResponse Word16
+pid [Property]
 _ [UnsubStatus]
 _) =
     Word8 -> ByteString
@@ -3264,32 +3264,32 @@
 <> ByteString -> ByteString
 withLength (Word16 -> ByteString
 encodeWord16 Word16
-pid)
+pid)
 
   toByteString ProtocolLevel
-Protocol50 (UnsubscribeResponse Word16
-pid [Property]
-props [UnsubStatus]
-res) =
+Protocol50 (UnsubscribeResponse Word16
+pid [Property]
+props [UnsubStatus]
+res) =
     Word8 -> ByteString
 BL.singleton Word8
 0xb0 forall a. Semigroup a => a -> a -> a
 <> ByteString -> ByteString
 withLength (Word16 -> ByteString
 encodeWord16 Word16
-pid
+pid
                                       forall a. Semigroup a => a -> a -> a
 <> ProtocolLevel -> [Property] -> ByteString
 bsProps ProtocolLevel
 Protocol50 [Property]
-props
+props
                                       forall a. Semigroup a => a -> a -> a
 <> forall a. Monoid a => [a] -> a
 mconcat (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
 fmap (forall a. ByteMe a => ProtocolLevel -> a -> ByteString
 toByteString ProtocolLevel
 Protocol50) [UnsubStatus]
-res))
+res))
 
 parseUnsubACK :: ProtocolLevel -> A.Parser MQTTPkt
 parseUnsubACK :: ProtocolLevel -> Parser MQTTPkt
@@ -3302,15 +3302,15 @@
   Int
 _ <- Parser Int
 parseHdrLen
-  Word16
-pid <- Parser Word16
+  Word16
+pid <- Parser Word16
 aWord16
   forall (f :: * -> *) a. Applicative f => a -> f a
 pure forall a b. (a -> b) -> a -> b
 $ UnsubscribeResponse -> MQTTPkt
 UnsubACKPkt (Word16 -> [Property] -> [UnsubStatus] -> UnsubscribeResponse
 UnsubscribeResponse Word16
-pid forall a. Monoid a => a
+pid forall a. Monoid a => a
 mempty forall a. Monoid a => a
 mempty)
 
@@ -3320,40 +3320,40 @@
 _ <- Word8 -> Parser Word8
 A.word8 Word8
 0xb0
-  Int
-rl <- Parser Int
+  Int
+rl <- Parser Int
 parseHdrLen
-  Word16
-pid <- Parser Word16
+  Word16
+pid <- Parser Word16
 aWord16
-  [Property]
-props <- ProtocolLevel -> Parser [Property]
+  [Property]
+props <- ProtocolLevel -> Parser [Property]
 parseProperties ProtocolLevel
 Protocol50
-  [UnsubStatus]
-res <- forall (m :: * -> *) a. Applicative m => Int -> m a -> m [a]
+  [UnsubStatus]
+res <- forall (m :: * -> *) a. Applicative m => Int -> m a -> m [a]
 replicateM (Int
-rl forall a. Num a => a -> a -> a
+rl forall a. Num a => a -> a -> a
 - ProtocolLevel -> [Property] -> Int
 propLen ProtocolLevel
 Protocol50 [Property]
-props forall a. Num a => a -> a -> a
+props forall a. Num a => a -> a -> a
 - Int
 2) Parser UnsubStatus
-unsubACK
+unsubACK
   forall (f :: * -> *) a. Applicative f => a -> f a
 pure forall a b. (a -> b) -> a -> b
 $ UnsubscribeResponse -> MQTTPkt
 UnsubACKPkt (Word16 -> [Property] -> [UnsubStatus] -> UnsubscribeResponse
 UnsubscribeResponse Word16
-pid [Property]
-props [UnsubStatus]
-res)
+pid [Property]
+props [UnsubStatus]
+res)
 
   where
-    unsubACK :: A.Parser UnsubStatus
-    unsubACK :: Parser UnsubStatus
-unsubACK = forall p. [(Word8, p)] -> Parser p
+    unsubACK :: A.Parser UnsubStatus
+    unsubACK :: Parser UnsubStatus
+unsubACK = forall p. [(Word8, p)] -> Parser p
 oneOf [(Word8
 0x00, UnsubStatus
 UnsubSuccess),
@@ -3377,13 +3377,13 @@
 UnsubPacketIdentifierInUse)
                      ]
 
-data AuthRequest = AuthRequest Word8 [Property] deriving (AuthRequest -> AuthRequest -> Bool
+data AuthRequest = AuthRequest Word8 [Property] deriving (AuthRequest -> AuthRequest -> Bool
 forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
 /= :: AuthRequest -> AuthRequest -> Bool
 $c/= :: AuthRequest -> AuthRequest -> Bool
 == :: AuthRequest -> AuthRequest -> Bool
 $c== :: AuthRequest -> AuthRequest -> Bool
-Eq, Int -> AuthRequest -> ShowS
+Eq, Int -> AuthRequest -> ShowS
 [AuthRequest] -> ShowS
 AuthRequest -> [Char]
 forall a.
@@ -3396,23 +3396,23 @@
 $cshowsPrec :: Int -> AuthRequest -> ShowS
 Show)
 
-instance ByteMe AuthRequest where
-  toByteString :: ProtocolLevel -> AuthRequest -> ByteString
-toByteString ProtocolLevel
-prot (AuthRequest Word8
-i [Property]
-props) =
+instance ByteMe AuthRequest where
+  toByteString :: ProtocolLevel -> AuthRequest -> ByteString
+toByteString ProtocolLevel
+prot (AuthRequest Word8
+i [Property]
+props) =
     Word8 -> ByteString
 BL.singleton Word8
 0xf0 forall a. Semigroup a => a -> a -> a
 <> ByteString -> ByteString
 withLength (Word8 -> ByteString
 BL.singleton Word8
-i forall a. Semigroup a => a -> a -> a
+i forall a. Semigroup a => a -> a -> a
 <> ProtocolLevel -> [Property] -> ByteString
 bsProps ProtocolLevel
-prot [Property]
-props)
+prot [Property]
+props)
 
 parseAuth :: A.Parser MQTTPkt
 parseAuth :: Parser MQTTPkt
@@ -3424,8 +3424,8 @@
   Int
 _ <- Parser Int
 parseHdrLen
-  AuthRequest
-r <- Word8 -> [Property] -> AuthRequest
+  AuthRequest
+r <- Word8 -> [Property] -> AuthRequest
 AuthRequest forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
 <$> Parser Word8
 A.anyWord8 forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
@@ -3436,7 +3436,7 @@
 pure forall a b. (a -> b) -> a -> b
 $ AuthRequest -> MQTTPkt
 AuthPkt AuthRequest
-r
+r
 
 data DiscoReason = DiscoNormalDisconnection
   | DiscoDisconnectWithWill
@@ -3467,7 +3467,7 @@
   | DiscoMaximumConnectTime
   | DiscoSubscriptionIdentifiersNotSupported
   | DiscoWildcardSubscriptionsNotSupported
-  deriving (Int -> DiscoReason -> ShowS
+  deriving (Int -> DiscoReason -> ShowS
 [DiscoReason] -> ShowS
 DiscoReason -> [Char]
 forall a.
@@ -3478,19 +3478,19 @@
 $cshow :: DiscoReason -> [Char]
 showsPrec :: Int -> DiscoReason -> ShowS
 $cshowsPrec :: Int -> DiscoReason -> ShowS
-Show, DiscoReason -> DiscoReason -> Bool
+Show, DiscoReason -> DiscoReason -> Bool
 forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
 /= :: DiscoReason -> DiscoReason -> Bool
 $c/= :: DiscoReason -> DiscoReason -> Bool
 == :: DiscoReason -> DiscoReason -> Bool
 $c== :: DiscoReason -> DiscoReason -> Bool
-Eq, DiscoReason
+Eq, DiscoReason
 forall a. a -> a -> Bounded a
 maxBound :: DiscoReason
 $cmaxBound :: DiscoReason
 minBound :: DiscoReason
 $cminBound :: DiscoReason
-Bounded, Int -> DiscoReason
+Bounded, Int -> DiscoReason
 DiscoReason -> Int
 DiscoReason -> [DiscoReason]
 DiscoReason -> DiscoReason
@@ -3526,8 +3526,8 @@
 
 instance ByteSize DiscoReason where
 
-  toByte :: DiscoReason -> Word8
-toByte DiscoReason
+  toByte :: DiscoReason -> Word8
+toByte DiscoReason
 DiscoNormalDisconnection                 = Word8
 0x00
   toByte DiscoReason
@@ -3615,33 +3615,33 @@
 DiscoWildcardSubscriptionsNotSupported   = Word8
 0xa2
 
-  fromByte :: Word8 -> DiscoReason
-fromByte Word8
-w = forall a. a -> Maybe a -> a
+  fromByte :: Word8 -> DiscoReason
+fromByte Word8
+w = forall a. a -> Maybe a -> a
 fromMaybe DiscoReason
 DiscoMalformedPacket forall a b. (a -> b) -> a -> b
 $ forall a b. Eq a => a -> [(a, b)] -> Maybe b
 lookup Word8
-w [(Word8, DiscoReason)]
+w [(Word8, DiscoReason)]
 discoReasonRev
 
 discoReasonRev :: [(Word8, DiscoReason)]
 discoReasonRev :: [(Word8, DiscoReason)]
 discoReasonRev = forall a b. (a -> b) -> [a] -> [b]
-map (\DiscoReason
-w -> (forall a. ByteSize a => a -> Word8
+map (\DiscoReason
+w -> (forall a. ByteSize a => a -> Word8
 toByte DiscoReason
-w, DiscoReason
-w)) [forall a. Bounded a => a
+w, DiscoReason
+w)) [forall a. Bounded a => a
 minBound..]
 
-data DisconnectRequest = DisconnectRequest DiscoReason [Property] deriving (DisconnectRequest -> DisconnectRequest -> Bool
+data DisconnectRequest = DisconnectRequest DiscoReason [Property] deriving (DisconnectRequest -> DisconnectRequest -> Bool
 forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
 /= :: DisconnectRequest -> DisconnectRequest -> Bool
 $c/= :: DisconnectRequest -> DisconnectRequest -> Bool
 == :: DisconnectRequest -> DisconnectRequest -> Bool
 $c== :: DisconnectRequest -> DisconnectRequest -> Bool
-Eq, Int -> DisconnectRequest -> ShowS
+Eq, Int -> DisconnectRequest -> ShowS
 [DisconnectRequest] -> ShowS
 DisconnectRequest -> [Char]
 forall a.
@@ -3654,17 +3654,17 @@
 $cshowsPrec :: Int -> DisconnectRequest -> ShowS
 Show)
 
-instance ByteMe DisconnectRequest where
-  toByteString :: ProtocolLevel -> DisconnectRequest -> ByteString
-toByteString ProtocolLevel
+instance ByteMe DisconnectRequest where
+  toByteString :: ProtocolLevel -> DisconnectRequest -> ByteString
+toByteString ProtocolLevel
 Protocol311 DisconnectRequest
 _ = ByteString
 "\224\NUL"
 
   toByteString ProtocolLevel
-Protocol50 (DisconnectRequest DiscoReason
-r [Property]
-props) =
+Protocol50 (DisconnectRequest DiscoReason
+r [Property]
+props) =
     Word8 -> ByteString
 BL.singleton Word8
 0xe0 forall a. Semigroup a => a -> a -> a
@@ -3672,18 +3672,18 @@
 withLength (Word8 -> ByteString
 BL.singleton (forall a. ByteSize a => a -> Word8
 toByte DiscoReason
-r) forall a. Semigroup a => a -> a -> a
+r) forall a. Semigroup a => a -> a -> a
 <> ProtocolLevel -> [Property] -> ByteString
 bsProps ProtocolLevel
 Protocol50 [Property]
-props)
+props)
 
 parseDisconnect :: ProtocolLevel -> A.Parser MQTTPkt
 parseDisconnect :: ProtocolLevel -> Parser MQTTPkt
 parseDisconnect ProtocolLevel
 Protocol311 = do
-  DisconnectRequest
-req <- DiscoReason -> [Property] -> DisconnectRequest
+  DisconnectRequest
+req <- DiscoReason -> [Property] -> DisconnectRequest
 DisconnectRequest DiscoReason
 DiscoNormalDisconnection forall a. Monoid a => a
 mempty forall (f :: * -> *) a b. Functor f => a -> f b -> f a
@@ -3694,7 +3694,7 @@
 pure forall a b. (a -> b) -> a -> b
 $ DisconnectRequest -> MQTTPkt
 DisconnectPkt DisconnectRequest
-req
+req
 
 parseDisconnect ProtocolLevel
 Protocol50 = do
@@ -3702,15 +3702,15 @@
 _ <- Word8 -> Parser Word8
 A.word8 Word8
 0xe0
-  Int
-rl <- Parser Int
+  Int
+rl <- Parser Int
 parseHdrLen
-  Word8
-r <- Parser Word8
+  Word8
+r <- Parser Word8
 A.anyWord8
-  [Property]
-props <- if Int
-rl forall a. Ord a => a -> a -> Bool
+  [Property]
+props <- if Int
+rl forall a. Ord a => a -> a -> Bool
 > Int
 1 then ProtocolLevel -> Parser [Property]
 parseProperties ProtocolLevel
@@ -3724,6 +3724,6 @@
 DisconnectPkt (DiscoReason -> [Property] -> DisconnectRequest
 DisconnectRequest (forall a. ByteSize a => Word8 -> a
 fromByte Word8
-r) [Property]
-props)
+r) [Property]
+props)
 
\ No newline at end of file diff --git a/src/Paths_net_mqtt.html b/src/Paths_net_mqtt.html index 1ad7be1..6341b61 100644 --- a/src/Paths_net_mqtt.html +++ b/src/Paths_net_mqtt.html @@ -19,7 +19,7 @@ #if defined(VERSION_base)
#if MIN_VERSION_base(4,0,0) -catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a +catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a #else catchIO :: IO a -> (Exception.Exception -> IO a) -> IO a #endif @@ -42,16 +42,16 @@ getDataFileName :: FilePath -> IO FilePath getDataFileName :: String -> IO String -getDataFileName String -name = do - String -dir <- IO String +getDataFileName String +name = do + String +dir <- IO String getDataDir forall (m :: * -> *) a. Monad m => a -> m a return (String -dir String -> String -> String +dir String -> String -> String `joinFileName` String -name) +name) getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir, getSysconfDir :: IO FilePath @@ -132,34 +132,34 @@ joinFileName :: String -> String -> FilePath joinFileName :: String -> String -> String joinFileName String -"" String -fname = String -fname +"" String +fname = String +fname joinFileName String -"." String -fname = String -fname -joinFileName String -dir String +"." String +fname = String +fname +joinFileName String +dir String "" = String -dir -joinFileName String -dir String -fname +dir +joinFileName String +dir String +fname | Char -> Bool isPathSeparator (forall a. [a] -> a List.last String -dir) = String -dir forall a. [a] -> [a] -> [a] +dir) = String +dir forall a. [a] -> [a] -> [a] ++ String -fname +fname | Bool otherwise = String -dir forall a. [a] -> [a] -> [a] +dir forall a. [a] -> [a] -> [a] ++ Char pathSeparator forall a. a -> [a] -> [a] : String -fname +fname pathSeparator :: Char pathSeparator :: Char @@ -168,9 +168,9 @@ isPathSeparator :: Char -> Bool isPathSeparator :: Char -> Bool -isPathSeparator Char -c = Char -c forall a. Eq a => a -> a -> Bool +isPathSeparator Char +c = Char +c forall a. Eq a => a -> a -> Bool == Char '/'
\ No newline at end of file