diff options
| author | Eduardo Julian | 2022-03-14 18:27:37 -0400 | 
|---|---|---|
| committer | Eduardo Julian | 2022-03-14 18:27:37 -0400 | 
| commit | 41495e32d3f5f88b5f189f48dd4fdbfa883c6ac0 (patch) | |
| tree | 7a561e83768d5ac4eb08855858dde38d2987fc46 /stdlib/source/library/lux/tool/compiler | |
| parent | 62299ecdc93b39f6a22b1f89779f55dfa735fb3c (diff) | |
De-sigil-ification: >
Diffstat (limited to 'stdlib/source/library/lux/tool/compiler')
15 files changed, 119 insertions, 107 deletions
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/analysis/inference.lux b/stdlib/source/library/lux/tool/compiler/language/lux/analysis/inference.lux index fa9e2e0fb..4b18f2874 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/analysis/inference.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/analysis/inference.lux @@ -5,7 +5,7 @@     [abstract      ["[0]" monad {"+" do}]]     [control -    [pipe {"+" case>}] +    ["[0]" pipe]      ["[0]" maybe]      ["[0]" try]      ["[0]" exception {"+" exception:}]] @@ -265,16 +265,17 @@     (|> it         type.flat_variant         (list.after lefts) -       (case> {.#Item [head tail]} -              (let [case (if right? -                           (type.variant tail) -                           head)] -                (-> (if (n.= 0 depth) -                      case -                      (..with_recursion (|> depth -- (n.* 2)) complex case)) -                    (type.application (parameters depth) complex))) +       (pipe.case +         {.#Item [head tail]} +         (let [case (if right? +                      (type.variant tail) +                      head)] +           (-> (if (n.= 0 depth) +                 case +                 (..with_recursion (|> depth -- (n.* 2)) complex case)) +               (type.application (parameters depth) complex))) -              {.#End} -              (-> .Nothing complex)) +         {.#End} +         (-> .Nothing complex))         phase#in)]    ) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/analysis/module.lux b/stdlib/source/library/lux/tool/compiler/language/lux/analysis/module.lux index 39fcf63e7..484d1e886 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/analysis/module.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/analysis/module.lux @@ -4,7 +4,7 @@     [abstract      ["[0]" monad {"+" do}]]     [control -    pipe +    ["[0]" pipe]      ["[0]" try]      ["[0]" exception {"+" exception:}]]     [data @@ -111,8 +111,9 @@       (|> state           (the .#modules)           (plist.value module) -         (case> {.#Some _} #1 {.#None} #0) -         [state] {try.#Success})))) +         (pipe.case {.#Some _} #1 {.#None} #0) +         [state] +         {try.#Success}))))  (def: .public (define name definition)    (-> Text Global (Operation Any)) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux index 18e485a46..5b833c0b7 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux @@ -7,7 +7,7 @@      ["[0]" monad {"+" do}]      ["[0]" predicate]]     [control -    pipe +    ["[0]" pipe]      ["[0]" maybe ("[1]#[0]" functor)]      ["[0]" try {"+" Try} ("[1]#[0]" monad)]      ["[0]" exception {"+" exception:}] @@ -1342,11 +1342,12 @@  (template [<name> <tag>]    [(def: <name>       (-> Evaluation (Maybe Method_Signature)) -     (|>> (case> {<tag> output} -                 {.#Some output} +     (|>> (pipe.case +            {<tag> output} +            {.#Some output} -                 _ -                 {.#None})))] +            _ +            {.#None})))]    [pass! #Pass]    [hint! #Hint] @@ -2404,7 +2405,7 @@             [constant (`` (|> value (~~ (template.spliced <constant>))))              attribute (attribute.constant constant)]             (field.field ..constant::modifier name #1 <type> (sequence.sequence attribute)))]) -      ([.#Bit jvm.boolean [(case> #0 +0 #1 +1) .i64 i32.i32 constant.integer pool.integer]] +      ([.#Bit jvm.boolean [(pipe.case #0 +0 #1 +1) .i64 i32.i32 constant.integer pool.integer]]         [.#Int jvm.byte [.i64 i32.i32 constant.integer pool.integer]]         [.#Int jvm.short [.i64 i32.i32 constant.integer pool.integer]]         [.#Int jvm.int [.i64 i32.i32 constant.integer pool.integer]] @@ -2426,10 +2427,11 @@  (def: method_privacy    (-> ffi.Privacy (Modifier method.Method)) -  (|>> (case> {ffi.#PublicP} method.public -              {ffi.#PrivateP} method.private -              {ffi.#ProtectedP} method.protected -              {ffi.#DefaultP} modifier.empty))) +  (|>> (pipe.case +         {ffi.#PublicP} method.public +         {ffi.#PrivateP} method.private +         {ffi.#ProtectedP} method.protected +         {ffi.#DefaultP} modifier.empty)))  (def: constructor_name    "<init>") diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/jvm.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/jvm.lux index 8c314121a..0dc4e8ed4 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/jvm.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/jvm.lux @@ -5,7 +5,7 @@     [abstract      ["[0]" monad {"+" do}]]     [control -    [pipe {"+" case>}] +    ["[0]" pipe]      ["[0]" try {"+" Try} ("[1]#[0]" functor)]      ["[0]" exception]      ["<>" parser ("[1]#[0]" monad) @@ -102,10 +102,11 @@  (def: method_privacy    (-> ffi.Privacy (Modifier method.Method)) -  (|>> (case> {ffi.#PublicP} method.public -              {ffi.#PrivateP} method.private -              {ffi.#ProtectedP} method.protected -              {ffi.#DefaultP} modifier.empty))) +  (|>> (pipe.case +         {ffi.#PublicP} method.public +         {ffi.#PrivateP} method.private +         {ffi.#ProtectedP} method.protected +         {ffi.#DefaultP} modifier.empty)))  (def: visibility'    (<text>.Parser (Modifier field.Field)) @@ -235,7 +236,7 @@             [constant (`` (|> value (~~ (template.spliced <constant>))))              attribute (attribute.constant constant)]             (field.field ..constant::modifier name #1 <type> (sequence.sequence attribute)))]) -      ([.#Bit type.boolean [(case> #0 +0 #1 +1) .i64 i32.i32 constant.integer pool.integer]] +      ([.#Bit type.boolean [(pipe.case #0 +0 #1 +1) .i64 i32.i32 constant.integer pool.integer]]         [.#Int type.byte [.i64 i32.i32 constant.integer pool.integer]]         [.#Int type.short [.i64 i32.i32 constant.integer pool.integer]]         [.#Int type.int [.i64 i32.i32 constant.integer pool.integer]] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/primitive.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/primitive.lux index 19fafd7d5..e5cc82537 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/primitive.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/primitive.lux @@ -1,8 +1,6 @@  (.using    [library     [lux {"-" i64} -    [control -     [pipe {"+" cond> new>}]]      [math       [number        ["[0]" frac]]] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis.lux index ae74e45f3..274c4d0ad 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis.lux @@ -4,7 +4,7 @@     [abstract      ["[0]" monad {"+" do}]]     [control -    [pipe {"+" case>}] +    ["[0]" pipe]      ["[0]" try]]     [data      [collection @@ -89,14 +89,15 @@          (function (_ state)            (|> (//extension.apply archive optimization [name args])                (phase.result' state) -              (case> {try.#Success output} -                     {try.#Success output} -                      -                     {try.#Failure _} -                     (|> args -                         (monad.each phase.monad optimization') -                         (phase#each (|>> [name] {/.#Extension})) -                         (phase.result' state)))))) +              (pipe.case +                {try.#Success output} +                {try.#Success output} +                 +                {try.#Failure _} +                (|> args +                    (monad.each phase.monad optimization') +                    (phase#each (|>> [name] {/.#Extension})) +                    (phase.result' state))))))        )))  (def: .public (phase archive analysis) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/case.lux index 1bf6357f7..a9fa9c013 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/case.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/case.lux @@ -5,7 +5,7 @@      [equivalence {"+" Equivalence}]      ["[0]" monad {"+" do}]]     [control -    [pipe {"+" when> new> case>}]] +    ["[0]" pipe]]     [data      ["[0]" product]      ["[0]" bit ("[1]#[0]" equivalence)] @@ -72,7 +72,7 @@      (<| (///#each (|>> {/.#Seq {/.#Access {/access.#Side [/side.#lefts lefts                                                            /side.#right? right?]}}}))          (path' value_pattern end?) -        (when> [(new> (not end?) [])] [(///#each ..clean_up)]) +        (pipe.when [(pipe.new (not end?) [])] [(///#each ..clean_up)])          thenC)      {///pattern.#Complex {///complex.#Tuple tuple}} @@ -90,7 +90,7 @@                                                                                                 tuple::lefts)                                                                                /member.#right? right?]}}}))                            (path' tuple::member end?') -                          (when> [(new> (not end?') [])] [(///#each ..clean_up)]) +                          (pipe.when [(pipe.new (not end?') [])] [(///#each ..clean_up)])                            nextC))))                  thenC                  (list.reversed (list.enumeration tuple)))) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/function.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/function.lux index c08117adc..e9ec84dca 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/function.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/function.lux @@ -5,7 +5,7 @@      ["[0]" monad {"+" do}]      ["[0]" enum]]     [control -    [pipe {"+" case>}] +    ["[0]" pipe]      ["[0]" maybe ("[1]#[0]" functor)]      ["[0]" exception {"+" exception:}]]     [data @@ -222,11 +222,12 @@          {/.#Abstraction [_env _arity _body]}          (do [! phase.monad]            [_env' (monad.each ! -                             (|>> (case> {/.#Reference {////reference.#Variable {////reference/variable.#Foreign register}}} -                                         (..find_foreign environment register) +                             (|>> (pipe.case +                                    {/.#Reference {////reference.#Variable {////reference/variable.#Foreign register}}} +                                    (..find_foreign environment register) -                                         captured -                                         (grow environment captured))) +                                    captured +                                    (grow environment captured)))                               _env)]            (in (/.function/abstraction [_env' _arity _body]))) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/synthesis.lux b/stdlib/source/library/lux/tool/compiler/language/lux/synthesis.lux index 1d8b9e6d3..b4e9e5b28 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/synthesis.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/synthesis.lux @@ -6,7 +6,6 @@      [equivalence {"+" Equivalence}]      [hash {"+" Hash}]]     [control -    [pipe {"+" case>}]      ["[0]" maybe]      ["[0]" exception {"+" exception:}]]     [data diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/synthesis/simple.lux b/stdlib/source/library/lux/tool/compiler/language/lux/synthesis/simple.lux index bd9463555..7d98c463a 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/synthesis/simple.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/synthesis/simple.lux @@ -5,7 +5,7 @@      [equivalence {"+" Equivalence}]      [hash {"+" Hash}]]     [control -    [pipe {"+" case>}]] +    ["[0]" pipe]]     [data      ["[0]" bit ("[1]#[0]" equivalence)]      ["[0]" text ("[1]#[0]" equivalence) @@ -61,10 +61,11 @@    (def: &equivalence ..equivalence)    (def: hash -    (|>> (case> (^template [<factor> <tag> <hash>] -                  [{<tag> value'} -                   (n.* <factor>  (# <hash> hash value'))]) -                ([2 #Bit  bit.hash] -                 [3 #F64  f.hash] -                 [5 #Text text.hash] -                 [7 #I64  i64.hash]))))) +    (|>> (pipe.case +           (^template [<factor> <tag> <hash>] +             [{<tag> value'} +              (n.* <factor>  (# <hash> hash value'))]) +           ([2 #Bit  bit.hash] +            [3 #F64  f.hash] +            [5 #Text text.hash] +            [7 #I64  i64.hash]))))) diff --git a/stdlib/source/library/lux/tool/compiler/meta/archive/registry.lux b/stdlib/source/library/lux/tool/compiler/meta/archive/registry.lux index be3619845..a1a201a79 100644 --- a/stdlib/source/library/lux/tool/compiler/meta/archive/registry.lux +++ b/stdlib/source/library/lux/tool/compiler/meta/archive/registry.lux @@ -4,7 +4,7 @@     [abstract      [monad {"+" do}]]     [control -    [pipe {"+" case> let>}] +    ["[0]" pipe]      ["[0]" maybe ("[1]#[0]" functor)]      ["[0]" exception {"+" exception:}]      ["<>" parser @@ -79,8 +79,9 @@             sequence.list             (list.all (|>> product.left                            (the //.#category) -                          (case> {<tag> it} {.#Some it} -                                 _ {.#None})))))] +                          (pipe.case +                            {<tag> it} {.#Some it} +                            _ {.#None})))))]      [//category.#Definition definition definitions //category.Definition       product.left {.#Some it}] diff --git a/stdlib/source/library/lux/tool/compiler/meta/cache/module.lux b/stdlib/source/library/lux/tool/compiler/meta/cache/module.lux index e397214b4..b584dd240 100644 --- a/stdlib/source/library/lux/tool/compiler/meta/cache/module.lux +++ b/stdlib/source/library/lux/tool/compiler/meta/cache/module.lux @@ -5,7 +5,7 @@     [abstract      ["[0]" monad {"+" Monad do}]]     [control -    [pipe {"+" case>}] +    ["[0]" pipe]      ["[0]" try {"+" Try}]      ["[0]" exception {"+" exception:}]]     [data @@ -61,11 +61,12 @@              success              (|> path                  (# fs make_directory) -                (# ! each (|>> (case> {try.#Failure error} -                                      <failure> +                (# ! each (|>> (pipe.case +                                 {try.#Failure error} +                                 <failure> -                                      success -                                      success)))))))))) +                                 success +                                 success))))))))))  (def: file    file.Path diff --git a/stdlib/source/library/lux/tool/compiler/meta/cli.lux b/stdlib/source/library/lux/tool/compiler/meta/cli.lux index a9f5d67a5..ba6bb8706 100644 --- a/stdlib/source/library/lux/tool/compiler/meta/cli.lux +++ b/stdlib/source/library/lux/tool/compiler/meta/cli.lux @@ -5,7 +5,7 @@      [monad {"+" do}]      [equivalence {"+" Equivalence}]]     [control -    [pipe {"+" case>}] +    ["[0]" pipe]      ["<>" parser       ["<[0]>" cli {"+" Parser}]       ["<[0]>" text]]] @@ -106,7 +106,8 @@  (def: .public target    (-> Service Target) -  (|>> (case> (^or {#Compilation [host_dependencies libraries compilers sources target module]} -                   {#Interpretation [host_dependencies libraries compilers sources target module]} -                   {#Export [sources target]}) -              target))) +  (|>> (pipe.case +         (^or {#Compilation [host_dependencies libraries compilers sources target module]} +              {#Interpretation [host_dependencies libraries compilers sources target module]} +              {#Export [sources target]}) +         target))) diff --git a/stdlib/source/library/lux/tool/compiler/reference.lux b/stdlib/source/library/lux/tool/compiler/reference.lux index 56f9b9589..7dff736ed 100644 --- a/stdlib/source/library/lux/tool/compiler/reference.lux +++ b/stdlib/source/library/lux/tool/compiler/reference.lux @@ -5,7 +5,7 @@      [equivalence {"+" Equivalence}]      [hash {"+" Hash}]]     [control -    [pipe {"+" case>}]] +    ["[0]" pipe]]     [data      [text       ["%" format {"+" Format}]]] @@ -80,8 +80,9 @@  (def: .public format    (Format Reference) -  (|>> (case> {#Variable variable} -              (/variable.format variable) -               -              {#Constant constant} -              (%.symbol constant)))) +  (|>> (pipe.case +         {#Variable variable} +         (/variable.format variable) +          +         {#Constant constant} +         (%.symbol constant)))) diff --git a/stdlib/source/library/lux/tool/compiler/reference/variable.lux b/stdlib/source/library/lux/tool/compiler/reference/variable.lux index 0efc63114..0614c5b30 100644 --- a/stdlib/source/library/lux/tool/compiler/reference/variable.lux +++ b/stdlib/source/library/lux/tool/compiler/reference/variable.lux @@ -1,18 +1,18 @@  (.using -  [library -   [lux "*" -    [abstract -     [equivalence {"+" Equivalence}] -     [hash {"+" Hash}]] -    [control -     [pipe {"+" case>}]] -    [data -     [text -      ["%" format {"+" Format}]]] -    [math -     [number -      ["n" nat] -      ["i" int]]]]]) + [library +  [lux "*" +   [abstract +    [equivalence {"+" Equivalence}] +    [hash {"+" Hash}]] +   [control +    ["[0]" pipe]] +   [data +    [text +     ["%" format {"+" Format}]]] +   [math +    [number +     ["n" nat] +     ["i" int]]]]])  (type: .public Register    Nat) @@ -42,29 +42,32 @@      ..equivalence)    (def: hash -    (|>> (case> (^template [<factor> <tag>] -                  [{<tag> register} -                   (|> register -                       (# n.hash hash) -                       (n.* <factor>))]) -                ([2 #Local] -                 [3 #Foreign]))))) +    (|>> (pipe.case +           (^template [<factor> <tag>] +             [{<tag> register} +              (|> register +                  (# n.hash hash) +                  (n.* <factor>))]) +           ([2 #Local] +            [3 #Foreign])))))  (template: .public (self)    [{..#Local 0}])  (def: .public self?    (-> Variable Bit) -  (|>> (case> (^ (..self)) -              true +  (|>> (pipe.case +         (^ (..self)) +         true -              _ -              false))) +         _ +         false)))  (def: .public format    (Format Variable) -  (|>> (case> {#Local local} -              (%.format "+" (%.nat local)) -               -              {#Foreign foreign} -              (%.format "-" (%.nat foreign))))) +  (|>> (pipe.case +         {#Local local} +         (%.format "+" (%.nat local)) +          +         {#Foreign foreign} +         (%.format "-" (%.nat foreign)))))  | 
