Created
December 15, 2012 07:58
-
-
Save metametaclass/4292029 to your computer and use it in GitHub Desktop.
haskell hardware interaction pseudocode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main = do dataFromHW <- readSerialPort | |
dataFromUser <- readUIInput | |
(answerForDevice, answerForUser) <- goodProcessingFunction dataFromHW dataFromUser | |
writeSerialPort deviceAnswer | |
writeUIOutput answerForUser | |
case processResult answerForUser of | |
EOF -> return 0 | |
Error i -> return i | |
Continue -> main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
writeSerialPort deviceAnswer
->writeSerialPort answerForDevice