(.module: [lux #* [abstract ["." monad (#+ do)]] [host ["_" scheme (#+ Expression)]]] [// ["." runtime (#+ Operation Phase)] ["." primitive] ["." /// [// [analysis (#+ Variant Tuple)] ["." synthesis (#+ Synthesis)]]]]) (def: #export (tuple generate elemsS+) (-> Phase (Tuple Synthesis) (Operation Expression)) (case elemsS+ #.Nil (:: ///.monad wrap (primitive.text synthesis.unit)) (#.Cons singletonS #.Nil) (generate singletonS) _ (do ///.monad [elemsT+ (monad.map @ generate elemsS+)] (wrap (_.vector/* elemsT+))))) (def: #export (variant generate [lefts right? valueS]) (-> Phase (Variant Synthesis) (Operation Expression)) (do ///.monad [valueT (generate valueS)] (wrap (runtime.variant [lefts right? valueT]))))