lifx-lan-0.8.3: LIFX LAN API
Safe HaskellSafe-Inferred
LanguageHaskell2010

Lifx.Lan.Internal

Synopsis

Documentation

newtype Device Source #

A LIFX device, such as a bulb.

Constructors

Device 

Fields

Instances

Instances details
Show Device Source # 
Instance details

Defined in Lifx.Lan.Internal

Eq Device Source # 
Instance details

Defined in Lifx.Lan.Internal

Methods

(==) :: Device -> Device -> Bool #

(/=) :: Device -> Device -> Bool #

Ord Device Source # 
Instance details

Defined in Lifx.Lan.Internal

data HSBK Source #

Constructors

HSBK 

Fields

Instances

Instances details
Generic HSBK Source # 
Instance details

Defined in Lifx.Lan.Internal

Associated Types

type Rep HSBK :: Type -> Type #

Methods

from :: HSBK -> Rep HSBK x #

to :: Rep HSBK x -> HSBK #

Show HSBK Source # 
Instance details

Defined in Lifx.Lan.Internal

Methods

showsPrec :: Int -> HSBK -> ShowS #

show :: HSBK -> String #

showList :: [HSBK] -> ShowS #

Eq HSBK Source # 
Instance details

Defined in Lifx.Lan.Internal

Methods

(==) :: HSBK -> HSBK -> Bool #

(/=) :: HSBK -> HSBK -> Bool #

Ord HSBK Source # 
Instance details

Defined in Lifx.Lan.Internal

Methods

compare :: HSBK -> HSBK -> Ordering #

(<) :: HSBK -> HSBK -> Bool #

(<=) :: HSBK -> HSBK -> Bool #

(>) :: HSBK -> HSBK -> Bool #

(>=) :: HSBK -> HSBK -> Bool #

max :: HSBK -> HSBK -> HSBK #

min :: HSBK -> HSBK -> HSBK #

type Rep HSBK Source # 
Instance details

Defined in Lifx.Lan.Internal

data LifxError Source #

Instances

Instances details
Generic LifxError Source # 
Instance details

Defined in Lifx.Lan.Internal

Associated Types

type Rep LifxError :: Type -> Type #

Show LifxError Source # 
Instance details

Defined in Lifx.Lan.Internal

Eq LifxError Source # 
Instance details

Defined in Lifx.Lan.Internal

Ord LifxError Source # 
Instance details

Defined in Lifx.Lan.Internal

MonadError e m => MonadError (Either e LifxError) (LifxT m) Source # 
Instance details

Defined in Lifx.Lan.Internal

Methods

throwError :: Either e LifxError -> LifxT m a #

catchError :: LifxT m a -> (Either e LifxError -> LifxT m a) -> LifxT m a #

type Rep LifxError Source # 
Instance details

Defined in Lifx.Lan.Internal

type Rep LifxError = D1 ('MetaData "LifxError" "Lifx.Lan.Internal" "lifx-lan-0.8.3-30j063vj3wPEAgIf7LzxCG" 'False) (((C1 ('MetaCons "DecodeFailure" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteOffset) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String))) :+: C1 ('MetaCons "RecvTimeout" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "BroadcastTimeout" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [HostAddress])) :+: C1 ('MetaCons "WrongPacketType" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word16) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word16)))) :+: ((C1 ('MetaCons "WrongSender" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Device) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 HostAddress)) :+: C1 ('MetaCons "UnexpectedSockAddrType" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SockAddr))) :+: (C1 ('MetaCons "UnexpectedPort" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PortNumber)) :+: C1 ('MetaCons "ProductLookupError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ProductLookupError)))))

class MonadIO m => MonadLifxIO m where Source #

A monad for sending and receiving LIFX messages.

Methods

getSocket :: m Socket Source #

getSource :: m Word32 Source #

getTimeout :: m Int Source #

incrementCounter :: m () Source #

getCounter :: m Word8 Source #

lifxThrowIO :: LifxError -> m a Source #

handleOldMessage Source #

Arguments

:: Word8

expected counter value

-> Word8

actual counter value

-> Word16

packet type

-> ByteString

payload

-> m () 

newtype LifxT m a Source #

Constructors

LifxT 

Instances

Instances details
MonadTrans LifxT Source # 
Instance details

Defined in Lifx.Lan.Internal

Methods

lift :: Monad m => m a -> LifxT m a #

MonadReader s m => MonadReader s (LifxT m) Source # 
Instance details

Defined in Lifx.Lan.Internal

Methods

ask :: LifxT m s #

local :: (s -> s) -> LifxT m a -> LifxT m a #

reader :: (s -> a) -> LifxT m a #

MonadState s m => MonadState s (LifxT m) Source # 
Instance details

Defined in Lifx.Lan.Internal

Methods

get :: LifxT m s #

put :: s -> LifxT m () #

state :: (s -> (a, s)) -> LifxT m a #

MonadIO m => MonadIO (LifxT m) Source # 
Instance details

Defined in Lifx.Lan.Internal

Methods

liftIO :: IO a -> LifxT m a #

Monad m => Applicative (LifxT m) Source # 
Instance details

Defined in Lifx.Lan.Internal

Methods

pure :: a -> LifxT m a #

(<*>) :: LifxT m (a -> b) -> LifxT m a -> LifxT m b #

liftA2 :: (a -> b -> c) -> LifxT m a -> LifxT m b -> LifxT m c #

(*>) :: LifxT m a -> LifxT m b -> LifxT m b #

(<*) :: LifxT m a -> LifxT m b -> LifxT m a #

Functor m => Functor (LifxT m) Source # 
Instance details

Defined in Lifx.Lan.Internal

Methods

fmap :: (a -> b) -> LifxT m a -> LifxT m b #

(<$) :: a -> LifxT m b -> LifxT m a #

Monad m => Monad (LifxT m) Source # 
Instance details

Defined in Lifx.Lan.Internal

Methods

(>>=) :: LifxT m a -> (a -> LifxT m b) -> LifxT m b #

(>>) :: LifxT m a -> LifxT m b -> LifxT m b #

return :: a -> LifxT m a #

MonadIO m => MonadLifx (LifxT m) Source # 
Instance details

Defined in Lifx.Lan

Associated Types

type MonadLifxError (LifxT m) Source #

MonadIO m => MonadLifxIO (LifxT m) Source # 
Instance details

Defined in Lifx.Lan.Internal

MonadError e m => MonadError (Either e LifxError) (LifxT m) Source # 
Instance details

Defined in Lifx.Lan.Internal

Methods

throwError :: Either e LifxError -> LifxT m a #

catchError :: LifxT m a -> (Either e LifxError -> LifxT m a) -> LifxT m a #

type MonadLifxError (LifxT m) Source # 
Instance details

Defined in Lifx.Lan

unLifx :: (Socket, Word32, Int) -> Word8 -> LifxT m a -> m (Either LifxError (a, Word8)) Source #

succ' :: (Eq a, Bounded a, Enum a) => a -> a Source #

Safe, wraparound variant of succ.