(;module:
lux
(lux (control monad)
(data text/format)
[meta "meta/" Monad])
(luxc ["&" base]
[";L" host]
(host ["$" jvm]
(jvm ["$i" inst]
["$t" type]))
(lang ["la" analysis]
["ls" synthesis]
(translation [";T" common])))
[../runtime])
(def: #export generate-unit
(Meta $;Inst)
(meta/wrap ($i;string hostL;unit)))
(def: #export (generate-bool value)
(-> Bool (Meta $;Inst))
(meta/wrap ($i;GETSTATIC "java.lang.Boolean"
(if value "TRUE" "FALSE")
($t;class "java.lang.Boolean" (list)))))
(do-template [ ]
[(def: #export ( value)
(-> (Meta $;Inst))
(meta/wrap (|>. ( value) )))]
[generate-nat Nat (|>. (:! Int) $i;long) ($i;wrap #$;Long)]
[generate-int Int $i;long ($i;wrap #$;Long)]
[generate-deg Deg (|>. (:! Int) $i;long) ($i;wrap #$;Long)]
[generate-frac Frac $i;double ($i;wrap #$;Double)]
[generate-text Text $i;string id]
)