diff options
author | Eduardo Julian | 2023-01-07 18:55:20 -0400 |
---|---|---|
committer | Eduardo Julian | 2023-01-07 18:55:20 -0400 |
commit | ae2d5697d93a45dcbff768c32c4dc8fb291096cd (patch) | |
tree | 027d732be6a126d41d6265e595627b768daac29a /stdlib/source/specification/compositor/analysis | |
parent | 06f5b1c544ad27eecfbc7cc9b3bd7591f9e33423 (diff) |
Now wrapping C++ values inside a universal box.
Diffstat (limited to 'stdlib/source/specification/compositor/analysis')
-rw-r--r-- | stdlib/source/specification/compositor/analysis/type.lux | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/stdlib/source/specification/compositor/analysis/type.lux b/stdlib/source/specification/compositor/analysis/type.lux deleted file mode 100644 index 726e438c9..000000000 --- a/stdlib/source/specification/compositor/analysis/type.lux +++ /dev/null @@ -1,65 +0,0 @@ -(.require - [library - [lux (.except) - [abstract - [monad (.only do)]] - [control - ["[0]" pipe] - ["[0]" io] - ["[0]" try]] - [math - ["r" random (.only Random)]] - [meta - ["[0]" code] - [compiler - [analysis (.only State)] - ["[0]" phase - [macro (.only Expander)] - ["[0]" analysis - ["[1]/[0]" scope] - ["[1]/[0]" type]]]]] - [test - ["_" property (.only Test)]]]]) - -(def (check_success+ expander state extension params output_type) - (-> Expander State Text (List Code) Type Bit) - (|> (analysis/scope.with_scope "" - (analysis/type.with_type output_type - (analysis.phase expander (` ((, (code.text extension)) (,* params)))))) - (phase.result state) - (pipe.when - {try.#Success _} - true - - {try.#Failure _} - false))) - -(def check - (Random [Code Type Code]) - (`` (all r.either - (,, (with_template [<random> <type> <code>] - [(do r.monad - [value <random>] - (in [(` <type>) - <type> - (<code> value)]))] - - [r.bit {0 #0 "#Bit" {0 #0}} code.bit] - [r.nat {0 #0 "#I64" {0 #1 {0 #0 "#Nat" {0 #0}} {0 #0}}} code.nat] - [r.int {0 #0 "#I64" {0 #1 {0 #0 "#Int" {0 #0}} {0 #0}}} code.int] - [r.rev {0 #0 "#I64" {0 #1 {0 #0 "#Rev" {0 #0}} {0 #0}}} code.rev] - [r.safe_frac {0 #0 "#Frac" {0 #0}} code.frac] - [(r.upper_case_alpha 5) {0 #0 "#Text" {0 #0}} code.text] - ))))) - -(def .public (spec expander state) - (-> Expander State Test) - (do r.monad - [[typeC exprT exprC] ..check - [other_typeC other_exprT other_exprC] ..check] - (all _.and - (_.test "lux check" - (check_success+ expander state "lux check" (list typeC exprC) exprT)) - (_.test "lux coerce" - (check_success+ expander state "lux coerce" (list typeC other_exprC) exprT)) - ))) |