kafka-device-0.2.1.2: UI device events via a Kafka message broker

Copyright(c) 2016-17 Brian W Bush
LicenseMIT
MaintainerBrian W Bush <consult@brianwbush.info>
StabilityExperimental
PortabilityStable
Safe HaskellNone
LanguageHaskell2010

Network.UI.Kafka.Interpretation

Contents

Description

Interpret user-interfaces events on Kafka topics.

Synopsis

Types

data Interpretation a b Source #

Instructions for interpreting user-interface events from Kafka.

Constructors

TrackInterpretation 

Fields

Instances

(Eq b, Eq a) => Eq (Interpretation a b) Source # 
(Read b, Read a) => Read (Interpretation a b) Source # 
(Show b, Show a) => Show (Interpretation a b) Source # 
Generic (Interpretation a b) Source # 

Associated Types

type Rep (Interpretation a b) :: * -> * #

Methods

from :: Interpretation a b -> Rep (Interpretation a b) x #

to :: Rep (Interpretation a b) x -> Interpretation a b #

(ToJSON a, ToJSON b) => ToJSON (Interpretation a b) Source # 
(FromJSON a, FromJSON b) => FromJSON (Interpretation a b) Source # 
type Rep (Interpretation a b) Source # 
type Rep (Interpretation a b) = D1 (MetaData "Interpretation" "Network.UI.Kafka.Interpretation" "kafka-device-0.2.1.2-FIEk9IM9sj5DFKHOeaqwhc" False) (C1 (MetaCons "TrackInterpretation" PrefixI True) ((:*:) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "kafka") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 TopicConnection)) ((:*:) (S1 (MetaSel (Just Symbol "sensor") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Sensor)) (S1 (MetaSel (Just Symbol "device") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))) ((:*:) (S1 (MetaSel (Just Symbol "xAxis") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (AxisInterpretation b))) ((:*:) (S1 (MetaSel (Just Symbol "yAxis") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (AxisInterpretation b))) (S1 (MetaSel (Just Symbol "zAxis") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (AxisInterpretation b)))))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "phiAxis") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (AxisInterpretation b))) ((:*:) (S1 (MetaSel (Just Symbol "thetaAxis") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (AxisInterpretation b))) (S1 (MetaSel (Just Symbol "psiAxis") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (AxisInterpretation b))))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "location") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (V3 b))) (S1 (MetaSel (Just Symbol "orientation") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (V3 b)))) ((:*:) (S1 (MetaSel (Just Symbol "flying") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool)) (S1 (MetaSel (Just Symbol "resetButton") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Int))))))))

data AxisInterpretation a Source #

Instructions for interpreting an axis.

Constructors

AxisInterpretation 

Fields

Instances

Eq a => Eq (AxisInterpretation a) Source # 
Read a => Read (AxisInterpretation a) Source # 
Show a => Show (AxisInterpretation a) Source # 
Generic (AxisInterpretation a) Source # 

Associated Types

type Rep (AxisInterpretation a) :: * -> * #

ToJSON a => ToJSON (AxisInterpretation a) Source # 
FromJSON a => FromJSON (AxisInterpretation a) Source # 
type Rep (AxisInterpretation a) Source # 
type Rep (AxisInterpretation a) = D1 (MetaData "AxisInterpretation" "Network.UI.Kafka.Interpretation" "kafka-device-0.2.1.2-FIEk9IM9sj5DFKHOeaqwhc" False) (C1 (MetaCons "AxisInterpretation" PrefixI True) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "axisNumber") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int)) (S1 (MetaSel (Just Symbol "threshold") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe a)))) ((:*:) (S1 (MetaSel (Just Symbol "increment") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)) ((:*:) (S1 (MetaSel (Just Symbol "lowerBound") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe a))) (S1 (MetaSel (Just Symbol "upperBound") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe a)))))))

type AnalogHandler a b Source #

Arguments

 = b

The raw event.

-> Maybe (Int, a)

The axis number and value.

How to handle raw analog events.

type ButtonHandler a b Source #

Arguments

 = b

The raw event.

-> Maybe (Int, Bool)

The button number and whether the button is depressed.

How to handle raw button events.

Event handling

interpretationLoop Source #

Arguments

:: (Conjugate b, Epsilon b, Num b, Ord b, RealFloat b) 
=> AnalogHandler b c

How to handle raw analog events.

-> ButtonHandler b c

How to handle raw button events.

-> Interpretation a b

The interpretation.

-> IO c

Action for getting the next raw event.

-> IO (ExitAction, LoopAction)

Action to create the exit and loop actions.

Repeatedly interpret events.

Orphan instances