diff options
Diffstat (limited to 'licentia')
-rw-r--r-- | licentia/source/program/licentia/document.lux | 18 | ||||
-rw-r--r-- | licentia/source/program/licentia/input.lux | 62 | ||||
-rw-r--r-- | licentia/source/program/licentia/license/addendum.lux | 18 | ||||
-rw-r--r-- | licentia/source/program/licentia/license/black_list.lux | 30 | ||||
-rw-r--r-- | licentia/source/program/licentia/license/definition.lux | 130 | ||||
-rw-r--r-- | licentia/source/program/licentia/license/distribution.lux | 26 | ||||
-rw-r--r-- | licentia/source/program/licentia/license/notice.lux | 36 | ||||
-rw-r--r-- | licentia/source/program/licentia/license/term.lux | 10 | ||||
-rw-r--r-- | licentia/source/program/licentia/output.lux | 136 | ||||
-rw-r--r-- | licentia/source/test/licentia.lux | 150 |
10 files changed, 308 insertions, 308 deletions
diff --git a/licentia/source/program/licentia/document.lux b/licentia/source/program/licentia/document.lux index 5e1a99ade..4a3253f76 100644 --- a/licentia/source/program/licentia/document.lux +++ b/licentia/source/program/licentia/document.lux @@ -1,11 +1,11 @@ (.using - [library - [lux {"-" or and} - [data - ["[0]" text - ["%" format {"+" format}]] - [collection - ["[0]" list ("[1]#[0]" functor)]]]]]) + [library + [lux {"-" or and} + [data + ["[0]" text + ["%" format {"+" format}]] + [collection + ["[0]" list ("[1]#[0]" functor)]]]]]) (def: .public (quote text) (-> Text Text) @@ -46,5 +46,5 @@ (def: .public (section value) (-> Section Text) - (format (..block (value@ #title value)) - (value@ #content value))) + (format (..block (the #title value)) + (the #content value))) diff --git a/licentia/source/program/licentia/input.lux b/licentia/source/program/licentia/input.lux index ff14a78d6..ee48bec92 100644 --- a/licentia/source/program/licentia/input.lux +++ b/licentia/source/program/licentia/input.lux @@ -1,33 +1,33 @@ (.using - [library - [lux "*" - [abstract - [monad {"+" do}]] - [control - ["[0]" exception {"+" exception:}] - ["<>" parser - ["<[0]>" json {"+" Parser}]]] - [data - [text - ["%" format {"+" format}]]] - [math - [number - ["n" nat] - ["i" int] - ["f" frac]]]]] - ["[0]" // "_" - ["[1]" license {"+" Identification - Termination - Liability - Distribution - Commercial - Extension - Entity Black_List - URL Attribution - Addendum - License} - ["[0]" time {"+" Period}] - ["[0]" copyright]]]) + [library + [lux "*" + [abstract + [monad {"+" do}]] + [control + ["[0]" exception {"+" exception:}] + ["<>" parser + ["<[0]>" json {"+" Parser}]]] + [data + [text + ["%" format {"+" format}]]] + [math + [number + ["n" nat] + ["i" int] + ["f" frac]]]]] + ["[0]" // "_" + ["[1]" license {"+" Identification + Termination + Liability + Distribution + Commercial + Extension + Entity Black_List + URL Attribution + Addendum + License} + ["[0]" time {"+" Period}] + ["[0]" copyright]]]) (def: identification (Parser Identification) @@ -58,8 +58,8 @@ (exception: .public (invalid_period [period (Period Nat)]) (exception.report - ["Start" (%.nat (value@ time.#start period))] - ["End" (%.nat (value@ time.#end period))])) + ["Start" (%.nat (the time.#start period))] + ["End" (%.nat (the time.#end period))])) (def: period (Parser (Period Nat)) diff --git a/licentia/source/program/licentia/license/addendum.lux b/licentia/source/program/licentia/license/addendum.lux index 95cc78446..3aa71b353 100644 --- a/licentia/source/program/licentia/license/addendum.lux +++ b/licentia/source/program/licentia/license/addendum.lux @@ -1,12 +1,12 @@ (.using - [library - [lux "*" - [data - [text - ["%" format {"+" format}]]]]] - ["[0]" // {"+" Addendum} - [// - ["$" document]]]) + [library + [lux "*" + [data + [text + ["%" format {"+" format}]]]]] + ["[0]" // {"+" Addendum} + [// + ["$" document]]]) ... https://commonsclause.com/ (def: .public commons_clause @@ -24,6 +24,6 @@ "")] ["“Commons Clause” License Condition v1.0" - (value@ //.#commons_clause? value) + (the //.#commons_clause? value) ..commons_clause] ))))) diff --git a/licentia/source/program/licentia/license/black_list.lux b/licentia/source/program/licentia/license/black_list.lux index 19dded3a4..24d367d6a 100644 --- a/licentia/source/program/licentia/license/black_list.lux +++ b/licentia/source/program/licentia/license/black_list.lux @@ -1,17 +1,17 @@ (.using - [library - [lux "*" - [control - ["[0]" maybe ("[1]#[0]" functor)]] - [data - ["[0]" text - ["%" format {"+" format}]] - [collection - ["[0]" list ("[1]#[0]" functor)]]]]] - ["[0]" // {"+" Entity Black_List} - ["_" term] - [// - ["$" document]]]) + [library + [lux "*" + [control + ["[0]" maybe ("[1]#[0]" functor)]] + [data + ["[0]" text + ["%" format {"+" format}]] + [collection + ["[0]" list ("[1]#[0]" functor)]]]]] + ["[0]" // {"+" Entity Black_List} + ["_" term] + [// + ["$" document]]]) (def: .public entity (-> Entity Text) @@ -22,11 +22,11 @@ (let [scope (format "The rights granted under " _.license) effect "shall not be granted to the following entities, or any subsidiary thereof" justification (|> black_list - (value@ //.#justification) + (the //.#justification) (maybe#each (|>> (format ", due to "))) (maybe.default "")) entities (|> black_list - (value@ //.#entities) + (the //.#entities) (list#each ..entity) (text.interposed text.new_line))] (format scope " " effect justification ":" text.new_line diff --git a/licentia/source/program/licentia/license/definition.lux b/licentia/source/program/licentia/license/definition.lux index 0b55e72dd..d9ddede8b 100644 --- a/licentia/source/program/licentia/license/definition.lux +++ b/licentia/source/program/licentia/license/definition.lux @@ -1,11 +1,11 @@ (.using - [library - [lux {"-" Definition} - [data - ["[0]" text - ["%" format {"+" format}]]]]] - [/// - ["$" document]]) + [library + [lux {"-" Definition} + [data + ["[0]" text + ["%" format {"+" format}]]]]] + [/// + ["$" document]]) (type: .public Definition (Record @@ -55,7 +55,7 @@ ($.paragraph (list (format "the terms and conditions defined in this document")))] [licensable "Licensable" - ($.paragraph (list (format "having the right to grant any and all of the rights conveyed by " (value@ #term license))))] + ($.paragraph (list (format "having the right to grant any and all of the rights conveyed by " (the #term license))))] [legal_entity "Legal Entity" (let [abilities (: (List Text) @@ -65,28 +65,28 @@ ($.paragraph (list (format "any human or non-human entity that is recognized as having privileges and obligations, such as having the ability " ($.and abilities)))))] [recipient "Recipient" - ($.paragraph (list (format "a " (value@ #term legal_entity) " exercising permissions by " (value@ #term license))))] + ($.paragraph (list (format "a " (the #term legal_entity) " exercising permissions by " (the #term license))))] [licensor "The Licensor" - ($.paragraph (list (format "the copyright owner granting " (value@ #term license) ", or a " (value@ #term legal_entity) " authorized by the copyright owner")))] + ($.paragraph (list (format "the copyright owner granting " (the #term license) ", or a " (the #term legal_entity) " authorized by the copyright owner")))] [source_code_form "Source Code Form" ($.paragraph (list (format "the preferred form of the " ..covered_work_description " in order to make modifications to it")))] [object_form "Object Form" - ($.paragraph (list (format "any form produced by transforming a " (value@ #term source_code_form) ", including but not limited to compiled code and transpiled code")))] + ($.paragraph (list (format "any form produced by transforming a " (the #term source_code_form) ", including but not limited to compiled code and transpiled code")))] [licensed_work "The Licensed Work" ($.paragraph (list (format "the " ..covered_work_description - ", whether in a " (value@ #term source_code_form) - " or in an " (value@ #term object_form) - ", made available under " (value@ #term license) + ", whether in a " (the #term source_code_form) + " or in an " (the #term object_form) + ", made available under " (the #term license) ", as indicated by a copyright notice that is included in or attached to the " ..covered_work_description)))] [derivative_work "Derivative Work" - ($.paragraph (list (format "any work, whether in a " (value@ #term source_code_form) - " or in an " (value@ #term object_form) - ", that is based on (or derived from) " (value@ #term licensed_work) + ($.paragraph (list (format "any work, whether in a " (the #term source_code_form) + " or in an " (the #term object_form) + ", that is based on (or derived from) " (the #term licensed_work) " and which represents an original " ..covered_work_description)))] [submission "Submission" @@ -94,17 +94,17 @@ (list "electronic" "verbal" "written"))] - ($.paragraph (list (format "any form of " ($.or forms_of_communication) " communication sent to " (value@ #term licensor) - ", or its representatives, for the purpose of discussing and improving " (value@ #term licensed_work) + ($.paragraph (list (format "any form of " ($.or forms_of_communication) " communication sent to " (the #term licensor) + ", or its representatives, for the purpose of discussing and improving " (the #term licensed_work) ", but excluding communication that is designated in writing by the copyright owner as " not_a_contribution_notice))))] [modification "Modification" (let [alteration "any addition to, or deletion from, the substance or structure of" object "file or other storage" targets (: (List Text) - (list (format "a " object " contained in " (value@ #term licensed_work)) - (format "any new " object " that contains any part of " (value@ #term licensed_work)) - (format "any " object " which replaces or otherwise alters the original functionality of "(value@ #term licensed_work) " at runtime")))] + (list (format "a " object " contained in " (the #term licensed_work)) + (format "any new " object " that contains any part of " (the #term licensed_work)) + (format "any " object " which replaces or otherwise alters the original functionality of "(the #term licensed_work) " at runtime")))] ($.paragraph (list (format alteration " " ($.or targets)))))] [required_component "Required Component" @@ -117,74 +117,74 @@ "control file" "other work"))] ($.paragraph (list (format "any " ($.or possibilities) - " created by " (value@ #term recipient) - " which is required by a third party to successfully install and run a " (value@ #term derivative_work) - " by " (value@ #term recipient)))))] + " created by " (the #term recipient) + " which is required by a third party to successfully install and run a " (the #term derivative_work) + " by " (the #term recipient)))))] [extension "Extension" (let [possibilities (: (List Text) - (list (value@ #term modification) - (value@ #term derivative_work) - (value@ #term required_component)))] + (list (the #term modification) + (the #term derivative_work) + (the #term required_component)))] ($.paragraph (list (format "any " ($.or possibilities)))))] [contribution "Contribution" - ($.paragraph (list (format "any " covered_work_description ", including the original version of " (value@ #term licensed_work) - " and any " (value@ #term extension) " to " (value@ #term licensed_work) - ", that is intentionally communicated as a " (value@ #term submission) - " to " (value@ #term licensor) - " for inclusion in " (value@ #term licensed_work) " by the copyright owner" - ", or by a " (value@ #term legal_entity) " authorized to submit on behalf of the copyright owner")))] + ($.paragraph (list (format "any " covered_work_description ", including the original version of " (the #term licensed_work) + " and any " (the #term extension) " to " (the #term licensed_work) + ", that is intentionally communicated as a " (the #term submission) + " to " (the #term licensor) + " for inclusion in " (the #term licensed_work) " by the copyright owner" + ", or by a " (the #term legal_entity) " authorized to submit on behalf of the copyright owner")))] [contributor "Contributor" - ($.paragraph (list (format (value@ #term licensor) - " or any " (value@ #term legal_entity) - " on behalf of whom a " (value@ #term contribution) - " has been received by " (value@ #term licensor) - ", and subsequently incorporated within " (value@ #term licensed_work))))] + ($.paragraph (list (format (the #term licensor) + " or any " (the #term legal_entity) + " on behalf of whom a " (the #term contribution) + " has been received by " (the #term licensor) + ", and subsequently incorporated within " (the #term licensed_work))))] - [patent_claim (format "Patent Claim Of A " (value@ #term contributor)) + [patent_claim (format "Patent Claim Of A " (the #term contributor)) (let [claim_types (: (List Text) (list "method" "process" "apparatus"))] ($.paragraph (list (format "any patent claim(s), including without limitation " ($.and claim_types) " claims, in any patent " - (value@ #term licensable) " by such " (value@ #term contributor) - " that would be infringed, but for the grant of " (value@ #term license) - ", to " ($.or patent_rights) " its " (value@ #term contribution)))))] + (the #term licensable) " by such " (the #term contributor) + " that would be infringed, but for the grant of " (the #term license) + ", to " ($.or patent_rights) " its " (the #term contribution)))))] [secondary_license "Secondary License" - ($.paragraph (list (format "any license for which compliance does not imply or require violating the terms of " (value@ #term license))))] + ($.paragraph (list (format "any license for which compliance does not imply or require violating the terms of " (the #term license))))] [sell "Sell" - ($.paragraph (list (format "practicing any or all of the rights granted to " (value@ #term recipient) - " under " (value@ #term license) + ($.paragraph (list (format "practicing any or all of the rights granted to " (the #term recipient) + " under " (the #term license) " to provide to third parties, for a fee or other consideration " "(including without limitation fees for " ($.or commercial_services) - " related to "(value@ #term licensed_work) ")" - ", a product or service whose value derives, entirely or substantially, from the functionality of " (value@ #term licensed_work))))] + " related to "(the #term licensed_work) ")" + ", a product or service whose value derives, entirely or substantially, from the functionality of " (the #term licensed_work))))] [personal_use "Personal Use" (let [valid_purposes (: (List Text) (list "personal" "private" "non-commercial"))] - ($.paragraph (list (format "use of " (value@ #term licensed_work) " by an individual solely for his or her " ($.and valid_purposes) " purposes") - (format "An individual's use of " (value@ #term licensed_work) " in his or her capacity as an " ($.or individual_capacities) " does not qualify"))))] + ($.paragraph (list (format "use of " (the #term licensed_work) " by an individual solely for his or her " ($.and valid_purposes) " purposes") + (format "An individual's use of " (the #term licensed_work) " in his or her capacity as an " ($.or individual_capacities) " does not qualify"))))] [serve "Serve" - ($.paragraph (list (format "to deliver " (value@ #term licensed_work) - " and/or any " (value@ #term extension) - " by means of a computer network to one or more computers for purposes of execution of " (value@ #term licensed_work) - ", and/or the " (value@ #term extension))))] + ($.paragraph (list (format "to deliver " (the #term licensed_work) + " and/or any " (the #term extension) + " by means of a computer network to one or more computers for purposes of execution of " (the #term licensed_work) + ", and/or the " (the #term extension))))] [research "Research" - ($.paragraph (list (format "investigation or experimentation for the purpose of understanding the nature and limits of " (value@ #term licensed_work) " and its potential uses")))] + ($.paragraph (list (format "investigation or experimentation for the purpose of understanding the nature and limits of " (the #term licensed_work) " and its potential uses")))] [deploy "Deploy" (let [deployment_types (: (List Text) (list "use" - (value@ #term serve) + (the #term serve) "sublicense" "distribute")) sub_licensing (: (-> Text Text) @@ -195,20 +195,20 @@ (sub_licensing "indirect") "distribution")) basic_definition (format "to " ($.or deployment_types) - " " (value@ #term licensed_work) - " other than for internal " (value@ #term research) - " and/or " (value@ #term personal_use) - " by " (value@ #term recipient)) - examples (format "any and all internal use or distribution of " (value@ #term licensed_work) - " within a business or organization in which " (value@ #term recipient) + " " (the #term licensed_work) + " other than for internal " (the #term research) + " and/or " (the #term personal_use) + " by " (the #term recipient)) + examples (format "any and all internal use or distribution of " (the #term licensed_work) + " within a business or organization in which " (the #term recipient) " participates") - exceptions (format "for " (value@ #term research) " and/or " (value@ #term personal_use))] + exceptions (format "for " (the #term research) " and/or " (the #term personal_use))] ($.paragraph (list (format basic_definition ", and includes without limitation, " examples ", other than " exceptions ", as well as " ($.or third_party_interactions) - " of " (value@ #term licensed_work) - " by " (value@ #term recipient) + " of " (the #term licensed_work) + " by " (the #term recipient) " to any third party in any form or manner"))))] [electronic_distribution_mechanism "Electronic Distribution Mechanism" diff --git a/licentia/source/program/licentia/license/distribution.lux b/licentia/source/program/licentia/license/distribution.lux index 8d8afba3b..d64b3ccac 100644 --- a/licentia/source/program/licentia/license/distribution.lux +++ b/licentia/source/program/licentia/license/distribution.lux @@ -1,15 +1,15 @@ (.using - [library - [lux "*" - [data - ["[0]" text - ["%" format {"+" format}]] - [collection - ["[0]" list ("[1]#[0]" monoid)]]]]] - ["[0]" // {"+" Distribution} - ["_" term] - [// - ["$" document]]]) + [library + [lux "*" + [data + ["[0]" text + ["%" format {"+" format}]] + [collection + ["[0]" list ("[1]#[0]" monoid)]]]]] + ["[0]" // {"+" Distribution} + ["_" term] + [// + ["$" document]]]) (def: notices (List Text) @@ -105,9 +105,9 @@ (def: .public (extension distribution) (-> Distribution Text) ($.paragraph ($_ list#composite - (if (value@ //.#can_re_license? distribution) + (if (the //.#can_re_license? distribution) (list allow_re_licensing) (list)) - (if (value@ //.#can_multi_license? distribution) + (if (the //.#can_multi_license? distribution) (list allow_multi_licensing) (list))))) diff --git a/licentia/source/program/licentia/license/notice.lux b/licentia/source/program/licentia/license/notice.lux index b5fd18b65..39c762ab4 100644 --- a/licentia/source/program/licentia/license/notice.lux +++ b/licentia/source/program/licentia/license/notice.lux @@ -1,32 +1,32 @@ (.using - [library - [lux "*" - [data - ["[0]" text - ["%" format {"+" format}]] - [collection - ["[0]" list ("[1]#[0]" functor)]]] - [math - [number - ["n" nat]]]]] - ["[0]" // "_" - ["[1][0]" time] - ["[1][0]" copyright] - ["_" term] - [// - ["$" document]]]) + [library + [lux "*" + [data + ["[0]" text + ["%" format {"+" format}]] + [collection + ["[0]" list ("[1]#[0]" functor)]]] + [math + [number + ["n" nat]]]]] + ["[0]" // "_" + ["[1][0]" time] + ["[1][0]" copyright] + ["_" term] + [// + ["$" document]]]) (def: .public end_of_license ($.sentence "END OF TERMS AND CONDITIONS")) (def: .public (copyright_holder holder) (-> //copyright.Holder Text) - (let [(^open "[0]") (value@ //copyright.#period holder) + (let [(^open "[0]") (the //copyright.#period holder) single_year? (n.= start end) period_section (if single_year? (%.nat start) (format (%.nat start) "-" (%.nat end)))] - (format "Copyright (C) " period_section " " (value@ //copyright.#name holder)))) + (format "Copyright (C) " period_section " " (the //copyright.#name holder)))) (def: .public copyright (-> (List //copyright.Holder) Text) diff --git a/licentia/source/program/licentia/license/term.lux b/licentia/source/program/licentia/license/term.lux index 213dd25c0..d4b56752b 100644 --- a/licentia/source/program/licentia/license/term.lux +++ b/licentia/source/program/licentia/license/term.lux @@ -1,13 +1,13 @@ (.using - [library - [lux {"-" Definition}]] - ["[0]" // "_" - ["[1][0]" definition]]) + [library + [lux {"-" Definition}]] + ["[0]" // "_" + ["[1][0]" definition]]) (template [<term> <definition>] [(def: .public <term> Text - (value@ //definition.#term <definition>))] + (the //definition.#term <definition>))] [source_code_form //definition.source_code_form] [object_form //definition.object_form] diff --git a/licentia/source/program/licentia/output.lux b/licentia/source/program/licentia/output.lux index 64d6ab597..9f08bd250 100644 --- a/licentia/source/program/licentia/output.lux +++ b/licentia/source/program/licentia/output.lux @@ -1,49 +1,49 @@ (.using - [library - [lux {"-" Definition} - [control - ["[0]" maybe ("[1]#[0]" functor)]] - [data - ["[0]" bit] - ["[0]" text - ["%" format {"+" format}]] - [collection - ["[0]" list ("[1]#[0]" functor monoid)]]]]] - [// - ["[0]" license {"+" Identification - Termination - Liability - Distribution - Commercial - Extension - Entity Black_List - URL Attribution - License} - ["[0]" copyright] - ["[0]" definition {"+" Definition}] - ["[0]" grant] - ["[0]" limitation] - ["[0]" assurance] - ["[0]" liability] - ["[0]" distribution] - ["[0]" commercial] - ["[0]" extension] - ["[0]" submission] - ["[0]" miscellaneous] - ["[0]" black_list] - ["[0]" notice] - ["_" term] - ["[0]" addendum]] - ["$" document]]) + [library + [lux {"-" Definition} + [control + ["[0]" maybe ("[1]#[0]" functor)]] + [data + ["[0]" bit] + ["[0]" text + ["%" format {"+" format}]] + [collection + ["[0]" list ("[1]#[0]" functor monoid)]]]]] + [// + ["[0]" license {"+" Identification + Termination + Liability + Distribution + Commercial + Extension + Entity Black_List + URL Attribution + License} + ["[0]" copyright] + ["[0]" definition {"+" Definition}] + ["[0]" grant] + ["[0]" limitation] + ["[0]" assurance] + ["[0]" liability] + ["[0]" distribution] + ["[0]" commercial] + ["[0]" extension] + ["[0]" submission] + ["[0]" miscellaneous] + ["[0]" black_list] + ["[0]" notice] + ["_" term] + ["[0]" addendum]] + ["$" document]]) (def: .public (definition value) (-> Definition Text) - (format ($.quote (value@ definition.#term value)) ": " (value@ definition.#meaning value))) + (format ($.quote (the definition.#term value)) ": " (the definition.#meaning value))) (def: .public (identification value) (-> Identification Text) - (format (value@ license.#name value) text.new_line - (value@ license.#version value))) + (format (the license.#name value) text.new_line + (the license.#version value))) (def: .public (grant termination) (-> Termination Text) @@ -55,14 +55,14 @@ grant.copyright] ["Grant of Patent License" - (grant.patent (value@ license.#patent_retaliation? termination))] + (grant.patent (the license.#patent_retaliation? termination))] ["Effective Date for the Grants" grant.date] ["Grant Termination" - (grant.termination (value@ license.#termination_period termination) - (value@ license.#grace_period termination))] + (grant.termination (the license.#termination_period termination) + (the license.#grace_period termination))] ["No Retroactive Effect of Termination" grant.no_retroactive_termination]))))) @@ -115,11 +115,11 @@ liability.litigation] ["Accepting Warranty or Additional Liability" - (value@ license.#can_accept? value) + (the license.#can_accept? value) liability.can_accept] ["High Risk Activities" - (value@ license.#disclaim_high_risk? value) + (the license.#disclaim_high_risk? value) liability.disclaim_high_risk]))))) (def: .public (distribution distribution) @@ -139,8 +139,8 @@ distribution.object_form] [(format "Distribution of an " _.extension) - (or (value@ license.#can_re_license? distribution) - (value@ license.#can_multi_license? distribution)) + (or (the license.#can_re_license? distribution) + (the license.#can_multi_license? distribution)) (distribution.extension distribution)]))))) (def: .public (commercial value) @@ -152,21 +152,21 @@ "")] ["Non-Commerciality" - (not (value@ license.#can_sell? value)) + (not (the license.#can_sell? value)) commercial.cannot_sell] [(format _.contributor " Attribution") - (value@ license.#require_contributor_credit? value) + (the license.#require_contributor_credit? value) commercial.require_contributor_attribution] [(format _.contributor " Endorsement") - (not (value@ license.#allow_contributor_endorsement? value)) + (not (the license.#allow_contributor_endorsement? value)) commercial.disallow_contributor_endorsement] ))))) (def: .public (extension value) (-> Extension Text) - (let [[show? document] (case (value@ license.#notification_period value) + (let [[show? document] (case (the license.#notification_period value) {.#Some period} [true (extension.notification_requirement period)] @@ -178,30 +178,30 @@ #$.content <content>])) "")] - [(value@ license.#same_license? value) "License Retention" + [(the license.#same_license? value) "License Retention" ($.paragraph (list#composite extension.sharing_requirement extension.license_conflict_resolution))] - [(value@ license.#must_be_distinguishable? value) (format _.extension " Distinctness") + [(the license.#must_be_distinguishable? value) (format _.extension " Distinctness") extension.distinctness_requirement] [show? (format _.source_code_form " Availability") document] - [(value@ license.#must_describe_modifications? value) (format "Description of " ($.plural _.modification)) + [(the license.#must_describe_modifications? value) (format "Description of " ($.plural _.modification)) extension.description_requirement])))))) (def: .public (attribution value) (-> Attribution Text) - (let [copyright_notice (format "Attribution Copyright Notice: " (value@ license.#copyright_notice value)) - phrase (case (value@ license.#phrase value) + (let [copyright_notice (format "Attribution Copyright Notice: " (the license.#copyright_notice value)) + phrase (case (the license.#phrase value) {.#Some phrase} (format text.new_line "Attribution Phrase: " phrase text.new_line) {.#None} "") - url (format text.new_line "Attribution URL: " (value@ license.#url value)) - image (case (value@ license.#image value) + url (format text.new_line "Attribution URL: " (the license.#url value)) + image (case (the license.#image value) {.#Some image} (format text.new_line "Attribution Image: " image) @@ -254,19 +254,19 @@ (def: .public (license value) (-> License Text) (let [identification (|> value - (value@ license.#identification) + (the license.#identification) (maybe#each ..identification) (maybe.default "")) - identified? (case (value@ license.#identification value) + identified? (case (the license.#identification value) {.#Some _} true {.#None} false)] (`` (format ($.block identification) - ($.block (notice.copyright (value@ license.#copyright_holders value))) + ($.block (notice.copyright (the license.#copyright_holders value))) - (case (value@ license.#black_lists value) + (case (the license.#black_lists value) {.#End} "" @@ -284,20 +284,20 @@ ($.block ($.section [#$.title (format "Acceptance of " _.license) #$.content limitation.acceptance])) - (..grant (value@ license.#termination value)) + (..grant (the license.#termination value)) ..limitation ..assurance ($.block ($.section [#$.title (format _.submission " of " ($.plural _.contribution)) #$.content submission.contribution])) - (..liability (value@ license.#liability value)) - (..distribution (value@ license.#distribution value)) - (..commercial (value@ license.#commercial value)) - (..extension (value@ license.#extension value)) + (..liability (the license.#liability value)) + (..distribution (the license.#distribution value)) + (..commercial (the license.#commercial value)) + (..extension (the license.#extension value)) (|> value - (value@ license.#attribution) + (the license.#attribution) (maybe#each (|>> ..attribution ["Attribution Information"] $.section @@ -306,7 +306,7 @@ (..miscellaneous identified?) - (addendum.output (value@ license.#addendum value)) + (addendum.output (the license.#addendum value)) notice.end_of_license )))) diff --git a/licentia/source/test/licentia.lux b/licentia/source/test/licentia.lux index b6a151822..e721d58f1 100644 --- a/licentia/source/test/licentia.lux +++ b/licentia/source/test/licentia.lux @@ -1,48 +1,48 @@ (.using - [library - [lux "*" - [program {"+" program:}] - ["_" test {"+" Test}] - [abstract - [monad {"+" do}]] - [control - ["[0]" io] - ["[0]" maybe ("[1]#[0]" functor)]] - [data - ["[0]" bit ("[1]#[0]" equivalence)] - ["[0]" text] - [collection - ["[0]" list ("[1]#[0]" functor)]]] - [math - ["[0]" random {"+" Random}] - [number - ["n" nat ("[1]#[0]" interval)]]]]] - [\\program - ["[0]" output] - ["[0]" license {"+" Identification - Termination - Liability - Distribution - Commercial - Extension - Entity Black_List - URL Attribution - Addendum - License} - ["[0]" time {"+" Period}] - ["[0]" copyright] - ["[0]" notice] - ["[0]" definition] - ["[0]" grant] - ["[0]" limitation] - ["[0]" submission] - ["[0]" liability] - ["[0]" distribution] - ["[0]" commercial] - ["[0]" extension] - ["[0]" miscellaneous] - ["[0]" black_list] - ["[0]" addendum]]]) + [library + [lux "*" + [program {"+" program:}] + ["_" test {"+" Test}] + [abstract + [monad {"+" do}]] + [control + ["[0]" io] + ["[0]" maybe ("[1]#[0]" functor)]] + [data + ["[0]" bit ("[1]#[0]" equivalence)] + ["[0]" text] + [collection + ["[0]" list ("[1]#[0]" functor)]]] + [math + ["[0]" random {"+" Random}] + [number + ["n" nat ("[1]#[0]" interval)]]]]] + [\\program + ["[0]" output] + ["[0]" license {"+" Identification + Termination + Liability + Distribution + Commercial + Extension + Entity Black_List + URL Attribution + Addendum + License} + ["[0]" time {"+" Period}] + ["[0]" copyright] + ["[0]" notice] + ["[0]" definition] + ["[0]" grant] + ["[0]" limitation] + ["[0]" submission] + ["[0]" liability] + ["[0]" distribution] + ["[0]" commercial] + ["[0]" extension] + ["[0]" miscellaneous] + ["[0]" black_list] + ["[0]" addendum]]]) (def: period (Random (Period Nat)) @@ -161,16 +161,16 @@ (_.test "Copyright grant is present." (present? grant.copyright)) (_.test "Patent grant is present." - (present? (grant.patent (value@ license.#patent_retaliation? termination)))) + (present? (grant.patent (the license.#patent_retaliation? termination)))) (_.test "Effective date for the grants is present." (present? grant.date)) (_.test "Patent grant is present." - (present? (grant.termination (value@ license.#termination_period termination) - (value@ license.#grace_period termination)))) + (present? (grant.termination (the license.#termination_period termination) + (the license.#grace_period termination)))) (_.test "The termination period is accurately conveyed." - (present? (grant.grant_restoration_clause (value@ license.#termination_period termination)))) + (present? (grant.grant_restoration_clause (the license.#termination_period termination)))) (_.test "The grace period is accurately conveyed." - (present? (grant.grace_period_clause (value@ license.#grace_period termination)))) + (present? (grant.grace_period_clause (the license.#grace_period termination)))) (_.test "The grants are not retro-actively terminated." (present? grant.no_retroactive_termination)) )) @@ -185,10 +185,10 @@ (_.test "Litigation conditions are present." (present? liability.litigation)) (_.test "Liability acceptance conditions may be present." - (bit#= (value@ license.#can_accept? liability) + (bit#= (the license.#can_accept? liability) (present? liability.can_accept))) (_.test "Liability acceptance conditions may be present." - (bit#= (value@ license.#disclaim_high_risk? liability) + (bit#= (the license.#disclaim_high_risk? liability) (present? liability.disclaim_high_risk))) )) @@ -207,13 +207,13 @@ (Concern Commercial) ($_ _.and (_.test "Non-commercial clause is present." - (bit#= (not (value@ license.#can_sell? commercial)) + (bit#= (not (the license.#can_sell? commercial)) (present? commercial.cannot_sell))) (_.test "Contributor credit condition is present." - (bit#= (value@ license.#require_contributor_credit? commercial) + (bit#= (the license.#require_contributor_credit? commercial) (present? commercial.require_contributor_attribution))) (_.test "Anti-endorsement condition is present." - (bit#= (not (value@ license.#allow_contributor_endorsement? commercial)) + (bit#= (not (the license.#allow_contributor_endorsement? commercial)) (present? commercial.disallow_contributor_endorsement))) )) @@ -221,21 +221,21 @@ (Concern Extension) ($_ _.and (_.test "The license is viral." - (bit#= (value@ license.#same_license? extension) + (bit#= (the license.#same_license? extension) (and (list.every? present? extension.sharing_requirement) (list.every? present? extension.license_conflict_resolution)))) (_.test "Extensions must be distinguishable from the original work." - (bit#= (value@ license.#must_be_distinguishable? extension) + (bit#= (the license.#must_be_distinguishable? extension) (present? extension.distinctness_requirement))) (_.test "The community must be notified of new extensions." - (case (value@ license.#notification_period extension) + (case (the license.#notification_period extension) {.#Some period} (present? (extension.notification_requirement period)) {.#None} true)) (_.test "Must describe modifications." - (bit#= (value@ license.#must_describe_modifications? extension) + (bit#= (the license.#must_describe_modifications? extension) (present? extension.description_requirement))) )) @@ -243,17 +243,17 @@ (Concern Attribution) ($_ _.and (_.test "The attribution copyright notice is present." - (present? (value@ license.#copyright_notice attribution))) + (present? (the license.#copyright_notice attribution))) (_.test "The attribution phrase is present." (|> attribution - (value@ license.#phrase) + (the license.#phrase) (maybe#each present?) (maybe.default true))) (_.test "The attribution URL is present." - (present? (value@ license.#url attribution))) + (present? (the license.#url attribution))) (_.test "The attribution image is present." (|> attribution - (value@ license.#image) + (the license.#image) (maybe#each present?) (maybe.default true))) )) @@ -279,7 +279,7 @@ (Concern Addendum) ($_ _.and (_.test "Commons clause" - (bit#= (value@ license.#commons_clause? value) + (bit#= (the license.#commons_clause? value) (present? addendum.commons_clause))) )) @@ -294,10 +294,10 @@ ($_ _.and (_.test "Copyright notices are present." (list.every? (|>> notice.copyright_holder present?) - (value@ license.#copyright_holders license))) + (the license.#copyright_holders license))) (_.test "Identification is present (if the license is identified)." - (case (value@ license.#identification license) + (case (the license.#identification license) {.#Some identification} (and (present? (output.identification identification)) (present? miscellaneous.new_versions)) @@ -307,19 +307,19 @@ (_.test "Black-lists (if wanted by licensor) are explicitly enumerated and justified." (list.every? (function (_ black_list) - (let [black_list_is_justified? (case (value@ license.#justification black_list) + (let [black_list_is_justified? (case (the license.#justification black_list) {.#Some justification} (present? justification) {.#None} bit.yes) every_entity_is_mentioned? (|> black_list - (value@ license.#entities) + (the license.#entities) (list#each black_list.entity) (list.every? present?))] (and black_list_is_justified? every_entity_is_mentioned?))) - (value@ license.#black_lists license))) + (the license.#black_lists license))) (_.test "All definitions are present." (list.every? (|>> output.definition present?) @@ -328,7 +328,7 @@ (_.test "Acceptance of the license is demanded." (present? limitation.acceptance)) - (..about_grant present? (value@ license.#termination license)) + (..about_grant present? (the license.#termination license)) (_.test "All limitations are present." (present? output.limitation)) @@ -339,15 +339,15 @@ (_.test "The terms of submission are present." (present? submission.contribution)) - (..about_liability present? (value@ license.#liability license)) + (..about_liability present? (the license.#liability license)) - (..about_distribution present? (value@ license.#distribution license)) + (..about_distribution present? (the license.#distribution license)) - (..about_commercial present? (value@ license.#commercial license)) + (..about_commercial present? (the license.#commercial license)) - (..about_extension present? (value@ license.#extension license)) + (..about_extension present? (the license.#extension license)) - (case (value@ license.#attribution license) + (case (the license.#attribution license) {.#Some attribution} (..about_attribution present? attribution) @@ -357,7 +357,7 @@ (..about_miscellaneous present?) - (..about_addendum present? (value@ license.#addendum license)) + (..about_addendum present? (the license.#addendum license)) (_.test "License ending footer is present." (present? notice.end_of_license)) |