frp-arduino-0.1.0.1: Arduino programming without the hassle of C.

Safe HaskellSafe-Inferred
LanguageHaskell2010

Arduino.DSL

Contents

Synopsis

Core

type Action a = State DAGState a Source

data Stream a Source

data Output a Source

data LLI a Source

(=:) :: Output a -> Stream a -> Action () infixr 0 Source

foo :: Output a -> (Stream b -> Stream a) -> Output b Source

Expressions

data Expression a Source

Instances

Bits

data Bit Source

Instances

Bytes

Words

Byte arrays

Tuples

pack2 :: (Expression a1, Expression a2) -> Expression (a1, a2) Source

pack6 :: (Expression a1, Expression a2, Expression a3, Expression a4, Expression a5, Expression a6) -> Expression (a1, a2, a3, a4, a5, a6) Source

unpack6 :: Expression (a1, a2, a3, a4, a5, a6) -> (Expression a1, Expression a2, Expression a3, Expression a4, Expression a5, Expression a6) Source

pack2Output :: Output a1 -> Output a2 -> Output (a1, a2) Source

pack6Output :: Output a1 -> Output a2 -> Output a3 -> Output a4 -> Output a5 -> Output a6 -> Output (a1, a2, a3, a4, a5, a6) Source

Conditionals

Streams

Mapping

mapSMany :: (Expression a -> [Expression b]) -> Stream a -> Stream b Source

Contrast with flattenS.

Filtering

Folding

Flattering

flattenS :: Stream [a] -> Stream a Source

Contrast with mapSMany.

Delaying

delay :: Stream (a, Word) -> Stream a Source

Needs a tuple created with pack2.

Syntactic sugar

(~>) :: Stream a -> (Stream a -> Stream b) -> Stream b Source

Low Level Instructions (LLI)

The glue between streams and harware.

createOutput :: String -> LLI () -> (LLI a -> LLI ()) -> Output a Source

createInput :: String -> LLI () -> LLI a -> Stream a Source

setBit :: String -> String -> LLI a -> LLI a Source

writeBit :: String -> String -> LLI a -> LLI b -> LLI b Source

end :: LLI () Source