Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
- type Action a = State DAGState a
- data Stream a
- data Output a
- data LLI a
- compileProgram :: Action a -> IO ()
- def :: Stream a -> Action (Stream a)
- (=:) :: Output a -> Stream a -> Action ()
- foo :: Output a -> (Stream b -> Stream a) -> Output b
- data Expression a
- data Bit
- bitHigh :: Expression Bit
- bitLow :: Expression Bit
- flipBit :: Expression Bit -> Expression Bit
- isHigh :: Expression Bit -> Expression Bool
- boolToBit :: Expression Bool -> Expression Bit
- type Byte = Word8
- type Word = Word16
- isEven :: Expression Word -> Expression Bool
- greater :: Expression Word -> Expression Word -> Expression Bool
- formatString :: String -> Expression [Byte]
- formatNumber :: Expression Word -> Expression [Byte]
- pack2 :: (Expression a1, Expression a2) -> Expression (a1, a2)
- pack6 :: (Expression a1, Expression a2, Expression a3, Expression a4, Expression a5, Expression a6) -> Expression (a1, a2, a3, a4, a5, a6)
- unpack2 :: Expression (a1, a2) -> (Expression a1, Expression a2)
- unpack6 :: Expression (a1, a2, a3, a4, a5, a6) -> (Expression a1, Expression a2, Expression a3, Expression a4, Expression a5, Expression a6)
- pack2Output :: Output a1 -> Output a2 -> Output (a1, a2)
- pack6Output :: Output a1 -> Output a2 -> Output a3 -> Output a4 -> Output a5 -> Output a6 -> Output (a1, a2, a3, a4, a5, a6)
- if_ :: Expression Bool -> Expression a -> Expression a -> Expression a
- mapS :: (Expression a -> Expression b) -> Stream a -> Stream b
- mapSMany :: (Expression a -> [Expression b]) -> Stream a -> Stream b
- mapS2 :: (Expression a -> Expression b -> Expression c) -> Stream a -> Stream b -> Stream c
- filterS :: (Expression a -> Expression Bool) -> Stream a -> Stream a
- foldpS :: (Expression a -> Expression b -> Expression b) -> Expression b -> Stream a -> Stream b
- flattenS :: Stream [a] -> Stream a
- delay :: Stream (a, Word) -> Stream a
- (~>) :: Stream a -> (Stream a -> Stream b) -> Stream b
- createOutput :: String -> LLI () -> (LLI a -> LLI ()) -> Output a
- createInput :: String -> LLI () -> LLI a -> Stream a
- setBit :: String -> String -> LLI a -> LLI a
- clearBit :: String -> String -> LLI a -> LLI a
- writeBit :: String -> String -> LLI a -> LLI b -> LLI b
- writeByte :: String -> LLI Byte -> LLI a -> LLI a
- writeWord :: String -> LLI Word -> LLI a -> LLI a
- readBit :: String -> String -> LLI Bit
- readWord :: String -> LLI a -> LLI Word
- waitBitSet :: String -> String -> LLI a -> LLI a
- byteConstant :: Byte -> LLI Byte
- wordConstant :: Word -> LLI Word
- end :: LLI ()
Core
compileProgram :: Action a -> IO () Source
Expressions
data Expression a Source
Num (Expression a) |
Bits
flipBit :: Expression Bit -> Expression Bit Source
isHigh :: Expression Bit -> Expression Bool Source
boolToBit :: Expression Bool -> Expression Bit Source
Bytes
Words
isEven :: Expression Word -> Expression Bool Source
greater :: Expression Word -> Expression Word -> Expression Bool Source
Byte arrays
formatString :: String -> Expression [Byte] Source
formatNumber :: Expression Word -> Expression [Byte] Source
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
unpack2 :: Expression (a1, a2) -> (Expression a1, Expression a2) 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
if_ :: Expression Bool -> Expression a -> Expression a -> Expression a Source
Streams
Mapping
mapS :: (Expression a -> Expression b) -> Stream a -> Stream b Source
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
Filtering
filterS :: (Expression a -> Expression Bool) -> Stream a -> Stream a Source
Folding
foldpS :: (Expression a -> Expression b -> Expression b) -> Expression b -> Stream a -> Stream b Source
Flattering
Delaying
Syntactic sugar
Low Level Instructions (LLI)
The glue between streams and harware.
byteConstant :: Byte -> LLI Byte Source
wordConstant :: Word -> LLI Word Source