Skip to content

Instantly share code, notes, and snippets.

@metametaclass
Created December 15, 2012 07:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save metametaclass/4292029 to your computer and use it in GitHub Desktop.
Save metametaclass/4292029 to your computer and use it in GitHub Desktop.
haskell hardware interaction pseudocode
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
@b0oh
Copy link

b0oh commented Dec 16, 2012

writeSerialPort deviceAnswer -> writeSerialPort answerForDevice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment