diff options
author | Eduardo Julian | 2017-11-29 22:49:56 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-11-29 22:49:56 -0400 |
commit | 4433c9bcd6c6cac44c018aad2e21a5b4d7cc4896 (patch) | |
tree | 0c166db6e01b41dfadd01801b5242967f2363b7d /new-luxc/source/luxc/module/descriptor/type.lux | |
parent | 77c113a3455cdbc4bb485a94f67f392480cdcfbf (diff) |
- Adapted main codebase to the latest syntatic changes.
Diffstat (limited to 'new-luxc/source/luxc/module/descriptor/type.lux')
-rw-r--r-- | new-luxc/source/luxc/module/descriptor/type.lux | 120 |
1 files changed, 60 insertions, 60 deletions
diff --git a/new-luxc/source/luxc/module/descriptor/type.lux b/new-luxc/source/luxc/module/descriptor/type.lux index 58e29c39e..d72229832 100644 --- a/new-luxc/source/luxc/module/descriptor/type.lux +++ b/new-luxc/source/luxc/module/descriptor/type.lux @@ -1,4 +1,4 @@ -(;module: +(.module: lux (lux (control codec monad) @@ -12,7 +12,7 @@ ["&" ../common]) (do-template [<name> <code>] - [(def: <name> &;Signal <code>)] + [(def: <name> &.Signal <code>)] [type-signal "T"] [primitive-signal "^"] @@ -36,109 +36,109 @@ (type/= Type type)) type-signal (case type - (#;Primitive name params) - (format primitive-signal name &;stop-signal (&;encode-list encode-type params)) + (#.Primitive name params) + (format primitive-signal name &.stop-signal (&.encode-list encode-type params)) - #;Void + #.Void void-signal - #;Unit + #.Unit unit-signal (^template [<tag> <prefix>] (<tag> left right) (format <prefix> (encode-type left) (encode-type right))) - ([#;Product product-signal] - [#;Sum sum-signal] - [#;Function function-signal] - [#;App application-signal]) + ([#.Product product-signal] + [#.Sum sum-signal] + [#.Function function-signal] + [#.App application-signal]) (^template [<tag> <prefix>] (<tag> env body) - (format <prefix> (&;encode-list encode-type env) (encode-type body))) - ([#;UnivQ uq-signal] - [#;ExQ eq-signal]) + (format <prefix> (&.encode-list encode-type env) (encode-type body))) + ([#.UnivQ uq-signal] + [#.ExQ eq-signal]) (^template [<tag> <prefix>] (<tag> idx) - (format <prefix> (%i (nat-to-int idx)) &;stop-signal)) - ([#;Bound bound-signal] - [#;Ex ex-signal] - [#;Var var-signal]) + (format <prefix> (%i (nat-to-int idx)) &.stop-signal)) + ([#.Bound bound-signal] + [#.Ex ex-signal] + [#.Var var-signal]) - (#;Named [module name] type*) - (format named-signal module &;ident-separator name &;stop-signal (encode-type type*)) + (#.Named [module name] type*) + (format named-signal module &.ident-separator name &.stop-signal (encode-type type*)) ))) (def: type-decoder - (l;Lexer Type) - (l;rec + (l.Lexer Type) + (l.rec (function [type-decoder] (with-expansions [<simple> (do-template [<type> <signal>] - [(|> (l/wrap <type>) (l;after (l;text <signal>)))] + [(|> (l/wrap <type>) (l.after (l.text <signal>)))] [Type type-signal] - [#;Void void-signal] - [#;Unit unit-signal]) + [#.Void void-signal] + [#.Unit unit-signal]) <combinators> (do-template [<tag> <prefix>] - [(do l;Monad<Lexer> - [_ (l;text <prefix>) + [(do l.Monad<Lexer> + [_ (l.text <prefix>) left type-decoder right type-decoder] (wrap (<tag> left right)))] - [#;Product product-signal] - [#;Sum sum-signal] - [#;Function function-signal] - [#;App application-signal]) + [#.Product product-signal] + [#.Sum sum-signal] + [#.Function function-signal] + [#.App application-signal]) <abstractions> (do-template [<tag> <prefix>] - [(do l;Monad<Lexer> - [_ (l;text <prefix>) - env (&;decode-list type-decoder) + [(do l.Monad<Lexer> + [_ (l.text <prefix>) + env (&.decode-list type-decoder) body type-decoder] (wrap (<tag> env body)))] - [#;UnivQ uq-signal] - [#;ExQ eq-signal]) + [#.UnivQ uq-signal] + [#.ExQ eq-signal]) <wildcards> (do-template [<tag> <prefix>] - [(do l;Monad<Lexer> - [_ (l;text <prefix>) - id (l;codec number;Codec<Text,Int> - (l;some' l;digit)) - _ (l;text &;stop-signal)] + [(do l.Monad<Lexer> + [_ (l.text <prefix>) + id (l.codec number.Codec<Text,Int> + (l.some' l.digit)) + _ (l.text &.stop-signal)] (wrap (<tag> (int-to-nat id))))] - [#;Bound bound-signal] - [#;Ex ex-signal] - [#;Var var-signal])] - ($_ l;either - (do l;Monad<Lexer> - [_ (l;text primitive-signal) - name (l;many' (l;none-of &;stop-signal)) - _ (l;text &;stop-signal) - params (&;decode-list type-decoder)] - (wrap (#;Primitive name params))) + [#.Bound bound-signal] + [#.Ex ex-signal] + [#.Var var-signal])] + ($_ l.either + (do l.Monad<Lexer> + [_ (l.text primitive-signal) + name (l.many' (l.none-of &.stop-signal)) + _ (l.text &.stop-signal) + params (&.decode-list type-decoder)] + (wrap (#.Primitive name params))) <simple> <combinators> <abstractions> <wildcards> - (do l;Monad<Lexer> - [_ (l;text named-signal) - module (l;some' (l;none-of &;ident-separator)) - _ (l;text &;ident-separator) - name (l;many' (l;none-of &;stop-signal)) - _ (l;text &;stop-signal) + (do l.Monad<Lexer> + [_ (l.text named-signal) + module (l.some' (l.none-of &.ident-separator)) + _ (l.text &.ident-separator) + name (l.many' (l.none-of &.stop-signal)) + _ (l.text &.stop-signal) unnamed type-decoder] - (wrap (#;Named [module name] unnamed))) + (wrap (#.Named [module name] unnamed))) ))))) (def: (decode-type input) - (-> Text (e;Error Type)) + (-> Text (e.Error Type)) (|> type-decoder - (l;before l;end) - (l;run input))) + (l.before l.end) + (l.run input))) (struct: #export _ (Codec Text Type) (def: encode encode-type) |