aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/synthesizer.lux
blob: d2f559c3e318d5497fa2446b40ad8bb04f38724d (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
40
41
42
43
44
45
46
(;module:
  lux
  (lux (control monad)
       (data text/format
             (coll [list "L/" Functor<List>]))
       [macro #+ Monad<Lux>])
  (luxc ["&" base]
        (lang ["la" analysis #+ Analysis]
              ["ls" synthesis #+ Synthesis])
        ["&;" analyser]))

(def: #export (synthesize analysis)
  (-> Analysis Synthesis)
  (case analysis
    (^template [<from> <to>]
      (<from> value)
      (<to> value))
    ([#la;Unit     #ls;Unit]
     [#la;Bool     #ls;Bool]
     [#la;Nat      #ls;Nat]
     [#la;Int      #ls;Int]
     [#la;Deg      #ls;Deg]
     [#la;Real     #ls;Real]
     [#la;Char     #ls;Char]
     [#la;Text     #ls;Text]
     [#la;Relative #ls;Relative]
     [#la;Absolute #ls;Absolute])

    (#la;Tuple values)
    (#ls;Tuple (L/map synthesize values))

    (#la;Variant tag last? value)
    (undefined)

    (#la;Case pattern)
    (undefined)

    (#la;Function scope body)
    (undefined)

    (#la;Apply arg func)
    (undefined)
    
    (#la;Procedure name args)
    (#ls;Procedure name (L/map synthesize args))
    ))