hocd-0.1.0.0: OpenOCD Haskell interface
Safe HaskellSafe-Inferred
LanguageHaskell2010

HOCD.Monad

Synopsis

Documentation

data OCDT m a Source #

Instances

Instances details
MonadTrans OCDT Source # 
Instance details

Defined in HOCD.Monad

Methods

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

Monad m => MonadError OCDError (OCDT m) Source # 
Instance details

Defined in HOCD.Monad

Methods

throwError :: OCDError -> OCDT m a #

catchError :: OCDT m a -> (OCDError -> OCDT m a) -> OCDT m a #

Monad m => MonadReader Socket (OCDT m) Source # 
Instance details

Defined in HOCD.Monad

Methods

ask :: OCDT m Socket #

local :: (Socket -> Socket) -> OCDT m a -> OCDT m a #

reader :: (Socket -> a) -> OCDT m a #

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

Defined in HOCD.Monad

Methods

liftIO :: IO a -> OCDT m a #

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

Defined in HOCD.Monad

Methods

pure :: a -> OCDT m a #

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

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

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

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

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

Defined in HOCD.Monad

Methods

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

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

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

Defined in HOCD.Monad

Methods

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

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

return :: a -> OCDT m a #

MonadCatch m => MonadCatch (OCDT m) Source # 
Instance details

Defined in HOCD.Monad

Methods

catch :: Exception e => OCDT m a -> (e -> OCDT m a) -> OCDT m a #

MonadMask m => MonadMask (OCDT m) Source # 
Instance details

Defined in HOCD.Monad

Methods

mask :: ((forall a. OCDT m a -> OCDT m a) -> OCDT m b) -> OCDT m b #

uninterruptibleMask :: ((forall a. OCDT m a -> OCDT m a) -> OCDT m b) -> OCDT m b #

generalBracket :: OCDT m a -> (a -> ExitCase b -> OCDT m c) -> (a -> OCDT m b) -> OCDT m (b, c) #

MonadThrow m => MonadThrow (OCDT m) Source # 
Instance details

Defined in HOCD.Monad

Methods

throwM :: Exception e => e -> OCDT m a #

MonadIO m => MonadOCD (OCDT m) Source # 
Instance details

Defined in HOCD.Monad

runOCDT :: Monad m => Socket -> OCDT m a -> m (Either OCDError a) Source #

Run OCDT transformer

class (MonadIO m, MonadError OCDError m) => MonadOCD m where Source #

Methods

getSocket :: m Socket Source #

Instances

Instances details
MonadIO m => MonadOCD (OCDT m) Source # 
Instance details

Defined in HOCD.Monad

halt :: MonadOCD m => m ByteString Source #

Halt target

halt' :: MonadOCD m => m () Source #

Halt target, discarding reply

readMem Source #

Arguments

:: forall a m. (MonadOCD m, FiniteBits a, Integral a) 
=> MemAddress

Memory address to read from

-> m a 

Read single memory segment from MemAddress Segment size depends on passed in Word type.

readMem32 Source #

Arguments

:: MonadOCD m 
=> MemAddress

Memory address to read from

-> m Word32 

Shorthand for reading Word32 sized segment

readMemCount Source #

Arguments

:: forall a m. (MonadOCD m, FiniteBits a, Integral a) 
=> MemAddress

Memory address to read from

-> Int

Count

-> m [a] 

Read multiple memory segments from MemAddress according to count argument. Segment size depends on passed in Word type.

writeMem Source #

Arguments

:: forall a m. (MonadOCD m, FiniteBits a, PrintfArg a, Integral a) 
=> MemAddress

Memory address to write to

-> [a]

Data to write

-> m () 

Write multiple memory segments to MemAddress

writeMem32 Source #

Arguments

:: MonadOCD m 
=> MemAddress

Memory address to write to

-> [Word32]

Data to write

-> m () 

Shorthand for writing Word32 sized segment