blob: d3b266697d40220bbcb5ee9eac1fca610e9946bd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
... This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
... If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
(.require
[library
[lux (.except Tuple Variant)
[abstract
["[0]" monad (.only do)]]
[meta
[compiler
[target
["_" lua (.only Expression)]]]]]]
["[0]" //
["[1][0]" runtime (.only Operation Phase Translator)]
["[1][0]" primitive]
["///[1]" ////
["[0]" phase (.use "[1]#[0]" monad)]
["[0]" synthesis]
[analysis
[complex (.only Variant Tuple)]]]])
(def .public (tuple phase archive elemsS+)
(Translator (Tuple synthesis.Term))
(when elemsS+
{.#End}
(phase#in (//primitive.text synthesis.unit))
{.#Item singletonS {.#End}}
(phase archive singletonS)
_
(|> elemsS+
(monad.each phase.monad (phase archive))
(phase#each _.array))))
(def .public (variant phase archive [lefts right? valueS])
(Translator (Variant synthesis.Term))
(phase#each (//runtime.variant lefts right?)
(phase archive valueS)))
|