diff options
Diffstat (limited to 'assignment-13/uFPL/Bootstrap.icl')
-rw-r--r-- | assignment-13/uFPL/Bootstrap.icl | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/assignment-13/uFPL/Bootstrap.icl b/assignment-13/uFPL/Bootstrap.icl index b0ccf66..1ca75ac 100644 --- a/assignment-13/uFPL/Bootstrap.icl +++ b/assignment-13/uFPL/Bootstrap.icl @@ -1,10 +1,12 @@ implementation module uFPL.Bootstrap -from StdFunc import const +from StdFunc import const, o import StdGeneric from StdMisc import undef import StdString +from Data.Func import $ + import uFPL.Arduino import uFPL.C import uFPL @@ -72,6 +74,19 @@ false = lit False true :: Expr Bool RO true = lit True +predefShares :: Shares +predefShares + = share b0 + $ share b1 + $ share b2 + $ share b3 + $ share b4 + $ share millis + NoShares +where + share :: ((Expr t rw) Shares -> Shares) | Expr t + share = Shares o (\(EShared s) -> s) + rts :: String rts = "#include <LiquidCrystal.h>" +: @@ -117,4 +132,4 @@ where " return 0;" +: "}" -instance zero CProg where zero = {bootstrap=rts, globals=[], funs=[]} +instance zero CProg where zero = {bootstrap=rts, globals=sharesMap gen predefShares, funs=[]} |