Skip to content

Instantly share code, notes, and snippets.

@leepike
Created December 9, 2015 14:24
Show Gist options
  • Save leepike/e7d09ed02e294912dda8 to your computer and use it in GitHub Desktop.
Save leepike/e7d09ed02e294912dda8 to your computer and use it in GitHub Desktop.
module Lib where
import Control.Monad
import Language.Atom -- (bool, value, atom, E, Atom)
import Language.Atom.Elaboration (StateHierarchy(..))
genAtom :: IO ()
genAtom = do
let config = defaults --{ cRuleCoverage = False }
(schedule, _, names1, names2, nameTypeList)
<- compile "myAtom" config myAtom
-- putStrLn $ reportSchedule schedule
let hier = StateHierarchy "hier" []
rules = []
config' = config { cCode = \ _ _ _ -> ("#include \"myAtom.h\"","") }
_ <- writeC "main" config' hier rules schedule names1 names2 nameTypeList
return ()
myAtom = atom "myAtom" $ do
clutchCommand <- bool "clutchCommand" False
cutchFeedback <- bool "cutchFeedback" False
failedToDisengage (value cutchFeedback) (value clutchCommand)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment