From f861af6c6bd57677ba4af2ee3275c69b11f68beb Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 11 Jul 2018 20:20:24 -0400 Subject: - Re-named "lux/macro/poly.this" to "exactly" and "lux/macro/poly.like" to "similar". --- .../lux/language/compiler/default/repl/type.lux | 10 ++--- stdlib/source/lux/macro/poly.lux | 4 +- stdlib/source/lux/macro/poly/equivalence.lux | 22 +++++----- stdlib/source/lux/macro/poly/json.lux | 48 +++++++++++----------- stdlib/source/lux/type/quotient.lux | 2 +- stdlib/source/lux/type/refinement.lux | 2 +- 6 files changed, 44 insertions(+), 44 deletions(-) diff --git a/stdlib/source/lux/language/compiler/default/repl/type.lux b/stdlib/source/lux/language/compiler/default/repl/type.lux index a9342ab6a..84f063e0c 100644 --- a/stdlib/source/lux/language/compiler/default/repl/type.lux +++ b/stdlib/source/lux/language/compiler/default/repl/type.lux @@ -32,12 +32,12 @@ (Poly Representation) (`` ($_ p.either (do p.Monad - [_ (poly.this Any)] + [_ (poly.exactly Any)] (wrap (function.constant "[]"))) (~~ (do-template [ ] [(do p.Monad - [_ (poly.like )] + [_ (poly.similar )] (wrap (|>> (:coerce ) )))] [Bool %b] @@ -52,7 +52,7 @@ (`` ($_ p.either (~~ (do-template [ ] [(do p.Monad - [_ (poly.like )] + [_ (poly.similar )] (wrap (|>> (:coerce ) )))] [Type %type] @@ -64,12 +64,12 @@ [XML %xml])) (do p.Monad - [[_ elemT] (poly.apply (p.seq (poly.this List) poly.any)) + [[_ elemT] (poly.apply (p.seq (poly.exactly List) poly.any)) elemR (poly.local (list elemT) representation)] (wrap (|>> (:coerce (List Any)) (%list elemR)))) (do p.Monad - [[_ elemT] (poly.apply (p.seq (poly.this Maybe) poly.any)) + [[_ elemT] (poly.apply (p.seq (poly.exactly Maybe) poly.any)) elemR (poly.local (list elemT) representation)] (wrap (|>> (:coerce (Maybe Any)) (case> #.None diff --git a/stdlib/source/lux/macro/poly.lux b/stdlib/source/lux/macro/poly.lux index 8fec440cf..7a7375e12 100644 --- a/stdlib/source/lux/macro/poly.lux +++ b/stdlib/source/lux/macro/poly.lux @@ -212,8 +212,8 @@ "Expected: " (type.to-text expected) "\n" " Actual: " (type.to-text actual))))))] - [this type/=] - [like check.checks?] + [exactly type/=] + [similar check.checks?] ) (def: (adjusted-idx env idx) diff --git a/stdlib/source/lux/macro/poly/equivalence.lux b/stdlib/source/lux/macro/poly/equivalence.lux index d3e28b5e7..189179e13 100644 --- a/stdlib/source/lux/macro/poly/equivalence.lux +++ b/stdlib/source/lux/macro/poly/equivalence.lux @@ -49,17 +49,17 @@ (wrap (` (: (~ (@Equivalence inputT)) ))))] - [(poly.this Any) (function ((~ g!_) (~ g!_) (~ g!_)) true)] - [(poly.like Bool) bool.Equivalence] - [(poly.like Nat) number.Equivalence] - [(poly.like Int) number.Equivalence] - [(poly.like Rev) number.Equivalence] - [(poly.like Frac) number.Equivalence] - [(poly.like Text) text.Equivalence])) + [(poly.exactly Any) (function ((~ g!_) (~ g!_) (~ g!_)) true)] + [(poly.similar Bool) bool.Equivalence] + [(poly.similar Nat) number.Equivalence] + [(poly.similar Int) number.Equivalence] + [(poly.similar Rev) number.Equivalence] + [(poly.similar Frac) number.Equivalence] + [(poly.similar Text) text.Equivalence])) ## Composite types (~~ (do-template [ ] [(do @ - [[_ argC] (poly.apply (p.seq (poly.this ) + [[_ argC] (poly.apply (p.seq (poly.exactly ) Equivalence))] (wrap (` (: (~ (@Equivalence inputT)) ( (~ argC))))))] @@ -74,7 +74,7 @@ )) (do @ [[_ _ valC] (poly.apply ($_ p.seq - (poly.this dict.Dictionary) + (poly.exactly dict.Dictionary) poly.any Equivalence))] (wrap (` (: (~ (@Equivalence inputT)) @@ -82,7 +82,7 @@ ## Models (~~ (do-template [ ] [(do @ - [_ (poly.this )] + [_ (poly.exactly )] (wrap (` (: (~ (@Equivalence inputT)) ))))] @@ -92,7 +92,7 @@ [da.Day da.Equivalence] [da.Month da.Equivalence])) (do @ - [_ (poly.apply (p.seq (poly.this unit.Qty) + [_ (poly.apply (p.seq (poly.exactly unit.Qty) poly.any))] (wrap (` (: (~ (@Equivalence inputT)) unit.Equivalence)))) diff --git a/stdlib/source/lux/macro/poly/json.lux b/stdlib/source/lux/macro/poly/json.lux index e6da2b602..2745ad592 100644 --- a/stdlib/source/lux/macro/poly/json.lux +++ b/stdlib/source/lux/macro/poly/json.lux @@ -91,15 +91,15 @@ (wrap (` (: (~ (@JSON//encode inputT)) ))))] - [(poly.this Any) (function ((~ g!_) (~ (code.symbol ["" "0"]))) #//.Null)] - [(poly.like Bool) (|>> #//.Boolean)] - [(poly.like Nat) (:: (~! ..Codec) (~' encode))] - [(poly.like Int) (:: (~! ..Codec) (~' encode))] - [(poly.like Frac) (|>> #//.Number)] - [(poly.like Text) (|>> #//.String)]) + [(poly.exactly Any) (function ((~ g!_) (~ (code.symbol ["" "0"]))) #//.Null)] + [(poly.similar Bool) (|>> #//.Boolean)] + [(poly.similar Nat) (:: (~! ..Codec) (~' encode))] + [(poly.similar Int) (:: (~! ..Codec) (~' encode))] + [(poly.similar Frac) (|>> #//.Number)] + [(poly.similar Text) (|>> #//.String)])