(;module:
lux
(lux (control monad)
(data text/format)
[meta #+ Monad "Meta/" Monad])
(luxc ["&" base]
(lang ["la" analysis]
["ls" synthesis])
["&;" analyser]
["&;" synthesizer]
(generator ["&;" common]
(host ["$" jvm]
(jvm ["$i" inst]
["$t" type]))))
[../runtime])
(def: #export generate-unit
(Meta $;Inst)
(Meta/wrap ($i;string ../runtime;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]
)