From cfa0a075b89a0df4618e7009f05c157393cbba72 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 1 Dec 2020 09:27:58 -0400 Subject: Added specialized root/2 and root/3 functions in lux/math. --- stdlib/source/poly/lux/abstract/functor.lux | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'stdlib/source/poly') diff --git a/stdlib/source/poly/lux/abstract/functor.lux b/stdlib/source/poly/lux/abstract/functor.lux index da14b2b6c..d640d4205 100644 --- a/stdlib/source/poly/lux/abstract/functor.lux +++ b/stdlib/source/poly/lux/abstract/functor.lux @@ -13,7 +13,7 @@ ["." text ["%" format (#+ format)]] [collection - ["." list ("#;." monad monoid)]]] + ["." list ("#\." monad monoid)]]] [macro ["." code] [syntax (#+ syntax:) @@ -37,7 +37,7 @@ (function (_ unwrappedT) (if (n.= 1 num-vars) (` ((~! /.Functor) (~ (poly.to-code *env* unwrappedT)))) - (let [paramsC (|> num-vars dec list.indices (list;map (|>> %.nat code.local-identifier)))] + (let [paramsC (|> num-vars dec list.indices (list\map (|>> %.nat code.local-identifier)))] (` (All [(~+ paramsC)] ((~! /.Functor) ((~ (poly.to-code *env* unwrappedT)) (~+ paramsC))))))))) Arg (: (-> Code (.Parser Code)) @@ -54,7 +54,7 @@ membersC (.variant (p.many (Arg valueC))) #let [last (dec (list.size membersC))]] (wrap (` (case (~ valueC) - (~+ (list;join (list;map (function (_ [tag memberC]) + (~+ (list\join (list\map (function (_ [tag memberC]) (if (n.= last tag) (list (` ((~ (code.nat (dec tag))) #1 (~ valueC))) (` ((~ (code.nat (dec tag))) #1 (~ memberC)))) @@ -72,11 +72,11 @@ [_ (wrap []) memberC (Arg slotC)] (recur (inc idx) - (list;compose pairsCC (list [slotC memberC]))))) + (list\compose pairsCC (list [slotC memberC]))))) (wrap pairsCC)))))] (wrap (` (case (~ valueC) - [(~+ (list;map product.left pairsCC))] - [(~+ (list;map product.right pairsCC))])))) + [(~+ (list\map product.left pairsCC))] + [(~+ (list\map product.right pairsCC))])))) ## Functions (do ! [_ (wrap []) @@ -86,7 +86,7 @@ (Arg outL)) #let [inC+ (|> (list.size inT+) list.indices - (list;map (|>> %.nat (format "____________inC") code.local-identifier)))]] + (list\map (|>> %.nat (format "____________inC") code.local-identifier)))]] (wrap (` (function ((~ g!) (~+ inC+)) (let [(~ outL) ((~ valueC) (~+ inC+))] (~ outC)))))) -- cgit v1.2.3