Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
- type Action a = State DAGState a
- data Stream a
- data Output a
- data LLI a
- compileProgram :: Action a -> IO ()
- parseProgram :: Action a -> Either [String] Streams
- def :: Stream a -> Action (Stream a)
- (=:) :: Output a -> Stream a -> Action ()
- prefixOutput :: (Stream b -> Stream a) -> Output a -> Output b
- bootup :: Stream ()
- constStream :: Expression a -> Stream a
- 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)
- output2 :: Output a1 -> Output a2 -> Output (a1, a2)
- output6 :: Output a1 -> Output a2 -> Output a3 -> Output a4 -> Output a5 -> Output a6 -> Output (a1, a2, a3, a4, a5, a6)
- unit :: Expression ()
- isEqual :: Expression a -> Expression a -> Expression Bool
- 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
- mergeS :: [Stream a] -> Stream a
- 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
- readTwoPartWord :: String -> String -> LLI a -> LLI Word
- waitBitSet :: String -> String -> LLI a -> LLI a
- waitBitCleared :: String -> String -> LLI a -> LLI a
- byteConstant :: Byte -> LLI Byte
- wordConstant :: Word -> LLI Word
- end :: LLI ()
Core
compileProgram :: Action a -> IO () Source #
constStream :: Expression a -> Stream a Source #
Expressions
data Expression a Source #
Num (Expression a) Source # | |
Bits
bitHigh :: Expression Bit Source #
bitLow :: Expression Bit Source #
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 #
output6 :: Output a1 -> Output a2 -> Output a3 -> Output a4 -> Output a5 -> Output a6 -> Output (a1, a2, a3, a4, a5, a6) Source #
Misc
unit :: Expression () Source #
isEqual :: Expression a -> Expression a -> Expression Bool Source #
Conditionals
if_ :: Expression Bool -> Expression a -> Expression a -> Expression a Source #
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
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.