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

Safe HaskellSafe
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 #

Expressions

Bits

data Bit Source #

Instances

Eq Bit Source # 

Methods

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

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

Show Bit Source # 

Methods

showsPrec :: Int -> Bit -> ShowS #

show :: Bit -> String #

showList :: [Bit] -> ShowS #

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 #

output2 :: Output a1 -> Output a2 -> Output (a1, a2) Source #

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

Misc

Conditionals

Streams

Mapping

mapS :: (Expression a -> Expression b) -> Stream a -> Stream b Source #

Similar to map in Haskell. "S" is for stream.

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

Contrast with flattenS.

mapS2 :: (Expression a -> Expression b -> Expression c) -> Stream a -> Stream b -> Stream c Source #

Merging

Filtering

Folding

foldpS :: (Expression a -> Expression b -> Expression b) -> Expression b -> Stream a -> Stream b Source #

Similar to fold in Haskell. "S" is for stream.

Inspired by Elm's foldp.

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 #

clearBit :: String -> String -> LLI a -> LLI a Source #

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

end :: LLI () Source #