ble-0.1.3.0: Bluetooth Low Energy (BLE) peripherals

Safe HaskellNone
LanguageHaskell2010

Bluetooth.Internal.Errors

Synopsis

Documentation

newtype Handler errs a Source #

Constructors

Handler 

Instances

Monad (Handler errs) Source # 

Methods

(>>=) :: Handler errs a -> (a -> Handler errs b) -> Handler errs b #

(>>) :: Handler errs a -> Handler errs b -> Handler errs b #

return :: a -> Handler errs a #

fail :: String -> Handler errs a #

Functor (Handler errs) Source # 

Methods

fmap :: (a -> b) -> Handler errs a -> Handler errs b #

(<$) :: a -> Handler errs b -> Handler errs a #

Applicative (Handler errs) Source # 

Methods

pure :: a -> Handler errs a #

(<*>) :: Handler errs (a -> b) -> Handler errs a -> Handler errs b #

(*>) :: Handler errs a -> Handler errs b -> Handler errs b #

(<*) :: Handler errs a -> Handler errs b -> Handler errs a #

MonadIO (Handler errs) Source # 

Methods

liftIO :: IO a -> Handler errs a #

IsElem ((* -> *) -> Constraint) (ThrowsInvalidValueLength *) errs => ThrowsInvalidValueLength * (Handler errs) Source # 
IsElem ((* -> *) -> Constraint) (ThrowsNotSupported *) errs => ThrowsNotSupported * (Handler errs) Source # 

Methods

errNotSupported :: m a Source #

IsElem ((* -> *) -> Constraint) (ThrowsNotAuthorized *) errs => ThrowsNotAuthorized * (Handler errs) Source # 

Methods

errNotAuthorized :: m a Source #

IsElem ((* -> *) -> Constraint) (ThrowsNotPermitted *) errs => ThrowsNotPermitted * (Handler errs) Source # 

Methods

errNotPermitted :: m a Source #

IsElem ((* -> *) -> Constraint) (ThrowsInProgress *) errs => ThrowsInProgress * (Handler errs) Source # 

Methods

errInProgress :: m a Source #

IsElem ((* -> *) -> Constraint) (ThrowsFailed *) errs => ThrowsFailed * (Handler errs) Source # 

Methods

errFailed :: m a Source #

HasWriteValue (Characteristic typ0) (Maybe (typ0 -> WriteValueM Bool)) Source # 
HasReadValue (Characteristic typ0) (Maybe (ReadValueM typ0)) Source # 

type family IsElem (x :: k) (list :: [k]) :: Constraint where ... Source #

Asserts that an error type is an element of a list.

example :: ThrowsFailed `IsElem` errs => Handler errs ()
example
 = errFailed "Every attempt is a wholly new start, and a different kind of failure"

Since: 0.1.2.0

Equations

IsElem x (x ': xs) = () 
IsElem x (y ': xs) = IsElem x xs 

class ThrowsFailed m where Source #

Minimal complete definition

errFailed

Methods

errFailed :: m a Source #

class ThrowsInProgress m where Source #

Minimal complete definition

errInProgress

Methods

errInProgress :: m a Source #

class ThrowsNotPermitted m where Source #

Minimal complete definition

errNotPermitted

Methods

errNotPermitted :: m a Source #

class ThrowsNotSupported m where Source #

Minimal complete definition

errNotSupported

Methods

errNotSupported :: m a Source #