From 2dbbaaec93a53f8dd0b96a0028b9cf125c9066cd Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sun, 12 Sep 2021 15:39:55 -0400 Subject: Re-named \ => # && \\ => ## --- stdlib/source/poly/lux/abstract/equivalence.lux | 20 +++---- stdlib/source/poly/lux/abstract/functor.lux | 14 ++--- stdlib/source/poly/lux/data/format/json.lux | 78 ++++++++++++------------- 3 files changed, 56 insertions(+), 56 deletions(-) (limited to 'stdlib/source/poly') diff --git a/stdlib/source/poly/lux/abstract/equivalence.lux b/stdlib/source/poly/lux/abstract/equivalence.lux index 37bb54d79..1159d4ff4 100644 --- a/stdlib/source/poly/lux/abstract/equivalence.lux +++ b/stdlib/source/poly/lux/abstract/equivalence.lux @@ -10,10 +10,10 @@ [data ["[0]" product] ["[0]" bit] - ["[0]" text ("[1]\[0]" monoid) + ["[0]" text ("[1]#[0]" monoid) ["%" format {"+" [format]}]] [collection - ["[0]" list ("[1]\[0]" monad)] + ["[0]" list ("[1]#[0]" monad)] ["[0]" row] ["[0]" array] ["[0]" queue] @@ -25,7 +25,7 @@ ["[0]" code]] [math [number - ["[0]" nat ("[1]\[0]" decimal)] + ["[0]" nat ("[1]#[0]" decimal)] ["[0]" int] ["[0]" rev] ["[0]" frac]]] @@ -115,7 +115,7 @@ (in (` (: (~ (@Equivalence inputT)) (function ((~ g!_) (~ g!left) (~ g!right)) (case [(~ g!left) (~ g!right)] - (~+ (list\conjoint (list\each (function (_ [tag g!eq]) + (~+ (list#conjoint (list#each (function (_ [tag g!eq]) (if (nat.= last tag) (list (` [{(~ (code.nat (-- tag))) #1 (~ g!left)} {(~ (code.nat (-- tag))) #1 (~ g!right)}]) @@ -131,12 +131,12 @@ [g!eqs (.tuple (<>.many equivalence)) .let [g!_ (code.local_identifier "_____________") indices (list.indices (list.size g!eqs)) - g!lefts (list\each (|>> nat\encoded (text\composite "left") code.local_identifier) indices) - g!rights (list\each (|>> nat\encoded (text\composite "right") code.local_identifier) indices)]] + g!lefts (list#each (|>> nat#encoded (text#composite "left") code.local_identifier) indices) + g!rights (list#each (|>> nat#encoded (text#composite "right") code.local_identifier) indices)]] (in (` (: (~ (@Equivalence inputT)) (function ((~ g!_) [(~+ g!lefts)] [(~+ g!rights)]) (and (~+ (|> (list.zipped/3 g!eqs g!lefts g!rights) - (list\each (function (_ [g!eq g!left g!right]) + (list#each (function (_ [g!eq g!left g!right]) (` ((~ g!eq) (~ g!left) (~ g!right))))))))))))) ... Type recursion (do ! @@ -156,13 +156,13 @@ (do ! [[funcC varsC bodyC] (.polymorphic equivalence)] (in (` (: (All ((~ g!_) (~+ varsC)) - (-> (~+ (list\each (|>> (~) ((~! /.Equivalence)) (`)) varsC)) + (-> (~+ (list#each (|>> (~) ((~! /.Equivalence)) (`)) varsC)) ((~! /.Equivalence) ((~ (poly.code *env* inputT)) (~+ varsC))))) (function ((~ funcC) (~+ varsC)) (~ bodyC)))))) .recursive_call ... If all else fails... (|> .any - (\ ! each (|>> %.type (format "Cannot create Equivalence for: ") <>.failure)) - (\ ! conjoint)) + (# ! each (|>> %.type (format "Cannot create Equivalence for: ") <>.failure)) + (# ! conjoint)) )))) diff --git a/stdlib/source/poly/lux/abstract/functor.lux b/stdlib/source/poly/lux/abstract/functor.lux index d4637711f..2c9ba91f1 100644 --- a/stdlib/source/poly/lux/abstract/functor.lux +++ b/stdlib/source/poly/lux/abstract/functor.lux @@ -12,7 +12,7 @@ ["[0]" text ["%" format {"+" [format]}]] [collection - ["[0]" list ("[1]\[0]" monad monoid)]]] + ["[0]" list ("[1]#[0]" monad monoid)]]] [macro [syntax {"+" [syntax:]}] ["[0]" code]] @@ -39,7 +39,7 @@ (function (_ unwrappedT) (if (n.= 1 num_vars) (` ((~! /.Functor) (~ (poly.code *env* unwrappedT)))) - (let [paramsC (|> num_vars -- list.indices (list\each (|>> %.nat code.local_identifier)))] + (let [paramsC (|> num_vars -- list.indices (list#each (|>> %.nat code.local_identifier)))] (` (All ((~ g!_) (~+ paramsC)) ((~! /.Functor) ((~ (poly.code *env* unwrappedT)) (~+ paramsC))))))))) Arg (: (-> Code (.Parser Code)) @@ -56,7 +56,7 @@ membersC (.variant (p.many (Arg valueC))) .let [last (-- (list.size membersC))]] (in (` (case (~ valueC) - (~+ (list\conjoint (list\each (function (_ [tag memberC]) + (~+ (list#conjoint (list#each (function (_ [tag memberC]) (if (n.= last tag) (list (` {(~ (code.nat (-- tag))) #1 (~ valueC)}) (` {(~ (code.nat (-- tag))) #1 (~ memberC)})) @@ -74,11 +74,11 @@ [_ (in []) memberC (Arg slotC)] (recur (++ idx) - (list\composite pairsCC (list [slotC memberC]))))) + (list#composite pairsCC (list [slotC memberC]))))) (in pairsCC)))))] (in (` (case (~ valueC) - [(~+ (list\each product.left pairsCC))] - [(~+ (list\each product.right pairsCC))])))) + [(~+ (list#each product.left pairsCC))] + [(~+ (list#each product.right pairsCC))])))) ... Functions (do ! [_ (in []) @@ -88,7 +88,7 @@ (Arg outL)) .let [inC+ (|> (list.size inT+) list.indices - (list\each (|>> %.nat (format "____________inC") code.local_identifier)))]] + (list#each (|>> %.nat (format "____________inC") code.local_identifier)))]] (in (` (function ((~ g!) (~+ inC+)) (let [(~ outL) ((~ valueC) (~+ inC+))] (~ outC)))))) diff --git a/stdlib/source/poly/lux/data/format/json.lux b/stdlib/source/poly/lux/data/format/json.lux index 53bdcd06c..f6ab79e6a 100644 --- a/stdlib/source/poly/lux/data/format/json.lux +++ b/stdlib/source/poly/lux/data/format/json.lux @@ -15,7 +15,7 @@ ["[0]" text ["%" format {"+" [format]}]] [collection - ["[0]" list ("[1]\[0]" monad)] + ["[0]" list ("[1]#[0]" monad)] ["[0]" row {"+" [row]}] ["[0]" dictionary]]] [macro @@ -23,7 +23,7 @@ ["[0]" code]] [math [number - ["n" nat ("[1]\[0]" decimal)] + ["n" nat ("[1]#[0]" decimal)] ["[0]" i64] ["[0]" int] ["[0]" frac]]] @@ -73,9 +73,9 @@ (codec.Codec JSON Int) (def: encoded - (|>> .nat (\ nat_codec encoded))) + (|>> .nat (# nat_codec encoded))) (def: decoded - (|>> (\ nat_codec decoded) (\ try.functor each .int)))) + (|>> (# nat_codec decoded) (# try.functor each .int)))) ... Builds a JSON generator for potentially inexistent values. (def: (nullable writer) @@ -91,10 +91,10 @@ (def: encoded (|>> ((debug.private unit.out')) - (\ ..int_codec encoded))) + (# ..int_codec encoded))) (def: decoded - (|>> (\ ..int_codec decoded) - (\ try.functor each (debug.private unit.in'))))) + (|>> (# ..int_codec decoded) + (# try.functor each (debug.private unit.in'))))) (poly: encoded (with_expansions @@ -102,20 +102,20 @@ [(do ! [.let [g!_ (code.local_identifier "_______")] _ ] - (in (` (: (~ (@JSON\encoded inputT)) + (in (` (: (~ (@JSON#encoded inputT)) ))))] [(.exactly Any) (function ((~ g!_) (~ (code.identifier ["" "0"]))) {/.#Null})] [(.sub Bit) (|>> {/.#Boolean})] - [(.sub Nat) (\ (~! ..nat_codec) (~' encoded))] - [(.sub Int) (\ (~! ..int_codec) (~' encoded))] + [(.sub Nat) (# (~! ..nat_codec) (~' encoded))] + [(.sub Int) (# (~! ..int_codec) (~' encoded))] [(.sub Frac) (|>> {/.#Number})] [(.sub Text) (|>> {/.#String})])